Skip to content

Commit 9cc5134

Browse files
chore(CLOUD-20): use config generator to dynamically replace opensearch labels
1 parent 6fdd369 commit 9cc5134

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

config/manager/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: cleaner-controller-logs-config
5+
data:
6+
journey: '{{ .Values.opensearch.journey | default "not-configured" }}'
7+
search_index: '{{ .Values.opensearch.search_index | default "not-configured" }}'

config/manager/kustomization.yaml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
resources:
22
- manager.yaml
3-
commonLabels:
4-
journey: '{{ .Values.opensearch.journey | default "not-configured" }}'
5-
search_index: '{{ .Values.opensearch.search_index | default "not-configured" }}'
3+
- config.yaml
4+
5+
replacements:
6+
- source:
7+
fieldPath: data.journey
8+
kind: ConfigMap
9+
name: cleaner-controller-logs-config
10+
targets:
11+
- fieldPaths:
12+
- spec.template.metadata.labels.journey
13+
select:
14+
kind: Deployment
15+
name: controller-manager
16+
- source:
17+
fieldPath: data.search_index
18+
kind: ConfigMap
19+
name: cleaner-controller-logs-config
20+
targets:
21+
- fieldPaths:
22+
- spec.template.metadata.labels.search_index
23+
select:
24+
kind: Deployment
25+
name: controller-manager
26+
apiVersion: kustomize.config.k8s.io/v1beta1
27+
kind: Kustomization
28+
images:
29+
- name: controller
30+
newName: public.ecr.aws/f8y0w2c4/cleaner-controller
31+
newTag: manager-local-v0.2.0-beta.3

config/manager/manager.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ spec:
3535
kubectl.kubernetes.io/default-container: manager
3636
labels:
3737
control-plane: controller-manager
38+
journey: "not-configured"
39+
search_index: "not-configured"
3840
spec:
3941
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
4042
# according to the platforms which are supported by your solution.

0 commit comments

Comments
 (0)