Skip to content

chore(manager): tighten Deployment manifest defaults#134

Draft
viniciusdc wants to merge 1 commit into
mainfrom
chore/manager-manifest-hardening
Draft

chore(manager): tighten Deployment manifest defaults#134
viniciusdc wants to merge 1 commit into
mainfrom
chore/manager-manifest-hardening

Conversation

@viniciusdc

Copy link
Copy Markdown
Collaborator

Summary

Three small Kubernetes-best-practice additions on the controller-manager Deployment template (config/manager/manager.yaml). No code change, no runtime behaviour change.

Change What Why
Add runAsGroup: 65532 + fsGroup: 65532 pod-level securityContext Pod already runs runAsUser: 65532 / runAsNonRoot: true. Setting the matching group keeps uid/gid consistent across the pod and avoids inheriting whatever default group the base image ships with.
Declare containerPort: 8081, name: health manager container ports Probes already used :8081 via --health-probe-bind-address, but the container's ports was empty. Manifest hygiene — common lint rule.
Inline comment on KEYCLOAK_ADMIN_SECRET_* env vars env-var documentation Those env vars hold Secret pointers (name + namespace), not credential values. Some static-analysis rules flag env var names matching *_SECRET_* patterns; the comment makes the intent explicit so future linters and reviewers don't re-relitigate the question.

Verification

  • go build ./... — passes
  • make lint — 0 issues
  • make build-installer IMG=... renders the expected fields into dist/install.yaml (verified locally: runAsGroup, fsGroup, the health containerPort all present)
  • CI re-renders dist/chart/ via the release pipeline on next tag — pure manifest changes propagate automatically

Related

Three small Kubernetes-best-practice additions on the controller-manager
Deployment template:

- Add `runAsGroup: 65532` and `fsGroup: 65532` to the pod-level
  securityContext.  The pod already runs `runAsUser: 65532` /
  `runAsNonRoot: true`; setting the matching group keeps uid/gid
  consistent and avoids inheriting whatever default group the base image
  ships with.

- Declare `containerPort: 8081, name: health` on the manager container.
  The probes were already configured against `:8081` via
  `--health-probe-bind-address`, but the container's `ports` array was
  empty — manifest hygiene that lint tools flag.

- Add an inline comment on `KEYCLOAK_ADMIN_SECRET_NAME` /
  `KEYCLOAK_ADMIN_SECRET_NAMESPACE` clarifying that those env vars hold
  Secret pointers (name + namespace), not credential values.
  Static-analysis rules that match `*_SECRET_*` env var names sometimes
  flag these as "secrets in env"; they're not.

Routine manifest hygiene before the v0.1.0 cut.  No code change, no
runtime behaviour change.  `make build-installer` renders the expected
fields into `dist/install.yaml`; build + lint clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants