Skip to content

Conversation

@ianstanton
Copy link
Contributor

What this PR does / why we need it:
Add the following flags as helm values and pass down to controller-manager and audit deployment templates:

  • --log-level-key
  • --log-level-encoder
  • --cert-dir
  • --api-cache-dir
  • --otlp-endpoint
  • --otlp-metric-interval
  • --stackdriver-only-when-available
  • --stackdriver-metric-interval
  • --disable-enforcementaction-validation
  • --client-ca-name
  • --client-cn-name

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #3784

Special notes for your reviewer:
I left some of the missing flags in #3784 out as I'm still determining whether they belong as chart values. I also want to be sure the right flags are passed to the appropriate deployments (some are applied to both, others are unique to controller-manager or audit), so feedback is welcome there.

Signed-off-by: Ian Stanton <[email protected]>
Signed-off-by: Ian Stanton <[email protected]>
Signed-off-by: Ian Stanton <[email protected]>
Signed-off-by: Ian Stanton <[email protected]>
@ianstanton ianstanton requested a review from a team as a code owner January 17, 2025 04:32
Comment on lines +18 to +22
volumeMounts:
- mountPath: /certs
name: cert
readOnly: true
$patch: delete
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added these here to avoid duplicate entries when generating manifests. I renamed the file as it is no longer only deleting ports.

patchesStrategicMerge:
- kustomize-for-helm.yaml
- delete-ports.yaml
- delete-merge-values.yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed file mentioned above.

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.71%. Comparing base (3350319) to head (8ad4d8a).
⚠️ Report is 492 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (3350319) and HEAD (8ad4d8a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (8ad4d8a)
unittests 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3787       +/-   ##
===========================================
- Coverage   54.49%   40.71%   -13.79%     
===========================================
  Files         134      251      +117     
  Lines       12329    17720     +5391     
===========================================
+ Hits         6719     7215      +496     
- Misses       5116     9883     +4767     
- Partials      494      622      +128     
Flag Coverage Δ
unittests 40.71% <ø> (-13.79%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JaydipGabani JaydipGabani added this to the v3.20.0 milestone Mar 19, 2025
Copy link
Contributor

@JaydipGabani JaydipGabani 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 the PR!

- --disable-cert-rotation={{ .Values.controllerManager.disableCertRotation }}
- --max-serving-threads={{ .Values.maxServingThreads }}
- --tls-min-version={{ .Values.controllerManager.tlsMinVersion }}
- --client-ca-name={{ .Values.controllerManager.clientCAName }}
Copy link
Contributor

Choose a reason for hiding this comment

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

All of these flags should be set conditionally only when the helm variable is set. We do not want to set new flags to user deployments during upgrades. Additionally, please add the helm variable information in https://github.com/open-policy-agent/gatekeeper/blob/master/cmd/build/helmify/static/README.md as well to make it visible.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ianstanton any update on this? all these flags should be only set conditionally.

@npoxopob
Copy link

@ianstanton, hello friend! Can you add some extra missing flag, it is cert-service-name
https://github.com/open-policy-agent/gatekeeper/blob/8d048b0655b0a0e7f31e172bc4aaf27b685e0714/main.go#L114C54-L114C71
Don't want create new pr, and wait approve for this feature

@ianstanton
Copy link
Contributor Author

@ianstanton, hello friend! Can you add some extra missing flag, it is cert-service-name https://github.com/open-policy-agent/gatekeeper/blob/8d048b0655b0a0e7f31e172bc4aaf27b685e0714/main.go#L114C54-L114C71 Don't want create new pr, and wait approve for this feature

@npoxopob Hey there! Sure, I can add that to this PR.

@JaydipGabani
Copy link
Contributor

@ianstanton any updates on this?

@JaydipGabani JaydipGabani modified the milestones: v3.20.0, v3.21.0 Jun 11, 2025
@ianstanton
Copy link
Contributor Author

@ianstanton any updates on this?

I can come back to this over the weekend

Copilot AI review requested due to automatic review settings September 7, 2025 22:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds missing command-line flags as configurable Helm values for the Gatekeeper controller, addressing issue #3784. The changes enhance the Helm chart's flexibility by exposing previously hard-coded flags through values.yaml configuration.

  • Adds 11 new configurable flags including logging, certificate, caching, and telemetry options
  • Updates both controller-manager and audit deployment templates to use these new values
  • Implements proper Helm templating patterns with fallback logic for component-specific overrides

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
manifest_staging/charts/gatekeeper/values.yaml Adds new Helm values for the missing flags with sensible defaults
manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml Updates controller-manager deployment to use new Helm values for flags and cert directory
manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml Updates audit deployment to use new Helm values for flags and cert directory
cmd/build/helmify/static/values.yaml Mirror of main values.yaml for Helm chart generation
cmd/build/helmify/replacements.go Adds replacement pattern for cert volume mount path
cmd/build/helmify/kustomize-for-helm.yaml Updates kustomization template with new flags and volume mounts
cmd/build/helmify/delete-merge-values.yaml Removes hard-coded volume mounts to allow Helm templating
Comments suppressed due to low confidence (1)

tlsMinVersion: 1.3
clientCertName: ""
clientCAName: ""
clientCNName: kube-apiserver
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The clientCNName value should be a string but is missing quotes. This could cause YAML parsing issues. Change to: clientCNName: \"kube-apiserver\"

Suggested change
clientCNName: kube-apiserver
clientCNName: "kube-apiserver"

Copilot uses AI. Check for mistakes.
@JaydipGabani JaydipGabani modified the milestones: v3.21.0, v3.22.0 Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some flags cannot be set via helm chart values

4 participants