Adding validating admission webhooks for NIMService/NIMCache with Helm deployment updates#581
Conversation
d101583 to
69d026f
Compare
visheshtanksale
left a comment
There was a problem hiding this comment.
- Fix the linter error.
- Take latest updates from main and rebase your changes on top of it.
- Its generally a good practice to start PR with a single commit.
internal/webhook/apps/v1alpha1/nimcache_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
9d88736 to
03326b0
Compare
|
Addressed all concerns-edited code to pass linting tests as well. Linting caught NIMCache.Spec.Storage.HostPath being deprecated, so it was removed from the code. |
|
All concerns addressed. There are these lines in config/manager/kustomization.yaml: Also, in deployments/helm/k8s-nim-operator/values.yaml: These were changed for local development and testing. Should they be changed back to their original values of Additionally, Kustomization files were changed. Does anything need to be done about those changes? |
Yes, we should change these to original values. |
a90d526 to
42416ae
Compare
|
Addressed these concerns @shivamerla, please review |
5cf860a to
72ef39c
Compare
internal/webhook/apps/v1alpha1/nimcache_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimcache_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimcache_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
948a393 to
7623902
Compare
internal/webhook/apps/v1alpha1/nimcache_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimcache_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
16c3b62 to
3ce054e
Compare
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
internal/webhook/apps/v1alpha1/nimservice_webhook_validation_helper.go
Outdated
Show resolved
Hide resolved
|
Code coverage is 64%. Should I aim for 100%? |
ee301cf to
4e1e763
Compare
varunrsekar
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the change!
Reg the DCO check failure, please sign-off on all your commits
4e1e763 to
18e1a2f
Compare
…te and ValidateCreate. Helm deployment configured as well. Addressed linting, public functions, and git issues. Signed-off-by: Aryan <[email protected]>
18e1a2f to
c0632a8
Compare
Adds validating admission webhooks (ValidateCreate and ValidateUpdate) with cert-manager TLS integration for both NIMService and NIMCache CRDs and wires them into the Helm chart so they are deployed automatically with the operator.
Webhook and Helm deployment follows the style of https://github.com/Mellanox/network-operator.
Specification document: https://docs.google.com/document/d/11pir7oqXmDNUB_BrfCnbj7wa8VNbsos43a-jif01C98/edit?usp=sharing
Key Changes
Webhook Implementations (each file has a helper file)
internal/webhook/apps/v1alpha1/nimservice_webhook.gointernal/webhook/apps/v1alpha1/nimcache_webhook.goEach file defines:
ValidateCreateandValidateUpdate.ValidateDeletestub (required byadmission.CustomValidator, but never invoked because the webhook is registered for create and update only).Controller Wiring
SetupNIMServiceWebhookWithManagerandSetupNIMCacheWebhookWithManagerregister the validators with the controller-runtime manager.main.gonow invokes bothSetup*WebhookWithManagerhelpers so the webhooks start with the operator.Generated Manifests
make manifestsnow produces the correspondingValidatingWebhookConfigurationYAML underconfig/webhook/.verbs=create;update; deletion is intentionally excluded./validate-apps-nvidia-com-v1alpha1-nimservice).Helm Chart Updates (TLS + Webhook Packaging)
deployments/helm/k8s-nim-operator/) with the Network Operator’s admission-controller pattern.templates/admission_controller.yamlService,ValidatingWebhookConfiguration, and TLS assets.useCertManager: true– createIssuerandCertificateresources for self-signed certs.useCertManager: false– load a user-suppliedSecretcontainingcaCrt,tlsCrt,tlsKey.operator.admissionController.enabled.values.yamladditionsdeployment.yamltweaks9443.webhook-server-certsecret at/tmp/k8s-webhook-server/serving-certs.ENABLE_WEBHOOKS=trueenv var whenadmissionController.enabledis set.config/certmanagerandconfig/webhookremain for local dev (make manifests && make deploy).RBAC Adjustments
secretsfor TLSvalidatingwebhookconfigurationsto enable certificate patchingTesting & CI