Skip to content

Commit 894d049

Browse files
authored
Merge pull request #5 from upbound/feature/remove-.up-folder
feat(platform-ref): platform-ref-* adoptions
2 parents fd9d99e + 422b9e2 commit 894d049

14 files changed

+86
-54
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ UPTEST_VERSION = v0.6.1
2222
# NOTE(jastang): Configurations deployed in Upbound do not currently follow
2323
# certain conventions such as the default examples root or package directory.
2424
XPKG_DIR = $(shell pwd)
25-
XPKG_EXAMPLES_DIR = .up/examples
26-
XPKG_IGNORE = .github/workflows/ci.yaml,.github/workflows/tag.yml,.github/workflows/e2e.yaml,init/*.yaml,.work/uptest-datasource.yaml,.up/config/*/*.yaml,test/provider/*.yaml,.up/examples/*.yaml
25+
XPKG_EXAMPLES_DIR = examples
26+
XPKG_IGNORE = .github/workflows/ci.yaml,.github/workflows/tag.yml,.github/workflows/e2e.yaml,init/*.yaml,.work/uptest-datasource.yaml,test/provider/*.yaml,examples/*.yaml
2727

2828
XPKG_REG_ORGS ?= xpkg.upbound.io/upbound
2929
# NOTE(hasheddan): skip promoting on xpkg.upbound.io as channel tags are
@@ -33,7 +33,7 @@ XPKGS = $(PROJECT_NAME)
3333
-include build/makelib/xpkg.mk
3434

3535
CROSSPLANE_NAMESPACE = upbound-system
36-
CROSSPLANE_ARGS = "--debug"
36+
CROSSPLANE_ARGS = "--enable-usages"
3737
-include build/makelib/local.xpkg.mk
3838
-include build/makelib/controlplane.mk
3939

@@ -69,7 +69,7 @@ build.init: $(UP)
6969
# You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl.
7070
uptest: $(UPTEST) $(KUBECTL) $(KUTTL)
7171
@$(INFO) running automated tests
72-
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e .up/examples/oss.yaml,.up/examples/folder-grafana.yaml,.up/examples/dashboard-grafana-crossplane-health.yaml,.up/examples/dashboard-grafana-crossplane-mr.yaml,.up/examples/dashboard-grafana-crossplane-resources-ttr.yaml,.up/examples/dashboard-grafana-crossplane-sli-metrics.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL)
72+
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL)
7373
@$(OK) running automated tests
7474

7575
# This target requires the following environment variables to be set:

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ Apply the resource claim as follows to re-create
2222
the namespace, Prometheus, Grafana and dependencies for further
2323
exploration.
2424
```
25-
kubectl apply -f .up/examples/oss.yaml
25+
kubectl apply -f examples/oss.yaml
2626
```
2727

2828
To load dashboards that are part of this configuration repository,
2929
please apply the following dashboard resource claims.
3030
```
31-
kubectl apply -f .up/examples/dashboards/folder-grafana.yaml
32-
kubectl apply -f .up/examples/dashboards/dashboard-grafana-crossplane-health.yaml
33-
kubectl apply -f .up/examples/dashboards/dashboard-grafana-crossplane-mr.yaml
34-
kubectl apply -f .up/examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml
35-
kubectl apply -f .up/examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml
31+
kubectl apply -f examples/dashboards/folder-grafana.yaml
32+
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-health.yaml
33+
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-mr.yaml
34+
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml
35+
kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml
3636
```
3737

3838
Use the following to forward localhost:9090 to the Prometheus pod.
@@ -62,13 +62,13 @@ scripts/grafana-get-creds.sh
6262
See example dashboards below.
6363

6464
#### Crossplane MR Dashboard
65-
![Crossplane MR Dashboard](.up/docs/media/crossplane-mr-dashboard.png)
65+
![Crossplane MR Dashboard](docs/media/crossplane-mr-dashboard.png)
6666

6767
#### Controller Runtime Panels From Crossplane Dashboard
68-
![Controller Runtime Panels From Crossplane Dashboar](.up/docs/media/crossplane-controller-runtime-panels.png)
68+
![Controller Runtime Panels From Crossplane Dashboar](docs/media/crossplane-controller-runtime-panels.png)
6969

7070
#### Resources TTR Dashboard
71-
![Resources TTR Dashboard](.up/docs/media/resoures-ttr-dashboard.png)
71+
![Resources TTR Dashboard](docs/media/resoures-ttr-dashboard.png)
7272

7373
### Crossplane Observability In Action
7474
Once your cluster has been bootstrapped, and that prometheus and grafana

apis/oss/composition.yaml

+69-7
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ spec:
1515
toFieldPath: spec.deletionPolicy
1616
- fromFieldPath: spec.parameters.id
1717
toFieldPath: spec.providerConfigRef.name
18-
transforms:
19-
- type: string
20-
string:
21-
fmt: "configuration-observability-%s"
2218

2319
resources:
2420
- name: podMonitorCrossplaneRbacManager
2521
base:
2622
apiVersion: kubernetes.crossplane.io/v1alpha1
2723
kind: Object
24+
metadata:
25+
labels:
26+
type: podMonitorCrossplaneRbacManager
2827
spec:
2928
forProvider:
3029
manifest:
@@ -49,6 +48,9 @@ spec:
4948
base:
5049
apiVersion: kubernetes.crossplane.io/v1alpha1
5150
kind: Object
51+
metadata:
52+
labels:
53+
type: podMonitorCrossplane
5254
spec:
5355
forProvider:
5456
manifest:
@@ -73,6 +75,9 @@ spec:
7375
base:
7476
apiVersion: kubernetes.crossplane.io/v1alpha1
7577
kind: Object
78+
metadata:
79+
labels:
80+
type: podMonitorCrossplaneProviders
7681
spec:
7782
forProvider:
7883
manifest:
@@ -120,12 +125,69 @@ spec:
120125
- fromFieldPath: spec.parameters.id
121126
toFieldPath: metadata.annotations[crossplane.io/external-name]
122127
transforms:
123-
- type: string
124-
string:
125-
fmt: "configuration-observability-%s"
128+
- type: match
129+
match:
130+
patterns:
131+
- type: regexp
132+
regexp: '.*'
133+
result: oss
126134
- fromFieldPath: metadata.labels
127135
toFieldPath: metadata.labels
128136
- fromFieldPath: metadata.annotations
129137
toFieldPath: metadata.annotations
130138
- fromFieldPath: spec.parameters.operators.prometheus.version
131139
toFieldPath: spec.forProvider.chart.version
140+
141+
- name: usagePrometheusByPodMonitorCrossplaneRbacManager
142+
base:
143+
apiVersion: apiextensions.crossplane.io/v1alpha1
144+
kind: Usage
145+
spec:
146+
of:
147+
apiVersion: helm.crossplane.io/v1beta1
148+
kind: Release
149+
resourceSelector:
150+
matchControllerRef: true
151+
by:
152+
apiVersion: kubernetes.crossplane.io/v1alpha1
153+
kind: Object
154+
resourceSelector:
155+
matchControllerRef: true
156+
matchLabels:
157+
type: podMonitorCrossplaneRbacManager
158+
159+
- name: usagePrometheusByPodMonitorCrossplane
160+
base:
161+
apiVersion: apiextensions.crossplane.io/v1alpha1
162+
kind: Usage
163+
spec:
164+
of:
165+
apiVersion: helm.crossplane.io/v1beta1
166+
kind: Release
167+
resourceSelector:
168+
matchControllerRef: true
169+
by:
170+
apiVersion: kubernetes.crossplane.io/v1alpha1
171+
kind: Object
172+
resourceSelector:
173+
matchControllerRef: true
174+
matchLabels:
175+
type: podMonitorCrossplane
176+
177+
- name: usagePrometheusByPodMonitorProviders
178+
base:
179+
apiVersion: apiextensions.crossplane.io/v1alpha1
180+
kind: Usage
181+
spec:
182+
of:
183+
apiVersion: helm.crossplane.io/v1beta1
184+
kind: Release
185+
resourceSelector:
186+
matchControllerRef: true
187+
by:
188+
apiVersion: kubernetes.crossplane.io/v1alpha1
189+
kind: Object
190+
resourceSelector:
191+
matchControllerRef: true
192+
matchLabels:
193+
type: podMonitorCrossplaneProviders

apis/oss/definition.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kind: CompositeResourceDefinition
33
metadata:
44
name: xosss.observe.platform.upbound.io
55
spec:
6+
defaultCompositeDeletePolicy: Foreground
67
group: observe.platform.upbound.io
78
names:
89
kind: XOss
File renamed without changes.
+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
apiVersion: observe.platform.upbound.io/v1alpha1
22
kind: Oss
33
metadata:
4-
name: oss
4+
name: configuration-observability-oss
55
namespace: default
6-
annotations:
7-
uptest.upbound.io/pre-delete-hook: ../../test/pre-delete-hook.sh
86
spec:
7+
compositeDeletePolicy: Foreground
98
parameters:
10-
id: oss
9+
id: configuration-observability-oss
1110
operators:
1211
prometheus:
1312
version: "52.1.0"

test/pre-delete-hook.sh

-30
This file was deleted.

0 commit comments

Comments
 (0)