feat: add sync script for controller webhook manifests#25
feat: add sync script for controller webhook manifests#25MAVRICK-1 wants to merge 6 commits intoopeneverest:v2from
Conversation
chilagrow
left a comment
There was a problem hiding this comment.
Thanks for your contribution 🤗! Let's use the same fetch and replace pattern for deployment resource type.
|
cc @chilagrow |
chilagrow
left a comment
There was a problem hiding this comment.
Thanks a lot for your contribution again 🤗. The way it fetches initial manifest is not quite correct, I think we can utilize kustomize to get manifest config.
|
Hi @MAVRICK-1 do you need any hand for this? |
|
@chilagrow i will look into it this week |
Add sync-controller-webhook.sh and controller-webhook-gen Makefile target to automatically sync webhook Service and ValidatingWebhookConfiguration from openeverest config/webhook/ into Helm templates, mirroring the existing controller-manifests-gen pattern for RBAC resources. Also add controller-webhook-gen to the prepare-pr target so it runs alongside crds-gen and controller-manifests-gen. Signed-off-by: mavrick-1 <mavrickrishi@gmail.com>
Signed-off-by: mavrick-1 <mavrickrishi@gmail.com>
…plate for improved Helm compatibility Signed-off-by: mavrick-1 <mavrickrishi@gmail.com>
Replace curl + sed + awk approach with kustomize build of config/default (same pattern as sync-controller-rbac.sh). kustomize produces a clean, comment-free deployment manifest with all configurations applied. The script then locates the generated deployment file and applies Helm-specific sed/awk transformations. Signed-off-by: mavrick-1 <mavrickrishi@gmail.com>
Fix duplicate imagePullPolicy and --webhook-cert-path (upstream already has them), wrong serviceAccountName order (global sed was running before specific replacement), and env: [] not being replaced with Helm template. Tested against live kustomize output from config/default@v2. Signed-off-by: mavrick-1 <mavrickrishi@gmail.com>
2ecda83 to
4028e6b
Compare
… sync - Template --monitoring-namespace arg using .Values.monitoring.namespaceOverride - Rename volume/secret from webhook-certs to everest-controller-webhook-server-cert - Regenerate deployment.yaml from kustomize with fixes applied - Verified: helm lint passes, no duplicate fields Signed-off-by: mavrick-1 <mavrickrishi@gmail.com>
|
@chilagrow it's okay now ? |
|
|
||
| echo " Syncing webhook Service -> ${WEBHOOK_SERVICE_DEST}" | ||
|
|
||
| curl -sSfL "${WEBHOOK_SERVICE_SRC}" \ |
There was a problem hiding this comment.
Let's use kustomize here too 🤗. We want to use kustomize because openeverest repo created config files to be with kustomize. You should be able find *_service_openeverest-webhook-service.yaml configuration manifest
| -e 's|name: validating-webhook-configuration|name: everest-controller-validating-webhook-configuration|' \ | ||
| -e 's|name: webhook-service|name: everest-controller-webhook-service|' \ | ||
| -e 's|namespace: system|namespace: {{ include "everest.namespace" . }}|' \ | ||
| -e 's|name: vmonitoringconfig-v1alpha1.kb.io|name: vmonitoringconfig-v1alpha1.monitoring.openeverest.io|' \ |
There was a problem hiding this comment.
vmonitoringconfig-v1alpha1.kb.io was changed to vmonitoringconfig-v1alpha2.kb.io.
Could we update expression so that
vmonitoringconfig-<any-version>.kb.io maps to vmonitoringconfig-<any-version>.monitoring.openeverest.io please?
Webhook templates under everest-controller were hand-crafted copies of config/webhook in the openeverest repo, which could drift out of sync over time. This adds a sync-controller-webhook.sh script that fetches the webhook service and manifest files from the openeverest v2 branch and transforms them into proper Helm templates with correct namespacing, labels, and TLS injection. A controller-webhook-gen Makefile target is added alongside the existing controller-manifests-gen, and it is wired into prepare-pr so it runs automatically. Output was verified to be byte-identical to the existing templates.
Fixes #24