Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 079f008

Browse files
author
Pablo Mercado
authored
Merge pull request #137 from triggermesh/task/rename-customize-to-spectoenvs
Move customize to spectoenvs
2 parents 2c57617 + 3551b68 commit 079f008

File tree

22 files changed

+96
-96
lines changed

22 files changed

+96
-96
lines changed

config/300-crdregistration.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,22 @@ spec:
273273
- name
274274
type: object
275275
type: array
276-
customize:
277-
description: Customize contains instructions to modify parameters
276+
global:
277+
description: Global defines the configuration to be applied
278+
to all generated parameters.
279+
properties:
280+
defaultPrefix:
281+
description: DefaultPrefix to be appeneded to keys by
282+
all generated parameters. This configuration does not
283+
affect parameter keys explicitly set by users.
284+
type: string
285+
type: object
286+
specToEnvs:
287+
description: SpecToEnvs contains instructions to modify parameters
278288
generation from the instance's spec.
279289
items:
280-
description: CustomizeParameters contains instructions to
281-
modify parameters generation for the controlled instance
290+
description: SpecToEnvsParameterConfiguration contains instructions
291+
to modify parameters generation for the controlled instance
282292
spec.
283293
properties:
284294
path:
@@ -349,16 +359,6 @@ spec:
349359
- path
350360
type: object
351361
type: array
352-
global:
353-
description: Global defines the configuration to be applied
354-
to all generated parameters.
355-
properties:
356-
defaultPrefix:
357-
description: DefaultPrefix to be appeneded to keys by
358-
all generated parameters. This configuration does not
359-
affect parameter keys explicitly set by users.
360-
type: string
361-
type: object
362362
type: object
363363
statusConfiguration:
364364
description: StatusConfiguration contains rules to populate a

docs/primer.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ The CRD above defines a `kuard` resource with an schema that lets users define a
5959
kubectl apply -f https://raw.githubusercontent.com/triggermesh/scoby/main/docs/samples/00.primer/01.kuard-crd.yaml
6060
```
6161

62-
## Kuard ClusterRole
63-
6462
Since the CRD has been created at the previous step, the `kuard` resource is available and we can run a command to list the instances at the cluster:
6563

6664
```console
@@ -69,7 +67,9 @@ $ kubectl get kuards
6967
No resources found in default namespace.
7068
```
7169

72-
Not all users can manage resources though, `ServiceAccount` that need it must be granted roles on the new resource. One of those `ServiceAccount` is the one that runs Scoby, that will need to watch any changes at `kuard` instances at every namespace of the cluster and update the status (when the CRD contains the status element).
70+
## Kuard ClusterRole
71+
72+
Not all users can manage resources, each `ServiceAccount` that need it must be granted roles on the new resource. One of those `ServiceAccount` is the one that runs Scoby, that will need to watch any changes at `kuard` instances at every namespace of the cluster and update the status (when the CRD contains the status element).
7373

7474
Scoby's `ServiceAccount` uses an aggregation pattern where any `ClusterRole` that contains the label `scoby.triggermesh.io/crdregistration: "true"` will be automatically granted.
7575
@@ -150,7 +150,7 @@ Users can now create `kuards` like this one:
150150
apiVersion: extensions.triggermesh.io/v1
151151
kind: Kuard
152152
metadata:
153-
name: kuard-primer-instance
153+
name: primer-instance
154154
spec:
155155
primer: Hello World!
156156
```
@@ -164,16 +164,16 @@ The instance will generate a deployment and a service.
164164
```console
165165
$ kubectl get deployment,svc
166166
NAME READY UP-TO-DATE AVAILABLE AGE
167-
deployment.apps/kuard-primer-instance 1/1 1 1 1m00s
167+
deployment.apps/kuards-primer-instance 1/1 1 1 1m00s
168168
169169
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
170-
service/kuard-primer-instance ClusterIP 10.98.247.15 <none> 80/TCP 1m00s
170+
service/kuards-primer-instance ClusterIP 10.98.247.15 <none> 80/TCP 1m00s
171171
```
172172

173173
The service can be forwarded to be able to reach `kuard` using `http://localhost:8888`.
174174

175175
```console
176-
kubectl port-forward svc/kuard-primer-instance 8888:80
176+
kubectl port-forward svc/kuards-primer-instance 8888:80
177177
```
178178

179179
Open the URL and navigate to `Server Env` option at the vertical menu. You should find that the `.spec.primer` element at the spec has been reflected as `PRIMER` environment variable at the running pod.
@@ -189,7 +189,7 @@ This primer example does not contain status management though, which means that
189189
Remove assets created, preferably in reverse creation order to avoid getting error logs at Scoby controller.
190190

