From b387cf58c65d3bee0482cf4ec4e2249ba8529492 Mon Sep 17 00:00:00 2001 From: Tayler Geiger Date: Thu, 13 Feb 2025 17:45:43 -0600 Subject: [PATCH] Add an overlay for local development on Tilt Adds an overlay that removes the liveness and readiness probes as well as the --leader-elect flag from the operator-controller-controller-manager deployment since those will cause container restarts when the go debugger is stopped at breakpoints. Also edits the Tiltfile to use this new overlay target. Also adds our 1 existing feature flag to the new overlay. Signed-off-by: Tayler Geiger --- Tiltfile | 2 +- .../overlays/tilt-local-dev/kustomization.yaml | 16 ++++++++++++++++ .../tilt-local-dev/patches/dev-deployment.yaml | 13 +++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 config/overlays/tilt-local-dev/kustomization.yaml create mode 100644 config/overlays/tilt-local-dev/patches/dev-deployment.yaml diff --git a/Tiltfile b/Tiltfile index 7aa07e811..5682e106c 100644 --- a/Tiltfile +++ b/Tiltfile @@ -2,7 +2,7 @@ load('.tilt-support', 'deploy_repo') operator_controller = { 'image': 'quay.io/operator-framework/operator-controller', - 'yaml': 'config/overlays/cert-manager', + 'yaml': 'config/overlays/tilt-local-dev', 'binaries': { './cmd/operator-controller': 'operator-controller-controller-manager', }, diff --git a/config/overlays/tilt-local-dev/kustomization.yaml b/config/overlays/tilt-local-dev/kustomization.yaml new file mode 100644 index 000000000..81bc3ffdc --- /dev/null +++ b/config/overlays/tilt-local-dev/kustomization.yaml @@ -0,0 +1,16 @@ +# kustomization file for secure operator-controller +# DO NOT ADD A NAMESPACE HERE +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../base +components: +- ../../components/tls +# ca must be last or tls will overwrite the namespaces +- ../../components/ca + +patches: + - target: + kind: Deployment + name: controller-manager + path: patches/dev-deployment.yaml diff --git a/config/overlays/tilt-local-dev/patches/dev-deployment.yaml b/config/overlays/tilt-local-dev/patches/dev-deployment.yaml new file mode 100644 index 000000000..2d7cb9467 --- /dev/null +++ b/config/overlays/tilt-local-dev/patches/dev-deployment.yaml @@ -0,0 +1,13 @@ +# remove livenessProbe and readinessProbe so container doesn't restart during breakpoints +- op: replace + path: /spec/template/spec/containers/0/livenessProbe + value: null +- op: replace + path: /spec/template/spec/containers/0/readinessProbe + value: null +- op: remove + # remove --leader-elect so container doesn't restart during breakpoints + path: /spec/template/spec/containers/0/args/2 +- op: add + path: /spec/template/spec/containers/0/args/- + value: --feature-gates=PreflightPermissions=true