Checklists for adding Ingress annotations, VirtualServer/VSR fields, or Helm chart values to NIC. Use when adding new configuration options, new NGINX directives, new annotations, new CRD fields, or new Helm values.
78
98%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Annotations apply ONLY to Ingress objects, never to VirtualServer or VirtualServerRoute.
internal/configs/annotations.go (e.g., MyAnnotation = "nginx.org/my-annotation")ConfigParams in internal/configs/config_params.goparseAnnotations() in internal/configs/annotations.gomasterDenylist / minionDenylist if it should not be on master/miniongenerateNginxCfg() in internal/configs/ingress.gointernal/configs/version1/nginx.ingress.tmpl and internal/configs/version1/nginx-plus.ingress.tmplinternal/k8s/validation.go annotation validation chainsannotations_test.go and ingress_test.gointernal/configs/version1/template_test.go whose fixture sets the new ConfigParams field, then run make test-update-snaps and confirm the directive appears in internal/configs/version1/__snapshots__/ for every edition the annotation supports -- both OSS and Plus for shared directives, Plus golden files only for Plus-only onescontainsDangerousChars() for any user-provided string that ends up in NGINX configparseAnnotations() silently ignores unknown annotations -- add the constant first__snapshots__ diff after a .tmpl edit means no fixture exercises the new branch -- the annotation is untestedpkg/apis/configuration/v1/types.go with kubebuilder markersmake update-codegen and make update-crdspkg/apis/configuration/validation/virtualserver.gointernal/configs/version2/http.gointernal/configs/virtualserver.go (GenerateVirtualServerConfig or helper)nginx.virtualserver.tmpl / nginx-plus.virtualserver.tmplinternal/configs/version2/templates_test.go that populates the new field in the fixture, then run make test-update-snaps and verify the directive appears in internal/configs/version2/__snapshots__/ for every edition the field supports -- both OSS and Plus for shared directives, Plus golden files only for Plus-only onesjson:"lb-method", json:"fail-timeout")json:"ingressClassName", json:"rewritePath")*int, *bool, *SomeStruct = optional/nullableint, bool = required or zero-value defaultfalse must be non-pointer| Marker | Purpose |
|---|---|
+kubebuilder:validation:Required | Field must be present |
+kubebuilder:validation:Optional | Field is optional |
+kubebuilder:validation:Pattern= `regex` | Regex validation |
+kubebuilder:validation:Minimum=N | Numeric minimum |
+kubebuilder:validation:MinItems=N / MaxItems=N | Array length |
+kubebuilder:validation:MaxLength=N | Max string length |
+kubebuilder:default=value | Default value |
+kubebuilder:validation:XValidation:rule="CEL" | Cross-field CEL validation |
// Prevent wildcard origin with credentials
// +kubebuilder:validation:XValidation:rule="!(self.allowOrigin.exists(origin, origin == '*') && has(self.allowCredentials) && self.allowCredentials == true)",message="..."
// Require time when allowedCodes is set
// +kubebuilder:validation:XValidation:rule="!has(self.allowedCodes) || (has(self.allowedCodes) && has(self.time))",message="..."make update-codegen after changing types.gozz_generated.deepcopy.go manuallymake update-crds also refreshes deploy/crds*.yaml and docs/crd/ -- commit all of itcharts/nginx-ingress/crds is a symlink to config/crd/bases/ -- never edit it directlyServer block; Version 1 has multiple Server blockscharts/nginx-ingress/values.yaml with ## documentation above the fieldcharts/nginx-ingress/values.schema.jsonnginx-ingress.args in charts/nginx-ingress/templates/_helpers.tplcharts/nginx-ingress/templates/controller-configmap.yaml_helpers.tplcharts/tests/testdata/<feature>.yamlcharts/tests/helmunit_test.gomake test-update-snaps and confirm charts/tests/__snapshots__/ contains the rendered valuevalues.schema.json alongside values.yamlcharts/tests/helmunit_test.go, gated behind the helmunit build tagcharts/tests/__snapshots__ diff means no testdata file renders the new value95d3987
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.