Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #50 from tibuntu/sonarqube-allow-serviceaccount
Browse files Browse the repository at this point in the history
[sonarqube] Add optional serviceaccount creation
  • Loading branch information
rjkernick authored Mar 30, 2020
2 parents d3f5795 + 7233fc7 commit f4f6844
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/sonarqube/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: sonarqube
description: SonarQube is an open sourced code quality scanning tool
version: 5.0.0
version: 5.1.0
appVersion: 8.2-community
keywords:
- coverage
Expand Down
3 changes: 3 additions & 0 deletions charts/sonarqube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ The following table lists the configurable parameters of the Sonarqube chart and
| `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` |
Expand Down
7 changes: 7 additions & 0 deletions charts/sonarqube/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ spec:
{{- end }}
{{- end }}
spec:
{{- if .Values.serviceAccount.create }}
{{- if .Values.serviceAccount.name }}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- else }}
serviceAccountName: {{ include "sonarqube.fullname" . }}
{{- end }}
{{- end }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- if .Values.image.pullSecret }}
Expand Down
15 changes: 15 additions & 0 deletions charts/sonarqube/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.serviceAccount.create -}}
---
apiVersion: v1
kind: ServiceAccount
metadata:
{{- if .Values.serviceAccount.name }}
name: {{ .Values.serviceAccount.name }}
{{- else }}
name: {{ include "sonarqube.fullname" . }}
{{- end }}
{{- if .Values.serviceAccount.annotations }}
annotations:
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
{{- end }}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/sonarqube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,9 @@ podLabels: {}
sonarqubeFolder: /opt/sonarqube

enableTests: true

serviceAccount:
create: false
# name:
## Annotations for the Service Account
annotations: {}

0 comments on commit f4f6844

Please sign in to comment.