-
Notifications
You must be signed in to change notification settings - Fork 1.6k
✨ Add helm/v2-alpha addressing all feedbacks and aiming maintainability. Deprecated helm/v1-alpha in favor of helm/v2-alpha #5058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Add helm/v2-alpha addressing all feedbacks and aiming maintainability. Deprecated helm/v1-alpha in favor of helm/v2-alpha #5058
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cb1ee39
to
1acfef2
Compare
d9d172d
to
2a5c5be
Compare
8203eed
to
1cb0ec1
Compare
1cb0ec1
to
2040599
Compare
16b3fca
to
1863d2e
Compare
Thanks for clarifying. |
This looks great!. the new plugin's chart output is close to kustomize. The |
Hey @tchinmai7 @bavarianbidi @calind @vaidikcode @mkarlheim @abhijith-darshan @klaudworks @FishyFishPat @pabhi18 I would like to ask your help on reviews and I would appreciate LGTMs if you are satisfied with the proposed changes .. Really thank you for your interest on this one and all your collab !!! It would be great if we could delivery it with the next release |
Hey @camilamacedo86, Thank you so much for this amazing implementation 🚀 Building the binary from source camilamacedo86:helm-change-manager and using it to generate charts -
However I see one improvement necessary - The args for controller-manager Currently only static values in the manifest is carried over to the ## Helm template manager.yaml
containers:
- command:
- /manager
args:
- --leader-elect
- --health-probe-bind-address=:8081
- --leader-lease-duration=15s
- --leader-renew-timeout=10s
- --leader-retry-period=2s
image: controller:latest
name: manager Instead it can be something like this - ## Helm template manager.yaml
spec:
containers:
- args:
- --metrics-bind-address=:8443
- --health-probe-bind-address=:8081
{{- range .Values.controllerManager.args }}
- {{ . }}
{{- end }}
{{- if .Values.certManager.enable }}
- --webhook-cert-path=/tmp/k8s-webhook-server/serving-certs
{{- end }}
... values.yaml # Configure the controller manager deployment
controllerManager:
replicas: 1
args:
- --leader-elect
- --leader-lease-duration=15s
- --leader-renew-timeout=10s
- --leader-retry-period=2s |
The args might be a good thought, but I think we could check this one in a follow-up, wdyt? |
d41081b
to
b81c428
Compare
Sure. Once this is in, I can contribute towards enhancements as well, thanks. For now, LGTM 🚀 |
/retest-required |
c37628c
to
99911fe
Compare
return "helm/v1-alpha plugin is deprecated, use helm/v2-alpha instead which " + | ||
"provides dynamic Helm chart generation from kustomize output" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could we have a single string here instead of concatenation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would cause the lint check lll
fail
return nil | ||
} | ||
|
||
const helmHelpersTemplate = `{{` + "`" + `{{/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the future maintenance, would it helpful to move this and similar content into standalone files and use go:embed
directive to access it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All templates in Kubebuilder are currently done this way. I might not have fully understood the reasoning, but if we decide to change the approach, it would probably make sense to update all places consistently. That said, we’re always open to ideas—feel free to open a PR to propose the change and demonstrate what it would look like.
# kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager | ||
# kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-cainjector | ||
# kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-webhook` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can get incorporate this waiting into the previous helm install
step by doing something like:
helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set crds.enabled=true --wait --timeout 300s
#
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a good idea. 🚀
/test pull-kubebuilder-e2e-k8s-1-33-0 |
99911fe
to
2e5b8b0
Compare
…`) that dynamically generates Helm charts based on the actual kustomize output from `make build-installer`, replacing the previous hardcoded template approach in `helm/v1-alpha`. The existing `helm/v1-alpha` plugin used static templates that didn't reflect user customizations (environment variables, labels, annotations, security contexts, etc.) made in their kustomize configuration. This led to inconsistencies between `kubectl apply -f dist/install.yaml` and `helm install`. - Deprecated Helm v1-alpha in favour of v2 - Add docs and tests for Helm v2 - Update all samples - Address all feedbacks raised so far Assisted-by: OpenAI
2e5b8b0
to
0e81141
Compare
We have enough reviews/lgtm so far |
Introduce helm/v2-alpha Plugin: Dynamic Helm Chart Generation
This PR introduces a completely rewritten Helm plugin (
helm/v2-alpha
) that dynamically generates Helm charts based on the actual kustomize output frommake build-installer
, replacing the previous hardcoded template approach inhelm/v1-alpha
.The existing
helm/v1-alpha
plugin used static templates that didn't reflect user customizations (environment variables, labels, annotations, security contexts, etc.) made in their kustomize configuration. This led to inconsistencies betweenkubectl apply -f dist/install.yaml
andhelm install
.Key Features
dist/install.yaml
)metrics/
,webhook/
,cert-manager/
,rbac/
,crd/
)Changes
Documentation
📖 Preview docs: https://deploy-preview-5058--kubebuilder.netlify.app/plugins/available/helm-v2-alpha
How to Review
pkg/plugins/optional/helm/v2alpha/
for the actual code changestestdata/
anddocs/
are sample updates with helm/v2-alphaUsage
Closes: