Skip to content

feat(chart): add security, scheduling, and network policy support#912

Open
bl4ko wants to merge 1 commit intomauriceboe:devfrom
bl4ko:feat/chart-security-labels
Open

feat(chart): add security, scheduling, and network policy support#912
bl4ko wants to merge 1 commit intomauriceboe:devfrom
bl4ko:feat/chart-security-labels

Conversation

@bl4ko
Copy link
Copy Markdown

@bl4ko bl4ko commented Apr 27, 2026

Summary

Adds configurable Kubernetes best-practice fields to the Helm chart:

Security:

  • podSecurityContext — pod-level security context (default: fsGroup: 1000)
  • securityContext — container-level security context (default: {})
  • Standard app.kubernetes.io/* labels on all resources via _helpers.tpl

Scheduling:

  • priorityClassName
  • nodeSelector
  • tolerations
  • affinity

Networking:

  • networkPolicy.enabled — optional NetworkPolicy (disabled by default, allows port 3000 when enabled)
  • Configurable ingress and egress rules

Motivation

Clusters with policy engines (Kyverno, OPA/Gatekeeper) or PodSecurity Standards enforcement flag the chart for:

  1. Missing container securityContext
  2. Missing app.kubernetes.io/name label
  3. No priorityClassName support
  4. No NetworkPolicy

Additionally, nodeSelector, tolerations, and affinity are standard Helm chart fields that users expect for scheduling control.

Container image compatibility note

The default entrypoint runs chown as root before dropping to user node (UID 1000) via su-exec. Setting runAsNonRoot: true will prevent the container from starting unless the entrypoint is changed.

Compatible subset for policy compliance:

securityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop: ["ALL"]
  seccompProfile:
    type: RuntimeDefault

Test plan

  • helm lint passes
  • Default helm template output — only new labels added, no behavioral change
  • Security context overrides render correctly
  • NetworkPolicy renders with default and custom ingress rules
  • nodeSelector, tolerations, affinity render correctly
  • priorityClassName renders when set, omitted when empty
  • Verified Dockerfile entrypoint — documented runAsNonRoot incompatibility

@github-actions github-actions Bot added the wrong-base-branch PR is targeting the wrong base branch label Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Wrong target branch

This PR targets main, but contributions must go through dev first.

To fix this, click Edit next to the PR title and change the base branch to dev.

This PR will be automatically closed in 24 hours if the base branch has not been updated.

If you need to merge directly to main, contact a maintainer.

@bl4ko bl4ko closed this Apr 27, 2026
@bl4ko bl4ko reopened this Apr 27, 2026
@bl4ko bl4ko force-pushed the feat/chart-security-labels branch from 12f028d to 8bc2058 Compare April 27, 2026 21:03
@bl4ko bl4ko changed the base branch from main to dev April 27, 2026 21:03
@github-actions github-actions Bot removed the wrong-base-branch PR is targeting the wrong base branch label Apr 27, 2026
Add configurable Kubernetes best-practice fields to the Helm chart:

Security:
- podSecurityContext (default: fsGroup: 1000)
- securityContext for container (default: empty)
- Standard app.kubernetes.io/* labels on all resources

Scheduling:
- priorityClassName
- nodeSelector
- tolerations
- affinity

Networking:
- NetworkPolicy (disabled by default, allows port 3000 when enabled)

All fields default to empty/disabled — no behavioral change for
existing installations. Deployment selector.matchLabels unchanged
to avoid breaking rolling updates.
@bl4ko bl4ko force-pushed the feat/chart-security-labels branch from 8bc2058 to 09bb89d Compare April 27, 2026 21:07
@bl4ko bl4ko changed the title feat(chart): add securityContext, priorityClassName, and standard labels feat(chart): add security, scheduling, and network policy support Apr 27, 2026
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.

1 participant