sonarqube

by Helm

Helm chartv9.3.1App 9.3.1

SonarQube is an open source quality management platform that analyzes and measures code's technical quality. It enables developers to detect code issues, vulnerabilities, and bugs in early stages.

About this chart

SonarQube packaged by Bitnami

SonarQube is an open source quality management platform that analyzes and measures code's technical quality. It enables developers to detect code issues, vulnerabilities, and bugs in early stages.

Overview of SonarQube

Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

TL;DR

$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/sonarqube

Introduction

This chart bootstraps an SonarQube cluster on a Kubernetes cluster using the Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.0+
  • PV provisioner support in the underlying infrastructure
  • ReadWriteMany volumes for deployment scaling

Installing the Chart

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

$ helm install my-release bitnami/sonarqubes

The command deploys SonarQube on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

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.

Parameters

Global parameters

NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.storageClassGlobal StorageClass for Persistent Volume(s)""

Common parameters

NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.fullname""
fullnameOverrideString to fully override common.names.fullname""
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
clusterDomainKubernetes cluster domain namecluster.local
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the deployment["sleep"]
diagnosticMode.argsArgs to override all containers in the deployment["infinity"]

SonarQube Image parameters

NameDescriptionValue
image.registrySonarQube image registrydocker.io
image.repositorySonarQube image repositorybitnami/sonarqube
image.tagSonarQube image tag (immutable tags are recommended)9.2.4-debian-10-r21
image.pullPolicySonarQube image pull policyIfNotPresent
image.pullSecretsSonarQube image pull secrets[]
image.debugEnable SonarQube image debug modefalse

SonarQube Configuration parameters

NameDescriptionValue
sonarqubeUsernameSonarQube usernameuser
sonarqubePasswordSonarQube user password""
existingSecretName of existing secret containing SonarQube credentials""
sonarqubeEmailSonarQube user email[email protected]
minHeapSizeMinimum heap size for SonarQube1024m
maxHeapSizeMaximum heap size for SonarQube2048m
startTimeoutTimeout for the application to start in seconds150
extraPropertiesList of extra properties to be set in the sonar.properties file (key=value format)[]
sonarqubeSkipInstallSkip wizard installationfalse
smtpHostSMTP server host""
smtpPortSMTP server port""
smtpUserSMTP username""
smtpPasswordSMTP user password""
smtpProtocolSMTP protocol""
smtpExistingSecretThe name of an existing secret with SMTP credentials""
commandOverride default container command (useful when using custom images)[]
argsOverride default container args (useful when using custom images)[]
extraEnvVarsArray with extra environment variables to add to SonarQube nodes[]
extraEnvVarsCMName of existing ConfigMap containing extra env vars for SonarQube nodes""
extraEnvVarsSecretName of existing Secret containing extra env vars for SonarQube nodes""

SonarQube deployment parameters

NameDescriptionValue
replicaCountNumber of SonarQube replicas to deploy1
containerPorts.httpSonarQube HTTP container port9000
containerPorts.elasticSonarQube Elasticsearch container port9001
livenessProbe.enabledEnable livenessProbe on SonarQube containerstrue
livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe100
livenessProbe.periodSecondsPeriod seconds for livenessProbe10
livenessProbe.timeoutSecondsTimeout seconds for livenessProbe5
livenessProbe.failureThresholdFailure threshold for livenessProbe6
livenessProbe.successThresholdSuccess threshold for livenessProbe1
readinessProbe.enabledEnable readinessProbe on SonarQube containerstrue
readinessProbe.initialDelaySecondsInitial delay seconds for readinessProbe100
readinessProbe.periodSecondsPeriod seconds for readinessProbe10
readinessProbe.timeoutSecondsTimeout seconds for readinessProbe5
readinessProbe.failureThresholdFailure threshold for readinessProbe6
readinessProbe.successThresholdSuccess threshold for readinessProbe1
startupProbe.enabledEnable startupProbe on SonarQube containersfalse
startupProbe.initialDelaySecondsInitial delay seconds for startupProbe30
startupProbe.periodSecondsPeriod seconds for startupProbe10
startupProbe.timeoutSecondsTimeout seconds for startupProbe1
startupProbe.failureThresholdFailure threshold for startupProbe15
startupProbe.successThresholdSuccess threshold for startupProbe1
customLivenessProbeCustom livenessProbe that overrides the default one{}
customReadinessProbeCustom readinessProbe that overrides the default one{}
customStartupProbeCustom startupProbe that overrides the default one{}
resources.limitsThe resources limits for the SonarQube containers{}
resources.requestsThe requested resources for the SonarQube containers{}
podSecurityContext.enabledEnabled SonarQube pods' Security Contexttrue
podSecurityContext.fsGroupSet SonarQube pod's Security Context fsGroup1001
containerSecurityContext.enabledEnabled SonarQube containers' Security Contexttrue
containerSecurityContext.runAsUserSet SonarQube containers' Security Context runAsUser1001
containerSecurityContext.runAsNonRootSet SonarQube containers' Security Context runAsNonRoottrue
hostAliasesSonarQube pods host aliases[]
podLabelsExtra labels for SonarQube pods{}
podAnnotationsAnnotations for SonarQube pods{}
podAffinityPresetPod affinity preset. Ignored if affinity is set. Allowed values: soft or hard""
podAntiAffinityPresetPod anti-affinity preset. Ignored if affinity is set. Allowed values: soft or hardsoft
nodeAffinityPreset.typeNode affinity preset type. Ignored if affinity is set. Allowed values: soft or hard""
nodeAffinityPreset.keyNode label key to match. Ignored if affinity is set""
nodeAffinityPreset.valuesNo

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 v9.3.1 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