sonarqube
by KubeGems
A Helm chart for deploying SonarQube.
About this chart
SonarQube
SonarQube empowers all developers to write cleaner and safer code.
Installing the Chart
Before you can install the chart you will need to add the stevehipwell repo to Helm.
helm repo add sonarqube https://jordiprats.github.io/helm-sonarqube/
After you've installed the repo you can install the chart.
helm upgrade --install --namespace default --values ./values.yaml sonar sonarqube/sonarqube
Configuration
The following table lists the configurable parameters of the SonarQube chart and their default values.
| Parameter | Description | Default |
|---|---|---|
image.repository | Image repository. | sonarqube |
image.tag | Image tag. | {{ .Chart.AppVersion }}-community |
image.pullPolicy | Image pull policy. | IfNotPresent |
image.pullSecrets | Image pull secrets. | [] |
image.lts | Whether is the LTS version. | false |
nameOverride | Override the name of the chart. | nil |
fullnameOverride | Override the fullname of the chart. | nil |
serviceAccount.create | If true, create a new service account. | true |
serviceAccount.annotations | Annotations to add to the service account. | {} |
serviceAccount.name | Service account to be used. If not set and serviceAccount.create is true, a name is generated using the fullname template. | nil |
podAnnotations | Annotations to add to the pod. | {} |
podSecurityContext | Security context for the pod. | { fsGroup: 1000 } |
securityContext | Security context for the primary container. | { runAsUser: 1000 } |
priorityClassName | Priority class name to use. | "" |
livenessProbe | The liveness probe. | See values.yaml |
readinessProbe | The readiness probe. | See values.yaml |
service.type | Service type. | ClusterIP |
service.annotations | Annotations to add to the service. | {} |
service.port | Service port. | 9000 |
ingress.enabled | If true, create an ingress object. | false |
ingress.annotations | Ingress annotations. | {} |
ingress.hosts | Ingress hosts. | See values.yaml |
ingress.tls | Ingress TLS configuration | See values.yaml |
persistence.enabled | If true, create a PVC. | false |
persistence.annotations | Annotations to add to the PVC. | {} |
persistence.existingClaim | Use an existing PVC to persist data. | nil |
persistence.accessMode | Persistence access mode. | ReadWriteOnce |
persistence.storageClass | PVC storage class (use - for default). | standard |
persistence.size | Size of PVC to create. | 8Gi |
resources | Resource requests and limits for the primary container. | {} |
nodeSelector | Node labels for pod assignment. | {} |
tolerations | Toleration labels for pod assignment. | [] |
affinity | Affinity settings for pod assignment. | {} |
caCerts.enabled | If true, add provided CA certificates to the JVM cacerts key store. | false |
caCerts.secret | Secret containing the additional CA certificates. | nil |
envVars.jvmOptions | JVM options to pass to the container via SONAR_WEB_JAVAOPTS. | "" |
envVars.jvmAdditionalOptions | JVM options to pass to the container via SONAR_WEB_JAVAADDITIONALOPTS. | "" |
env | Environment variables for all containers in the pod. | [] |
sonarProperties | A map of SonarQube properties. | {} |
sonarSecretProperties.enabled | If there is a secret to provide properties to SonarQube. | false |
sonarSecretProperties.secret | The secret name that contains the SonarQube properties. | nil |
sonarSecretProperties.key | The key on the secret that contains the SonarQube properties. | nil |
installPlugins.enabled | If plugins should be installed. | false |
installPlugins.plugins | The plugins to install (see values.yaml for structure.). | [] |
psql.host | External PostgreSQL host to use (if this is set the additional psql values need to be set) | nil |
psql.port | External PostgreSQL port | nil |
psql.database | External PostgreSQL database | nil |
psql.username | External PostgreSQL username | nil |
psql.password.secret | Name of the secret containing the external PostgreSQL password | nil |
psql.password.key | Key on the secret containing the external PostgreSQL password | nil |
Database
PostgreSQL database is not installed by this chart, it must be already available
Persistence
The sonarqube image stores the SonarQube data and configurations at the /opt/sonarqube path in the container.
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. See the Configuration section to configure the PVC or to disable persistence.
Forked
This repo have been forked from stevehipwell's sonarqube helm chart to be able to add support to the LTS version
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartsonarqube is pinned at v1.3.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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