Skip to content

Commit 18c5470

Browse files
Demonstrate ClusterTemplate can consume ClusterDeliveryTemplate output
1 parent ce063d9 commit 18c5470

5 files changed

Lines changed: 314 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2021 VMware
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
17+
apiVersion: v1
18+
kind: ServiceAccount
19+
metadata:
20+
name: my-service-account
21+
secrets:
22+
- name: my-service-account-secret
23+
24+
---
25+
26+
apiVersion: v1
27+
kind: Secret
28+
metadata:
29+
name: my-service-account-secret
30+
annotations:
31+
kubernetes.io/service-account.name: my-service-account
32+
data:
33+
token: "ZXlKaGJHY2lPaUpTVXpJMU5pSXNJbXRwWkNJNklubFNWM1YxVDNSRldESnZVRE4wTUd0R1EzQmlVVlJOVWtkMFNGb3RYMGh2VUhKYU1FRnVOR0Y0WlRBaWZRLmV5SnBjM01pT2lKcmRXSmxjbTVsZEdWekwzTmxjblpwWTJWaFkyTnZkVzUwSWl3aWEzVmlaWEp1WlhSbGN5NXBieTl6WlhKMmFXTmxZV05qYjNWdWRDOXVZVzFsYzNCaFkyVWlPaUprWldaaGRXeDBJaXdpYTNWaVpYSnVaWFJsY3k1cGJ5OXpaWEoyYVdObFlXTmpiM1Z1ZEM5elpXTnlaWFF1Ym1GdFpTSTZJbTE1TFhOaExYUnZhMlZ1TFd4dVkzRndJaXdpYTNWaVpYSnVaWFJsY3k1cGJ5OXpaWEoyYVdObFlXTmpiM1Z1ZEM5elpYSjJhV05sTFdGalkyOTFiblF1Ym1GdFpTSTZJbTE1TFhOaElpd2lhM1ZpWlhKdVpYUmxjeTVwYnk5elpYSjJhV05sWVdOamIzVnVkQzl6WlhKMmFXTmxMV0ZqWTI5MWJuUXVkV2xrSWpvaU9HSXhNV1V3WldNdFlURTVOeTAwWVdNeUxXRmpORFF0T0RjelpHSmpOVE13TkdKbElpd2ljM1ZpSWpvaWMzbHpkR1Z0T25ObGNuWnBZMlZoWTJOdmRXNTBPbVJsWm1GMWJIUTZiWGt0YzJFaWZRLmplMzRsZ3hpTUtnd0QxUGFhY19UMUZNWHdXWENCZmhjcVhQMEE2VUV2T0F6ek9xWGhpUUdGN2poY3RSeFhmUVFJVEs0Q2tkVmZ0YW5SUjNPRUROTUxVMVBXNXVsV3htVTZTYkMzdmZKT3ozLVJPX3BOVkNmVW8tZURpblN1Wm53bjNzMjNjZU9KM3IzYk04cnBrMHZZZFgyRVlQRGItMnd4cjIzZ1RxUjVxZU5ULW11cS1qYktXVE8wYnRYVl9wVHNjTnFXUkZIVzJBVTVHYVBpbmNWVXg1bXExLXN0SFdOOGtjTG96OF96S2RnUnJGYV92clFjb3NWZzZCRW5MSEt2NW1fVEhaR3AybU8wYmtIV3J1Q2xEUDdLc0tMOFVaZWxvTDN4Y3dQa000VlBBb2V0bDl5MzlvUi1KbWh3RUlIcS1hX3BzaVh5WE9EQU44STcybEZpUSU="
34+
type: kubernetes.io/service-account-token
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Copyright 2021 VMware
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
apiVersion: carto.run/v1alpha1
17+
kind: ClusterSourceTemplate
18+
metadata:
19+
name: example-source---cluster-template-after-deployment
20+
spec:
21+
template:
22+
apiVersion: v1
23+
kind: ConfigMap
24+
metadata:
25+
name: example-source-configmap
26+
data:
27+
player_initial_lives: "5"
28+
player_loves: "knitting"
29+
urlPath: data.player_initial_lives
30+
revisionPath: data.player_loves
31+
healthRule:
32+
alwaysHealthy: {}
33+
34+
---
35+
apiVersion: carto.run/v1alpha1
36+
kind: ClusterDeploymentTemplate
37+
metadata:
38+
name: example-deployment---cluster-template-after-deployment
39+
spec:
40+
template:
41+
apiVersion: v1
42+
kind: ConfigMap
43+
metadata:
44+
name: example-deployment-configmap
45+
data:
46+
favorite_color: $(deployment.url)$
47+
healthRule:
48+
multiMatch:
49+
healthy:
50+
matchFields:
51+
- key: .data.favorite_color
52+
operator: Exists
53+
messagePath: .metadata.name
54+
unhealthy:
55+
matchFields:
56+
- key: .data.error
57+
operator: Exists
58+
messagePath: .metadata.name
59+
---
60+
apiVersion: carto.run/v1alpha1
61+
kind: ClusterTemplate
62+
metadata:
63+
name: example-task---cluster-template-after-deployment
64+
spec:
65+
template:
66+
apiVersion: v1
67+
kind: ConfigMap
68+
metadata:
69+
name: example-task
70+
data:
71+
some_task: $(deployment.url)$
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2021 VMware
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
apiVersion: carto.run/v1alpha1
17+
kind: ClusterDelivery
18+
metadata:
19+
name: responsible-ops---cluster-template-after-deployment
20+
spec:
21+
selector:
22+
integration-test: "cluster-template-after-deployment"
23+
resources:
24+
- name: source-provider
25+
templateRef:
26+
kind: ClusterSourceTemplate
27+
name: example-source---cluster-template-after-deployment
28+
29+
- name: deployer
30+
templateRef:
31+
kind: ClusterDeploymentTemplate
32+
name: example-deployment---cluster-template-after-deployment
33+
deployment:
34+
resource: source-provider
35+
36+
- name: task
37+
templateRef:
38+
kind: ClusterTemplate
39+
name: example-task---cluster-template-after-deployment
40+
deployment:
41+
resource: deployer
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Copyright 2021 VMware
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
apiVersion: v1
17+
kind: ConfigMap
18+
metadata:
19+
name: example-source-configmap
20+
data:
21+
player_initial_lives: "5"
22+
player_loves: "knitting"
23+
24+
---
25+
apiVersion: v1
26+
kind: ConfigMap
27+
metadata:
28+
name: example-deployment-configmap
29+
data:
30+
favorite_color: "5"
31+
32+
---
33+
apiVersion: v1
34+
kind: ConfigMap
35+
metadata:
36+
name: example-task
37+
data:
38+
some_task: "5"
39+
40+
---
41+
apiVersion: carto.run/v1alpha1
42+
kind: Deliverable
43+
metadata:
44+
name: petclinic
45+
status:
46+
conditions:
47+
- type: DeliveryReady
48+
status: "True"
49+
reason: Ready
50+
- type: ResourcesSubmitted
51+
status: "True"
52+
reason: ResourceSubmissionComplete
53+
- type: ResourcesHealthy
54+
status: "True"
55+
reason: HealthyConditionRule
56+
- type: Ready
57+
status: "True"
58+
reason: Ready
59+
deliveryRef:
60+
name: responsible-ops---cluster-template-after-deployment
61+
kind: ClusterDelivery
62+
resources:
63+
- name: source-provider
64+
stampedRef:
65+
apiVersion: v1
66+
kind: ConfigMap
67+
name: example-source-configmap
68+
templateRef:
69+
apiVersion: carto.run/v1alpha1
70+
kind: ClusterSourceTemplate
71+
name: example-source---cluster-template-after-deployment
72+
outputs:
73+
- name: url
74+
preview: |
75+
"5"
76+
digest: sha256:11fd182657d58787e0e5b61c5da79195f8715fef7f957b9cdba2d8a581b2ca33
77+
- name: revision
78+
preview: |
79+
knitting
80+
digest: sha256:ccea367d03c124f9594e3ba0aa97e533c35a47694f62757e4dce79039ca361d7
81+
conditions:
82+
- type: ResourceSubmitted
83+
status: "True"
84+
reason: ResourceSubmissionComplete
85+
- type: Healthy
86+
status: "True"
87+
reason: AlwaysHealthy
88+
- type: Ready
89+
status: "True"
90+
reason: Ready
91+
- name: deployer
92+
stampedRef:
93+
apiVersion: v1
94+
kind: ConfigMap
95+
name: example-deployment-configmap
96+
templateRef:
97+
apiVersion: carto.run/v1alpha1
98+
kind: ClusterDeploymentTemplate
99+
name: example-deployment---cluster-template-after-deployment
100+
inputs:
101+
- name: source-provider
102+
outputs:
103+
- name: url
104+
preview: |
105+
"5"
106+
digest: sha256:11fd182657d58787e0e5b61c5da79195f8715fef7f957b9cdba2d8a581b2ca33
107+
- name: revision
108+
preview: |
109+
knitting
110+
digest: sha256:ccea367d03c124f9594e3ba0aa97e533c35a47694f62757e4dce79039ca361d7
111+
conditions:
112+
- type: ResourceSubmitted
113+
status: "True"
114+
reason: ResourceSubmissionComplete
115+
- type: Healthy
116+
status: "True"
117+
reason: MatchedField
118+
message: "field value: 5, message: example-deployment-configmap"
119+
- type: Ready
120+
status: "True"
121+
reason: Ready
122+
- name: task
123+
stampedRef:
124+
apiVersion: v1
125+
kind: ConfigMap
126+
name: example-task
127+
templateRef:
128+
apiVersion: carto.run/v1alpha1
129+
kind: ClusterTemplate
130+
name: example-task---cluster-template-after-deployment
131+
inputs:
132+
- name: deployer
133+
conditions:
134+
- type: ResourceSubmitted
135+
status: "True"
136+
reason: ResourceSubmissionComplete
137+
- type: Healthy
138+
status: "True"
139+
reason: AlwaysHealthy
140+
- type: Ready
141+
status: "True"
142+
reason: Ready
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2021 VMware
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
apiVersion: carto.run/v1alpha1
17+
kind: Deliverable
18+
metadata:
19+
name: petclinic
20+
labels:
21+
integration-test: "cluster-template-after-deployment"
22+
spec:
23+
serviceAccountName: my-service-account
24+
source:
25+
git:
26+
url: https://github.com/spring-projects/spring-petclinic.git

0 commit comments

Comments
 (0)