2020-09-03 19:01:43 +08: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.
|
|
|
|
|
|
|
|
---
|
2021-09-06 19:24:29 +08:00
|
|
|
kind: Deployment
|
2020-09-03 19:01:43 +08:00
|
|
|
apiVersion: apps/v1
|
|
|
|
metadata:
|
|
|
|
name: snapshot-controller
|
2022-01-15 04:58:26 +08:00
|
|
|
namespace: {{ snapshot_controller_namespace }}
|
2020-09-03 19:01:43 +08:00
|
|
|
spec:
|
|
|
|
replicas: {{ snapshot_controller_replicas }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2024-04-11 11:38:08 +08:00
|
|
|
app.kubernetes.io/name: snapshot-controller
|
|
|
|
# The snapshot controller won't be marked as ready if the v1 CRDs are unavailable.
|
|
|
|
# The flag --retry-crd-interval-max is used to determine how long the controller
|
|
|
|
# will wait for the CRDs to become available before exiting. The default is 30 seconds
|
|
|
|
# so minReadySeconds should be set slightly higher than the flag value.
|
|
|
|
minReadySeconds: 35
|
2021-09-06 19:24:29 +08:00
|
|
|
strategy:
|
|
|
|
rollingUpdate:
|
|
|
|
maxSurge: 0
|
|
|
|
maxUnavailable: 1
|
|
|
|
type: RollingUpdate
|
2020-09-03 19:01:43 +08:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2024-04-11 11:38:08 +08:00
|
|
|
app.kubernetes.io/name: snapshot-controller
|
2020-09-03 19:01:43 +08:00
|
|
|
spec:
|
2024-04-11 11:38:08 +08:00
|
|
|
serviceAccountName: snapshot-controller
|
2020-09-03 19:01:43 +08:00
|
|
|
containers:
|
|
|
|
- name: snapshot-controller
|
|
|
|
image: {{ snapshot_controller_image_repo }}:{{ snapshot_controller_image_tag }}
|
2024-04-11 11:38:08 +08:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2020-09-03 19:01:43 +08:00
|
|
|
args:
|
|
|
|
- "--v=5"
|
2024-04-11 11:38:08 +08:00
|
|
|
- "--leader-election={{ 'true' if snapshot_controller_replicas > 1 else 'false' }}"
|