sonarqube

by tjungbauer

Helm chartv1.0.31App 1.0.0Apache-2.0Verified publisher

A Helm chart to deploy sonarqube community edition -d epends on Sonarcube's helm chart

About this chart

sonarqube

Description

A Helm chart to deploy sonarqube community edition -d epends on Sonarcube's helm chart

SonarQube is a solution that allows (source) code analysis and quality checks. The community version installed here is part of the Secure Supply Chain example.

When Sonarqube is installed the initial password for the admin user will be "admin".

This wrapper Helm chart is able to start a Job that can set (change) the initial password. The job will connect to the Sonarqube endpoint and will use the credentials that are defined in a Secret. The Secret must have the key "adminpass" that will be used as a password. In this repository a SealedSecret object has been used for that.

To do so a sealed secret is used that was created like this:

echo -n 'PASSWORD-HERE' | oc create secret generic credentials --dry-run=client --from-file=adminpass=/dev/stdin -o yaml -n sonarqube \
| kubeseal --controller-namespace=sealed-secrets --controller-name=sealed-secrets --format yaml

For detailed information check: SonarQube

For an example on how to use it during a pipeline run check: Analyse Source Code

Dependencies

This chart has the following dependencies:

RepositoryNameVersion
https://SonarSource.github.io/helm-chart-sonarqubesonarqube~2025.6.0
https://charts.stderr.at/tpl~1.0.28

It is best used with a full GitOps approach such as Argo CD does. For example, https://github.com/tjungbauer/openshift-clusterconfig-gitops

Maintainers

NameEmailUrl
tjungbauer[email protected]https://blog.stderr.at/

Sources

Source:

Source code: https://github.com/tjungbauer/helm-charts/tree/main/charts/sonarqube

Parameters

Verify the subcharts for additional settings:

Values

KeyTypeDefaultDescription
endpointstring"sonarqube.apps.ocp.aws.ispworld.at"Endpoint so that the Job that is configuring the initial password can connect.
epstring"sonarqube.apps.ocp.aws.ispworld.at"
namespace.createboolfalseShall the namespace be created?
namespace.namestring"sonarqube"Namespace where Sonarqube shall be deployed
set_admin_passwordboolfalseStart a Job to set an initial password
sonarqubeobject{"OpenShift":{"createSCC":true,"enabled":true},"fullnameOverride":"sonarqube","networkPolicy":{"enabled":false},"persistence":{"enabled":true},"plugins":{"install":["https://github.com/checkstyle/sonar-checkstyle/releases/download/10.9.3/checkstyle-sonar-plugin-10.9.3.jar","https://github.com/dependency-check/dependency-check-sonar-plugin/releases/download/3.1.0/sonar-dependency-check-plugin-3.1.0.jar","https://github.com/sbaudoin/sonar-yaml/releases/download/v1.7.0/sonar-yaml-plugin-1.7.0.jar","https://github.com/sbaudoin/sonar-shellcheck/releases/download/v2.5.0/sonar-shellcheck-plugin-2.5.0.jar"]},"route":{"enabled":true,"host":"sonarqube.apps.ocp.aws.ispworld.at","tls":{"insecureEdgeTerminationPolicy":"Allow","termination":"edge"}}}Sonarqube Settings These settings are defined by Sonarqube Helm chart.
sonarqube.OpenShift.createSCCbooltrueThe SCC should be created for OpenShift deployment.
sonarqube.OpenShift.enabledbooltrueOpenShift should be enabled
sonarqube.networkPolicyobject{"enabled":false}Enable Network Polocies ... maybe I should set this to true
sonarqube.persistenceobject{"enabled":true}Keep the data persistent
sonarqube.pluginsobject{"install":["https://github.com/checkstyle/sonar-checkstyle/releases/download/10.9.3/checkstyle-sonar-plugin-10.9.3.jar","https://github.com/dependency-check/dependency-check-sonar-plugin/releases/download/3.1.0/sonar-dependency-check-plugin-3.1.0.jar","https://github.com/sbaudoin/sonar-yaml/releases/download/v1.7.0/sonar-yaml-plugin-1.7.0.jar","https://github.com/sbaudoin/sonar-shellcheck/releases/download/v2.5.0/sonar-shellcheck-plugin-2.5.0.jar"]}additional plugins to install
sonarqube.routeobject{"enabled":true,"host":"sonarqube.apps.ocp.aws.ispworld.at","tls":{"insecureEdgeTerminationPolicy":"Allow","termination":"edge"}}Enable ingress, using the defind endpoint.
ttlSecondsAfterFinishedint600Seconds to retain the finished admin-password Job before Kubernetes deletes it

Example #1 - MultiCloudGateway only

---
ep: &endpoint sonarqube.apps.ocp.aws.ispworld.at

namespace:
  name: sonarqube
  create: true

set_admin_password: true
endpoint: *endpoint

# Sonarqube Settings
# These settings are defined by Sonarqube Helm chart.
sonarqube:
  OpenShift:
    enabled: true
    createSCC: true
  persistence:
    enabled: true
  networkPolicy:
    enabled: false

  ingress:
    enabled: true
    hosts:
      - name: *endpoint
        path: /
  plugins:
    install:
      - https://github.com/checkstyle/sonar-checkstyle/releases/download/10.9.3/checkstyle-sonar-plugin-10.9.3.jar
      - https://github.com/dependency-check/dependency-check-sonar-plugin/releases/download/3.1.0/sonar-dependency-check-plugin-3.1.0.jar
      - https://github.com/sbaudoin/sonar-yaml/releases/download/v1.7.0/sonar-yaml-plugin-1.7.0.jar
      - https://github.com/sbaudoin/sonar-shellcheck/releases/download/v2.5.0/sonar-shellcheck-plugin-2.5.0.jar

Installing the Chart

To install the chart with the release name my-release:

helm install my-release tjungbauer/<chart-name>>

The command deploys the chart on the Kubernetes cluster in the default configuration.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.


Autogenerated from chart metadata using helm-docs v1.14.2

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.0.31 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