Skip to content

Commit 4a4dfc7

Browse files
committed
Support versioned Secrets on Stacks
Signed-off-by: Katyanna Moura <[email protected]>
1 parent 2ae5564 commit 4a4dfc7

File tree

5 files changed

+48
-6
lines changed

5 files changed

+48
-6
lines changed

cluster/config-defaults.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,9 @@ stackset_configmap_support_enabled: "true"
903903
stackset_configmap_support_enabled: "false"
904904
{{end}}
905905

906+
# enable/disable secret support for stackset
907+
stackset_secret_support_enabled: "false"
908+
906909
# enable/disable traffic segment support for stackset
907910
{{if eq .Cluster.Environment "e2e"}}
908911
stackset_enable_traffic_segments: "true"

cluster/manifests/stackset-controller/01-stack-crd.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ spec:
349349
- maxReplicas
350350
- metrics
351351
type: object
352-
{{- if eq .Cluster.ConfigItems.stackset_configmap_support_enabled "true" }}
352+
{{- if or (eq .Cluster.ConfigItems.stackset_configmap_support_enabled "true") (eq .Cluster.ConfigItems.stackset_secret_support_enabled "true") }}
353353
configurationResources:
354354
description: ConfigurationResources describes the ConfigMaps that
355355
will be created. Later Secrets and PlatformCredentialSets will also
@@ -358,8 +358,19 @@ spec:
358358
description: ConfigurationResourcesSpec makes it possible to defined
359359
the config resources to be created
360360
properties:
361+
{{- if eq .Cluster.ConfigItems.stackset_configmap_support_enabled "true" }}
361362
configMapRef:
362-
description: ConfigMap to be versioned for Stack
363+
description: ConfigMap to be owned by Stack
364+
properties:
365+
name:
366+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
367+
TODO: Add other useful fields. apiVersion, kind, uid?'
368+
type: string
369+
type: object
370+
{{ end }}
371+
{{- if eq .Cluster.ConfigItems.stackset_secret_support_enabled "true" }}
372+
secretRef:
373+
description: Secret to be owned by Stack
363374
properties:
364375
name:
365376
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
@@ -368,6 +379,7 @@ spec:
368379
type: object
369380
type: object
370381
type: array
382+
{{ end }}
371383
{{ end }}
372384
externalIngress:
373385
description: Stack specific ExternalIngress, based on the parent StackSet

cluster/manifests/stackset-controller/01-stackset-crd.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ spec:
596596
- maxReplicas
597597
- metrics
598598
type: object
599-
{{- if eq .Cluster.ConfigItems.stackset_configmap_support_enabled "true" }}
599+
{{- if or (eq .Cluster.ConfigItems.stackset_configmap_support_enabled "true") (eq .Cluster.ConfigItems.stackset_secret_support_enabled "true") }}
600600
configurationResources:
601601
description: ConfigurationResources describes the ConfigMaps
602602
that will be created. Later Secrets and PlatformCredentialSets
@@ -605,8 +605,20 @@ spec:
605605
description: ConfigurationResourcesSpec makes it possible
606606
to defined the config resources to be created
607607
properties:
608+
{{- if eq .Cluster.ConfigItems.stackset_configmap_support_enabled "true" }}
608609
configMapRef:
609-
description: ConfigMap to be versioned for Stack
610+
description: ConfigMap to be owned by Stack
611+
properties:
612+
name:
613+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
614+
TODO: Add other useful fields. apiVersion, kind,
615+
uid?'
616+
type: string
617+
type: object
618+
{{ end }}
619+
{{- if eq .Cluster.ConfigItems.stackset_secret_support_enabled "true" }}
620+
secretRef:
621+
description: Secret to be owned by Stack
610622
properties:
611623
name:
612624
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
@@ -616,6 +628,7 @@ spec:
616628
type: object
617629
type: object
618630
type: array
631+
{{ end }}
619632
{{ end }}
620633
minReadySeconds:
621634
description: Minimum number of seconds for which a newly created

cluster/manifests/stackset-controller/deployment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ $version := "v1.4.27" }}
1+
{{ $version := "pr-565-26" }}
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
@@ -30,7 +30,7 @@ spec:
3030
serviceAccountName: stackset-controller
3131
containers:
3232
- name: stackset-controller
33-
image: "container-registry.zalando.net/teapot/stackset-controller:{{ $version }}"
33+
image: "container-registry-test.zalando.net/teapot/stackset-controller:{{ $version }}"
3434
args:
3535
- "--interval={{ .Cluster.ConfigItems.stackset_controller_sync_interval }}"
3636
{{- if eq .Cluster.ConfigItems.stackset_routegroup_support_enabled "true" }}
@@ -40,6 +40,9 @@ spec:
4040
{{- if eq .Cluster.ConfigItems.stackset_configmap_support_enabled "true" }}
4141
- "--enable-configmap-support"
4242
{{- end }}
43+
{{- if eq .Cluster.ConfigItems.stackset_secret_support_enabled "true" }}
44+
- "--enable-secret-support"
45+
{{- end }}
4346
{{- if eq .Cluster.ConfigItems.stackset_enable_traffic_segments "true" }}
4447
- "--enable-traffic-segments"
4548
{{- end }}

cluster/manifests/stackset-controller/rbac.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ rules:
110110
- create
111111
- update
112112
{{- end }}
113+
{{- if eq .Cluster.ConfigItems.stackset_secret_support_enabled "true" }}
114+
- apiGroups:
115+
- ""
116+
resources:
117+
- secrets
118+
verbs:
119+
- get
120+
- list
121+
- create
122+
- update
123+
{{- end }}
113124
---
114125
apiVersion: rbac.authorization.k8s.io/v1
115126
kind: ClusterRoleBinding

0 commit comments

Comments
 (0)