Skip to content

Commit

Permalink
Add extra sidecar containers config for Keda operator (kedacore#608)
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Petrazickis <[email protected]>
  • Loading branch information
lpetrazickisupgrade authored and QuentinBisson committed Jul 1, 2024
1 parent 0429bf5 commit 06c0da2
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,22 @@ jobs:
certManager:
enabled: ${{ matrix.enableCertManager }}
generateCA: true
extraInitContainers:
- name: hello-once
args:
- -c
- "echo 'Hello World!'"
command:
- /bin/sh
image: 'busybox:glibc'
extraContainers:
- name: hello-many
args:
- -c
- "while true; do echo hi; sleep 300; done"
command:
- /bin/sh
image: 'busybox:glibc'
extraObjects:
- apiVersion: keda.sh/v1alpha1
kind: ClusterTriggerAuthentication
Expand Down
2 changes: 2 additions & 0 deletions keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ their default values.
| `logging.operator.timeEncoding` | string | `"rfc3339"` | Logging time encoding for KEDA Operator. allowed values are `epoch`, `millis`, `nano`, `iso8601`, `rfc3339` or `rfc3339nano` |
| `operator.affinity` | object | `{"podAntiAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"labelSelector":{"matchExpressions":[{"key":"app","operator":"In","values":["keda-operator"]}]},"topologyKey":"kubernetes.io/hostname"}]}}` | [Affinity] for pod scheduling for KEDA operator. Takes precedence over the `affinity` field |
| `operator.disableCompression` | bool | `true` | Disable response compression for k8s restAPI in client-go. Disabling compression simply means that turns off the process of making data smaller for K8s restAPI in client-go for faster transmission. |
| `operator.extraContainers` | list | `[]` | Additional containers to run as part of the operator deployment |
| `operator.extraInitContainers` | list | `[]` | Additional init containers to run as part of the operator deployment |
| `operator.livenessProbe` | object | `{"failureThreshold":3,"initialDelaySeconds":25,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Liveness probes for operator ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)) |
| `operator.name` | string | `"keda-operator"` | Name of the KEDA operator |
| `operator.readinessProbe` | object | `{"failureThreshold":3,"initialDelaySeconds":20,"periodSeconds":3,"successThreshold":1,"timeoutSeconds":1}` | Readiness probes for operator ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes)) |
Expand Down
7 changes: 7 additions & 0 deletions keda/templates/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ spec:
{{- else }}
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- if .Values.operator.extraContainers }}
{{- toYaml .Values.operator.extraContainers | nindent 8 }}
{{- end }}
{{- if .Values.operator.extraInitContainers }}
initContainers:
{{- toYaml .Values.operator.extraInitContainers | nindent 8 }}
{{- end }}
volumes:
- name: certificates
secret:
Expand Down
38 changes: 28 additions & 10 deletions keda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,34 @@ operator:
# Disabling compression simply means that turns off the process of making data smaller for K8s restAPI in client-go for faster transmission.
disableCompression: true
# -- [Affinity] for pod scheduling for KEDA operator. Takes precedence over the `affinity` field
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- keda-operator
topologyKey: "kubernetes.io/hostname"
affinity: {}
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: app
# operator: In
# values:
# - keda-operator
# topologyKey: "kubernetes.io/hostname"
# -- Additional containers to run as part of the operator deployment
extraContainers: []
# - name: hello-many
# args:
# - -c
# - "while true; do echo hi; sleep 300; done"
# command:
# - /bin/sh
# image: 'busybox:glibc'
# -- Additional init containers to run as part of the operator deployment
extraInitContainers: []
# - name: hello-once
# args:
# - -c
# - "echo 'Hello World!'"
# command:
# - /bin/sh
# image: 'busybox:glibc'
# -- Liveness probes for operator ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/))
livenessProbe:
initialDelaySeconds: 25
Expand Down

0 comments on commit 06c0da2

Please sign in to comment.