Skip to content

Commit

Permalink
feat: Allow to specify controller args and env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Jun 2, 2023
1 parent 03ac5be commit 53d56ed
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
9 changes: 5 additions & 4 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ spec:
# seccompProfile:
# type: RuntimeDefault
containers:
- command:
- name: controller
image: ghcr.io/kluctl/kluctl:latest
imagePullPolicy: IfNotPresent
command:
- kluctl
- controller
- run
args:
- --leader-elect
image: ghcr.io/kluctl/kluctl:latest
imagePullPolicy: IfNotPresent
name: controller
env: []
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
6 changes: 5 additions & 1 deletion install/controller/.kluctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ discriminator: kluctl.io-controller

args:
- name: controller_version
default: v2.20.3
default: v2.20.3
- name: controller_args
default: []
- name: controller_envs
default: []
15 changes: 14 additions & 1 deletion install/controller/controller/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,25 @@ patches:
- op: add
path: /spec/template/spec/containers/0/image
value: ghcr.io/kluctl/kluctl:{{ controller_version }}
{% if "-devel" in controller_version %}
- target:
kind: Deployment
name: kluctl-controller
patch: |-
- op: test
path: /kind
value: Deployment # this is just a dummy test to avoid empty patches
{% if "-devel" in controller_version %}
- op: add
path: /spec/template/spec/containers/0/imagePullPolicy
value: Always
{% endif %}
{% for a in get_var("args.controller_args", []) %}
- op: add
path: /spec/template/spec/containers/0/args/-
value: "{{ a }}"
{% endfor %}
{% for a in get_var("args.controller_envs", []) %}
- op: add
path: /spec/template/spec/containers/0/env/-
value: {{ a | to_json }}
{% endfor %}
1 change: 1 addition & 0 deletions install/controller/controller/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
- kluctl
- controller
- run
env: []
image: ghcr.io/kluctl/kluctl:latest
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down

0 comments on commit 53d56ed

Please sign in to comment.