refactor: move CRD apply from Helm hook Job to init container on operator Deployment#6780
Conversation
…ator Deployment Signed-off-by: Julien Mancuso <jmancuso@nvidia.com>
WalkthroughThe pull request migrates CRD application from a Helm pre-install/pre-upgrade hook Job to an init container within the operator Deployment. The hook-based template is removed, and initialization logic is integrated directly into the pod specification, controlled by the same Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@deploy/helm/charts/platform/components/operator/templates/deployment.yaml`:
- Around line 62-70: The initContainer "crd-apply" is missing a container-level
securityContext and can fail strict PodSecurity admission; update the
initContainers block for the crd-apply container to include a hardened
securityContext (for example: runAsNonRoot: true and an explicit runAsUser, set
allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, drop all
capabilities, and set seccompProfile type to RuntimeDefault) so it matches the
security posture of the other containers and satisfies restricted pod policies.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
deploy/helm/charts/platform/components/operator/templates/deployment.yamldeploy/helm/charts/platform/components/operator/templates/upgrade-crd.yamldeploy/helm/charts/platform/components/operator/values.yaml
💤 Files with no reviewable changes (1)
- deploy/helm/charts/platform/components/operator/templates/upgrade-crd.yaml
…ator Deployment Signed-off-by: Julien Mancuso <jmancuso@nvidia.com>
…ator Deployment (#6780) Signed-off-by: Julien Mancuso <jmancuso@nvidia.com>
…ator Deployment (ai-dynamo#6780) Signed-off-by: Julien Mancuso <jmancuso@nvidia.com>
Summary
Motivation
The CRD apply hook Job relies on Helm-specific lifecycle (helm.sh/hook) which is invisible to helm template and behaves unpredictably in GitOps tools (ArgoCD, FluxCD). Moving to an init container makes CRD management part of the standard Deployment spec, visible in rendered manifests, and compatible with all deployment workflows.
Details
Summary by CodeRabbit