191191
```console
192-
kubectl delete kuards kuard-primer-instance
192+
kubectl delete kuards primer-instance
193193
kubectl delete crdregistrations.scoby.triggermesh.io kuards
194194
kubectl delete clusterroles crd-registrations-scoby-kuard
195195
kubectl delete crd kuards.extensions.triggermesh.io

docs/reference/registration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ The default behavior is to create parameters from each spec element (arrays will
158158

159159
```yaml
160160
parameterConfiguration:
161-
customize:
161+
specToEnvs:
162162
- path: spec.bar
163163
render:
164164
skip: true
@@ -168,7 +168,7 @@ The default behavior is to create parameters from each spec element (arrays will
168168

169169
```yaml
170170
parameterConfiguration:
171-
customize:
171+
specToEnvs:
172172
- path: spec.bar
173173
render:
174174
name: FOO_BAR
@@ -178,7 +178,7 @@ The default behavior is to create parameters from each spec element (arrays will
178178

179179
```yaml
180180
parameterConfiguration:
181-
customize:
181+
specToEnvs:
182182
- path: spec.bar
183183
render:
184184
defaultValue: hello scoby
@@ -188,7 +188,7 @@ The default behavior is to create parameters from each spec element (arrays will
188188

189189
```yaml
190190
parameterConfiguration:
191-
customize:
191+
specToEnvs:
192192
- path: spec.credentials
193193
render:
194194
name: FOO_CREDENTIALS
@@ -201,7 +201,7 @@ The default behavior is to create parameters from each spec element (arrays will
201201

202202
```yaml
203203
parameterConfiguration:
204-
customize:
204+
specToEnvs:
205205
- path: spec.preferences
206206
render:
207207
valueFromConfigmap:
@@ -213,7 +213,7 @@ The default behavior is to create parameters from each spec element (arrays will
213213

214214
```yaml
215215
parameterConfiguration:
216-
customize:
216+
specToEnvs:
217217
- path: spec.destination
218218
render:
219219
name: K_SINK
@@ -227,7 +227,7 @@ The default behavior is to create parameters from each spec element (arrays will
227227

228228
```yaml
229229
parameterConfiguration:
230-
customize:
230+
specToEnvs:
231231
- path: spec.destination
232232
render:
233233
name: K_SINK
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: extensions.triggermesh.io/v1
22
kind: Kuard
33
metadata:
4-
name: kuard-primer-instance
4+
name: primer-instance
55
spec:
66
primer: Hello World!

docs/samples/01.kuard/03.param.skip/01.kuard-registration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
repo: gcr.io/kuar-demo/kuard-amd64:blue
1616

1717
parameterConfiguration:
18-
customize:
18+
specToEnvs:
1919
# Skip variable2 from generating a parameter for the workload
2020
- path: spec.variable2
2121
render:

docs/samples/01.kuard/04.param.rename/01.kuard-registration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
repo: gcr.io/kuar-demo/kuard-amd64:blue
1616

1717
parameterConfiguration:
18-
customize:
18+
specToEnvs:
1919
# Use a specific env var key for variable2
2020
- path: spec.variable2
2121
render:

docs/samples/01.kuard/05.param.value/01.kuard-registration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
repo: gcr.io/kuar-demo/kuard-amd64:blue
1616

1717
parameterConfiguration:
18-
customize:
18+
specToEnvs:
1919
# Set a default value for variable2
2020
- path: spec.variable2
2121
render:

docs/samples/01.kuard/06.param.secret/01.kuard-registration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
repo: gcr.io/kuar-demo/kuard-amd64:blue
1717

1818
parameterConfiguration:
19-
customize:
19+
specToEnvs:
2020
# Reference a secret
2121
- path: spec.refToSecret
2222
render:

docs/samples/01.kuard/07.param.configmap/01.kuard-registration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
repo: gcr.io/kuar-demo/kuard-amd64:blue
1717

1818
parameterConfiguration:
19-
customize:
19+
specToEnvs:
2020
# Reference a ConfigMap
2121
- path: spec.refToConfigMap
2222
render:

docs/samples/01.kuard/08.param.addressable/01.kuard-registration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
repo: gcr.io/kuar-demo/kuard-amd64:blue
1717

1818
parameterConfiguration:
19-
customize:
19+
specToEnvs:
2020
# Resolve an address
2121
- path: spec.refToAddress
2222
render:

0 commit comments

Comments
 (0)