sonarqube

by HelmForge

Helm chartv1.1.2App 26.8.0.126808Apache-2.0Verified publisher

SonarQube Community Build Helm chart with plugin automation and production controls

About this chart

SonarQube

SonarQube Community Build for Kubernetes using the official Docker image. It supports embedded evaluation mode, HelmForge PostgreSQL, external PostgreSQL, plugin automation, and the community branch plugin.

Install

HTTPS repository

helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install sonarqube helmforge/sonarqube -f values.yaml

OCI registry

helm install sonarqube oci://ghcr.io/helmforgedev/helm/sonarqube -f values.yaml

Features

  • official docker.io/library/sonarqube image
  • embedded mode for disposable local validation
  • postgresql mode backed by the HelmForge PostgreSQL subchart
  • external mode for PostgreSQL-backed production deployments
  • generated, existing, or External Secrets Operator-backed database password handling
  • optional monitoring passcode secret handling
  • plugin download init container with persistent extensions volume
  • bundled PostgreSQL wait init container to avoid first-start connection races
  • first-class community branch plugin wiring, including Java agents and webapp replacement
  • Gateway API HTTPRoute, Ingress, and dual-stack Service fields
  • default non-root pod security context, dropped Linux capabilities, and read-only root filesystem
  • optional NetworkPolicy, PodDisruptionBudget, persistence, extra containers, and extra volumes
  • optional extra manifests for small companion resources and self-contained CI fixtures
  • Helm test pod that validates the SonarQube system status endpoint

Architecture

The chart deploys one SonarQube Community Build pod behind a named-port Service. It connects to embedded evaluation storage, the optional HelmForge PostgreSQL dependency, or an external PostgreSQL service. Persistent volumes hold data and extensions; an optional init container installs optionally checksum-verified plugins before the application starts. See DESIGN.md for trust boundaries, backup ownership, observability, and known gaps.

Examples

Reusable configurations are available in examples/: bundled PostgreSQL, external PostgreSQL, production exposure, and the community branch plugin. The snippets below show the main contracts directly.

Database Modes

The default auto mode uses external settings when provided, then postgresql.enabled, and otherwise falls back to embedded evaluation mode. The embedded mode is intentionally scoped to disposable evaluation.

Bundled HelmForge PostgreSQL:

sonarqube:
  databaseMode: postgresql

postgresql:
  enabled: true
  auth:
    database: sonarqube
    username: sonar
    password: change-me

External PostgreSQL:

sonarqube:
  databaseMode: external

database:
  external:
    jdbcUrl: jdbc:postgresql://postgresql.database.svc.cluster.local:5432/sonarqube
    username: sonar
    existingSecret: sonarqube-database
    existingSecretPasswordKey: jdbc-password

External Secrets

sonarqube:
  databaseMode: external

database:
  external:
    jdbcUrl: jdbc:postgresql://postgresql.database.svc.cluster.local:5432/sonarqube
    username: sonar

externalSecrets:
  enabled: true
  secretStoreRef:
    name: platform-secrets
    kind: ClusterSecretStore
  database:
    enabled: true
    passwordRemoteRef:
      key: sonarqube/database
      property: password

Community Branch Plugin

The chart can install the community branch plugin and patch the SonarQube web application during startup.

communityBranchPlugin:
  enabled: true
  version: "26.4.0"
  jarSha256: ""
  webappSha256: ""

The chart pins plugin 26.4.0 independently from the SonarQube image release. This combination is covered by the chart's plugin validation scenario; review upstream compatibility notes before selecting another plugin or image version.

See Community Branch Plugin.

Additional plugins accept an optional SHA-256 checksum. URLs are supplied to the installer through environment variables so shell metacharacters are not interpreted:

plugins:
  enabled: true
  install:
    - name: sonar-auth-oidc
      url: https://artifacts.example.com/sonar-auth-oidc.jar
      sha256: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Exposure

Ingress:

ingress:
  enabled: true
  ingressClassName: nginx
  hosts:
    - host: sonarqube.example.com
      paths:
        - path: /
          pathType: Prefix

Gateway API:

gatewayAPI:
  enabled: true
  parentRefs:
    - name: public-gateway
      namespace: gateway-system
  hostnames:
    - sonarqube.example.com

Dual-stack Service:

service:
  ipFamilyPolicy: PreferDualStack
  ipFamilies:
    - IPv4
    - IPv6

Network Policy

Enable NetworkPolicy after confirming the required ingress controller, database, DNS, plugin download, and external service paths for your cluster.

networkPolicy:
  enabled: true
  egress:
    enabled: true
    extraEgress:
      - to:
          - ipBlock:
              cidr: 10.80.0.0/16
        ports:
          - protocol: TCP
            port: 443

Configuration

Main Values

KeyDefaultDescription
image.repositorydocker.io/library/sonarqubeOfficial SonarQube image repository
image.tag26.8.0.126808-communitySonarQube Community Build image tag
containerPorts.http9000Real SonarQube listener port, wired through SONAR_WEB_PORT
service.port9000Client-facing Service port; targets the named application port
sonarqube.databaseModeautoauto, embedded, postgresql, or external
postgresql.enabledfalseDeploy HelmForge PostgreSQL as a subchart
waitForDatabase.enabledtrueWait for bundled PostgreSQL before starting SonarQube
database.external.jdbcUrl""JDBC URL when using external mode
database.external.existingSecret""Existing database password Secret
externalSecrets.enabledfalseRender ExternalSecret resources
plugins.enabledfalseEnable plugin download init container
communityBranchPlugin.enabledfalseInstall and wire the branch plugin
communityBranchPlugin.jarSha256""Optional plugin JAR checksum
communityBranchPlugin.webappSha256""Optional patched webapp checksum
persistence.data.enabledtruePersist SonarQube data
persistence.extensions.enabledtruePersist installed plugins
service.ipFamilyPolicy~Optional Kubernetes Service IP family policy
ingress.enabledfalseRender Ingress
gatewayAPI.enabledfalseRender Gateway API HTTPRoute
networkPolicy.enabledfalseRender NetworkPolicy
networkPolicy.egress.extraEgress[]Additional complete NetworkPolicy egress rules
pdb.enabledfalseRender PodDisruptionBudget
extraManifests[]Additional Kubernetes manifests rendered with the release

Production Notes

Before production use, read Production. SonarQube embeds Elasticsearch and requires host kernel settings for production bootstrap checks. The chart defaults to disabled bootstrap checks for k3d and evaluation; production clusters should set the host requirements and use bundled or external PostgreSQL.

Back up PostgreSQL together with the data and extensions volumes. The logs volume is optional and is not required to restore application state. The chart does not schedule backups or restores.

Troubleshooting

  • If the pod remains in Init, inspect the database wait or plugin installer init container logs with kubectl logs <pod> -c <container>.
  • If readiness fails, query the configured context path followed by /api/system/status through the Service and confirm it reports UP.
  • If plugin installation fails, verify outbound access, artifact compatibility, and the configured SHA-256 checksum.
  • If production bootstrap checks fail, prepare the node kernel and process limits documented in Production.

References

Security Scan: sonarqube

FrameworkScore
MITRE + NSA + SOC292.42425%

Security posture acceptable.

Deploy sonarqube with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has sonarqube on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsonarqube is pinned at v1.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply