sonarqube
by KubeSphere
SonarQube is an open sourced code quality scanning tool
About this chart
Forked from https://github.com/Oteemo/charts/tree/master/charts/sonarqube.
SonarQube
SonarQube is an open sourced code quality scanning tool.
Introduction
This chart bootstraps a SonarQube instance with a PostgreSQL database.
Prerequisites
- Kubernetes 1.10+
Installing the chart
To install the chart:
helm repo add oteemocharts https://oteemo.github.io/charts
helm install oteemocharts/sonarqube
The above command deploys Sonarqube on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.
The default login is admin/admin.
Uninstalling the chart
To uninstall/delete the deployment:
$ helm list
NAME REVISION UPDATED STATUS CHART NAMESPACE
kindly-newt 1 Mon Oct 2 15:05:44 2017 DEPLOYED sonarqube-0.1.0 default
$ helm delete kindly-newt
Ingress Paths
Some cloud may need the path to be /* instead of /. Try this first if you are having issues getting traffic through the ingress.
Configuration
The following table lists the configurable parameters of the Sonarqube chart and their default values.
| Parameter | Description | Default |
|---|---|---|
replicaCount | Number of replicas deployed | 1 |
deploymentStrategy | Deployment strategy | {} |
image.repository | image repository | sonarqube |
image.tag | sonarqube image tag. | 8.9-community |
image.pullPolicy | Image pull policy | IfNotPresent |
image.pullSecret | imagePullSecret to use for private repository | |
command | command to run in the container | nil (need to be set prior to 6.7.6, and 7.4) |
elasticsearch.configureNode | Modify k8s worker to conform to system requirements | true |
elasticsearch.bootstrapChecks | Enables/disables Elasticsearch bootstrap checks | true |
securityContext.fsGroup | Group applied to mounted directories/files | 999 |
ingress.enabled | Flag for enabling ingress | false |
ingress.labels | Ingress additional labels | {} |
ingress.hosts[0].name | Hostname to your SonarQube installation | sonar.organization.com |
ingress.hosts[0].path | Path within the URL structure | / |
ingress.hosts[0].serviceName | Optional field to override the default serviceName of a path | None |
ingress.hosts[0].servicePort | Optional field to override the default servicePort of a path | None |
ingress.tls | Ingress secrets for TLS certificates | [] |
livenessProbe.sonarWebContext | SonarQube web context for livenessProbe | / |
readinessProbe.sonarWebContext | SonarQube web context for readinessProbe | / |
service.type | Kubernetes service type | ClusterIP |
service.externalPort | Kubernetes service port | 9000 |
service.internalPort | Kubernetes container port | 9000 |
service.labels | Kubernetes service labels | None |
service.annotations | Kubernetes service annotations | None |
service.loadBalancerSourceRanges | Kubernetes service LB Allowed inbound IP addresses | None |
service.loadBalancerIP | Kubernetes service LB Optional fixed external IP | None |
persistence.enabled | Flag for enabling persistent storage | false |
persistence.annotations | Kubernetes pvc annotations | {} |
persistence.existingClaim | Do not create a new PVC but use this one | None |
persistence.storageClass | Storage class to be used | "" |
persistence.accessMode | Volumes access mode to be set | ReadWriteOnce |
persistence.size | Size of the volume | 10Gi |
persistence.volumes | Specify extra volumes. Refer to ".spec.volumes" specification | [] |
persistence.mounts | Specify extra mounts. Refer to ".spec.containers.volumeMounts" specification | [] |
serviceAccount.create | If set to true, create a serviceAccount | false |
serviceAccount.name | Name of the serviceAccount to create/use | sonarqube-sonarqube |
serviceAccount.annotations | Additional serviceAccount annotations | {} |
sonarProperties | Custom sonar.properties file | None |
sonarSecretProperties | Additional sonar.properties file to load from a secret | None |
caCerts.secret | Name of the secret containing additional CA certificates | nil |
jvmOpts | Values to add to SONARQUBE_WEB_JVM_OPTS | "" |
env | Environment variables to attach to the pods | nil |
sonarSecretKey | Name of existing secret used for settings encryption | None |
postgresql.enabled | Set to false to use external server | true |
postgresql.existingSecret | Secret containing the password of the external Postgresql server | null |
postgresql.postgresqlServer | Hostname of the external Postgresql server | null |
postgresql.postgresqlUsername | Postgresql database user | sonarUser |
postgresql.postgresqlPassword | Postgresql database password | sonarPass |
postgresql.postgresqlDatabase | Postgresql database name | sonarDB |
postgresql.service.port | Postgresql port | 5432 |
jdbcDatabaseType | Type of the JDBC Database driver | postgreql |
jdbcUrlOverride Overrides default JDBC URL creation | None | |
annotations | Sonarqube Pod annotations | {} |
resources | Sonarqube Pod resource requests & limits | {} |
affinity | Node / Pod affinities | {} |
nodeSelector | Node labels for pod assignment | {} |
hostAliases | Aliases for IPs in /etc/hosts | [] |
tolerations | List of node taints to tolerate |
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 v6.7.0 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