KubeZero/charts/kubezero-storage/templates/snapshot-controller/controller.yaml

70 lines
2.6 KiB
YAML
Raw Permalink Normal View History

2022-12-15 14:27:57 +00:00
{{- if .Values.snapshotController.enabled }}
2023-04-21 13:54:30 +00:00
# This YAML file shows how to deploy the snapshot controller
# The snapshot controller implements the control loop for CSI snapshot functionality.
# It should be installed as part of the base Kubernetes distribution in an appropriate
# namespace for components implementing base system functionality. For installing with
# Vanilla Kubernetes, kube-system makes sense for the namespace.
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: snapshot-controller
namespace: kube-system
labels:
{{- include "kubezero-lib.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.snapshotController.replicas }}
selector:
matchLabels:
app: snapshot-controller
2023-04-21 13:54:30 +00:00
# the snapshot controller won't be marked as ready if the v1 CRDs are unavailable
# in #504 the snapshot-controller will exit after around 7.5 seconds if it
# can't find the v1 CRDs so this value should be greater than that
minReadySeconds: 35
2023-04-21 13:54:30 +00:00
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: snapshot-controller
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- snapshot-controller
topologyKey: "kubernetes.io/hostname"
2023-04-21 13:54:30 +00:00
serviceAccountName: snapshot-controller
containers:
- name: snapshot-controller
2023-11-30 14:38:04 +00:00
image: {{ .Values.snapshotController.image.name }}:{{ .Values.snapshotController.image.tag }}
args:
- "--v={{ .Values.snapshotController.logLevel }}"
{{- if gt (int .Values.snapshotController.replicas) 1 }}
- "--leader-election=true"
{{- end }}
2023-04-21 13:54:30 +00:00
# Add a marker to the snapshot-controller manifests. This is needed to enable feature gates in CSI prow jobs.
# For example, in https://github.com/kubernetes-csi/csi-release-tools/pull/209, the snapshot-controller YAML is updated to add --prevent-volume-mode-conversion=true so that the feature can be enabled for certain e2e tests.
# end snapshot controller args
imagePullPolicy: IfNotPresent
resources:
{{- toYaml .Values.snapshotController.resources | nindent 12 }}
{{- with .Values.snapshotController.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.snapshotController.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
2022-12-15 14:27:57 +00:00
{{- end }}