Skip to main content

Installation

To proceed with the installation of Sonarqube on our platform as with other tools we first need to clone the Sonarqube repository, so we can see the values we want to use in our deployment.

Repo

https://github.com/SonarSource/helm-chart-sonarqube.git

We add the helm repository and upgrade

helm repo add sonarqube https://SonarSource.github.io/helm-chart-sonarqube
helm repo update

We can clone the git mentioned above and copy the values.yaml found in the following path.

cd helm-chart-sonarqube/charts/sonarqube/

And we will proceed to copy or modify the values.yaml. In this file we must have the following parameters.

ingress:
enabled: true
hosts:
- name: sonar.yourdomain.com
path: "/"
# This property allows for reports up to a certain size to be uploaded to SonarQube
annotations:
kubernetes.io/ingress.class: appsec-nginx
nginx.ingress.kubernetes.io/proxy-body-size: "64m"
# Set the ingressClassName on the ingress record
ingressClassName: appsec-nginx
tls:
# Secrets must be manually created in the namespace. To generate a self-signed certificate (and private key) and then create the secret in the cluster please refer to official documentation available at https://kubernetes.github.io/ingress-nginx/user-guide/tls/#tls-secrets
- secretName: SECRET_CERT
# hosts:
# - chart-example.local
prometheusExporter:
enabled: false
config:
rules:
- pattern: ".*"
postgresql:
# Enable to deploy the bitnami PostgreSQL chart
enabled: true
persistence:
enabled: true
accessMode: ReadWriteOnce
size: 10Gi

we proceed to the installation with the helm

Helm

helm upgrade --install -n sonar sonarqube -f values.yaml sonarqube/sonarqube --create-namespace

From the previous command we can note the following details:

  1. You use 'helm upgrade --install' because if it does not exist, install it and if it does exist, upgrade it.
  2. Use '--create-namespace' to create the namespace in Kuberentes if it is not already created.
  3. We use '-n sonar' to indicate the namespace where we want to install our application.