Skip to content

Commit

Permalink
Add updateStrategy controls (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
day1118 authored Jan 24, 2025
1 parent 313a53e commit f32f072
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,4 @@ __debug_bin

# Other
/.run/
/temp/
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,23 @@ following topics:

### Deployment configuration

| Name | Description | Value |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------ |
| `affinity` | Affinity for pod assignment | `{}` |
| `extraEnvVars` | Extra environment variables to be set on Cyral Sidecar containers | `[]` |
| `extraEnvVarsCM` | ConfigMap with extra environment variables | `""` |
| `extraEnvVarsSecret` | Secret with extra environment variables | `""` |
| `extraVolumes` | Array of extra volumes to be added to the Cyral Sidecar deployment (evaluated as template). Requires setting `extraVolumeMounts` | `[]` |
| `nodeAffinityPreset.key` | Node label key to match Ignored if `affinity` is set. | `""` |
| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` |
| `nodeSelector` | Node labels for pod assignment. Evaluated as a template. | `{}` |
| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `hard` |
| `replicaCount` | Number of Cyral Sidecar replicas to deploy | `1` |
| `resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
| `tolerations` | Tolerations for pod assignment. Evaluated as a template. | `[]` |
| Name | Description | Value |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ------ |
| `affinity` | Affinity for pod assignment | `{}` |
| `extraEnvVars` | Extra environment variables to be set on Cyral Sidecar containers | `[]` |
| `extraEnvVarsCM` | ConfigMap with extra environment variables | `""` |
| `extraEnvVarsSecret` | Secret with extra environment variables | `""` |
| `extraVolumes` | Array of extra volumes to be added to the Cyral Sidecar deployment (evaluated as template). Requires setting `extraVolumeMounts` | `[]` |
| `nodeAffinityPreset.key` | Node label key to match Ignored if `affinity` is set. | `""` |
| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` |
| `nodeSelector` | Node labels for pod assignment. Evaluated as a template. | `{}` |
| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `hard` |
| `replicaCount` | Number of Cyral Sidecar replicas to deploy | `1` |
| `resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
| `tolerations` | Tolerations for pod assignment. Evaluated as a template. | `[]` |
| `updateStrategy.rollingUpdate` | Deployment rolling update configuration parameters. | `{}` |

### Image configuration

Expand Down
3 changes: 3 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ metadata:
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
{{- if .Values.updateStrategy }}
strategy: {{- toYaml .Values.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
Expand Down
5 changes: 5 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ extraEnvVarsCM: ""
extraEnvVarsSecret: ""

replicaCount: 1
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
##
updateStrategy:
type: RollingUpdate
rollingUpdate: {}
## Example:
## resources:
## requests:
Expand Down

0 comments on commit f32f072

Please sign in to comment.