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

[sonarqube] Add optional serviceaccount creation #50

Merged
merged 5 commits into from
Mar 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add optional serviceaccount creation
Timo Koller committed Mar 26, 2020

Verified

This commit was signed with the committer’s verified signature.
JakeStanger Jake Stanger
commit e17978a758b65e1d17d3abaa0a01803f97b575b2
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.0.1
appVersion: 8.2-community
keywords:
- coverage
3 changes: 3 additions & 0 deletions charts/sonarqube/README.md
Original file line number Diff line number Diff line change
@@ -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` |
10 changes: 5 additions & 5 deletions charts/sonarqube/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies:
- name: postgresql
version: 8.2.0
repository: https://kubernetes-charts.storage.googleapis.com/
condition: postgresql.enabled
#dependencies:
#- name: postgresql
# version: 8.2.0
# repository: https://kubernetes-charts.storage.googleapis.com/
# condition: postgresql.enabled
7 changes: 7 additions & 0 deletions charts/sonarqube/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
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 | nindent 4 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the typo on indent.

{{- end }}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/sonarqube/values.yaml
Original file line number Diff line number Diff line change
@@ -218,3 +218,9 @@ podLabels: {}
sonarqubeFolder: /opt/sonarqube

enableTests: true

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