Skip to content

feat: add sync script for controller webhook manifests#25

Open
MAVRICK-1 wants to merge 6 commits intoopeneverest:v2from
MAVRICK-1:feat/sync-webhook-templates
Open

feat: add sync script for controller webhook manifests#25
MAVRICK-1 wants to merge 6 commits intoopeneverest:v2from
MAVRICK-1:feat/sync-webhook-templates

Conversation

@MAVRICK-1
Copy link
Copy Markdown
Contributor

@MAVRICK-1 MAVRICK-1 commented Apr 9, 2026

image

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

@MAVRICK-1 MAVRICK-1 marked this pull request as draft April 9, 2026 18:28
@MAVRICK-1 MAVRICK-1 marked this pull request as ready for review April 9, 2026 18:30
@MAVRICK-1 MAVRICK-1 marked this pull request as draft April 9, 2026 18:32
@MAVRICK-1 MAVRICK-1 marked this pull request as ready for review April 9, 2026 18:41
@recharte recharte requested a review from chilagrow April 9, 2026 18:45
Copy link
Copy Markdown

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution 🤗! Let's use the same fetch and replace pattern for deployment resource type.

Comment thread charts/everest/scripts/sync-controller-deployment.sh Outdated
@MAVRICK-1 MAVRICK-1 requested a review from chilagrow April 13, 2026 17:44
Comment thread charts/everest/scripts/sync-controller-deployment.sh Outdated
@MAVRICK-1
Copy link
Copy Markdown
Contributor Author

cc @chilagrow

Copy link
Copy Markdown

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread charts/everest/scripts/sync-controller-deployment.sh Outdated
@chilagrow
Copy link
Copy Markdown

Hi @MAVRICK-1 do you need any hand for this?

@MAVRICK-1
Copy link
Copy Markdown
Contributor Author

@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>
@MAVRICK-1 MAVRICK-1 force-pushed the feat/sync-webhook-templates branch from 2ecda83 to 4028e6b Compare April 30, 2026 17:34
… 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>
@MAVRICK-1
Copy link
Copy Markdown
Contributor Author

MAVRICK-1 commented Apr 30, 2026

@chilagrow it's okay now ?

@MAVRICK-1 MAVRICK-1 requested a review from chilagrow April 30, 2026 17:47
Copy link
Copy Markdown

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution and effort 💪 ! Just a couple of comments


echo " Syncing webhook Service -> ${WEBHOOK_SERVICE_DEST}"

curl -sSfL "${WEBHOOK_SERVICE_SRC}" \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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|' \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants