Files
external-snapshotter/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
Baptiste Girard-Carrabin 72b51c066c [snapshot-controller] Fix wait for CRDs duration
Ensure the function `ensureCustomResourceDefinitionsExist` returns when
the duration specified in `retryCRDIntervalMax` flag is reached.
This works by passing a context to the backoff so that we can
timeout with context.WithTimeout. The new (correct) default duration for
the flag is 30s to give a bit more time when controller and CRD are
created at the same time.
Also limit the amount of resources returned by the list calls to 0 to
speed up the operations because we only care that the CRD exists.
2024-01-10 10:36:55 +01:00

45 lines
1.8 KiB
YAML

# 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
spec:
replicas: 2
selector:
matchLabels:
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
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: snapshot-controller
spec:
serviceAccountName: snapshot-controller
containers:
- name: snapshot-controller
image: registry.k8s.io/sig-storage/snapshot-controller:v6.3.1
args:
- "--v=5"
- "--leader-election=true"
# 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