From fefd3161a610a15e29a7de9082fb6b372e25c810 Mon Sep 17 00:00:00 2001 From: rev Date: Fri, 19 Jul 2019 19:33:11 +0200 Subject: [PATCH] [stable/sonarqube] add annotations (#15675) * Add annotations to pvc and pods Signed-off-by: Yohan Bontemps --- stable/sonarqube/Chart.yaml | 2 +- stable/sonarqube/README.md | 2 ++ stable/sonarqube/templates/deployment.yaml | 6 ++++++ stable/sonarqube/templates/pvc.yaml | 6 ++++++ stable/sonarqube/values.yaml | 6 ++++++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/stable/sonarqube/Chart.yaml b/stable/sonarqube/Chart.yaml index 4013dc658c..5d26d99330 100644 --- a/stable/sonarqube/Chart.yaml +++ b/stable/sonarqube/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: sonarqube description: Sonarqube is an open sourced code quality scanning tool -version: 2.1.1 +version: 2.1.2 appVersion: 7.8 keywords: - coverage diff --git a/stable/sonarqube/README.md b/stable/sonarqube/README.md index 901036ef6a..a3308012d4 100644 --- a/stable/sonarqube/README.md +++ b/stable/sonarqube/README.md @@ -58,6 +58,7 @@ The following table lists the configurable parameters of the Sonarqube chart and | `service.loadBalancerSourceRanges` | Kubernetes service LB Allowed inbound IP addresses | 0.0.0.0/0 | | `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` | @@ -83,6 +84,7 @@ The following table lists the configurable parameters of the Sonarqube chart and | `mysql.mysqlDatabase` | Mysql database name | `sonarDB` | | `mysql.mysqlParams` | Mysql parameters for JDBC connection string | `{}` | | `mysql.service.port` | Mysql port | `3306` | +| `annotations` | Sonarqube Pod annotations | `{}` | | `resources` | Sonarqube Pod resource requests & limits | `{}` | | `affinity` | Node / Pod affinities | `{}` | | `nodeSelector` | Node labels for pod assignment | `{}` | diff --git a/stable/sonarqube/templates/deployment.yaml b/stable/sonarqube/templates/deployment.yaml index 1b73f1998c..67da4de0e3 100644 --- a/stable/sonarqube/templates/deployment.yaml +++ b/stable/sonarqube/templates/deployment.yaml @@ -16,6 +16,12 @@ spec: release: {{ .Release.Name }} {{- with .Values.podLabels }} {{ toYaml . | indent 8 }} +{{- end }} +{{ if .Values.annotations}} + annotations: + {{- range $key, $value := .Values.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} {{- end }} spec: securityContext: diff --git a/stable/sonarqube/templates/pvc.yaml b/stable/sonarqube/templates/pvc.yaml index 6092f32747..76d114195a 100644 --- a/stable/sonarqube/templates/pvc.yaml +++ b/stable/sonarqube/templates/pvc.yaml @@ -8,6 +8,12 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" +{{ if .Values.presistence.annotations}} + annotations: + {{- range $key, $value := .Values.persistence.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +{{- end }} spec: accessModes: - {{ .Values.persistence.accessMode | quote }} diff --git a/stable/sonarqube/values.yaml b/stable/sonarqube/values.yaml index 5e8a1d9608..a5d05189bd 100755 --- a/stable/sonarqube/values.yaml +++ b/stable/sonarqube/values.yaml @@ -89,6 +89,9 @@ extraEnv: {} # If an ingress *path* is defined, it should be reflected here # sonar.web.context: /sonarqube +# Set annotations for pods +annotations: {} + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -102,6 +105,9 @@ resources: {} # memory: 128Mi persistence: enabled: false + ## Set annotations on pvc + annotations: {} + ## Specify an existing volume claim instead of creating a new one. ## When using this option all following options like storageClass, accessMode and size are ignored. # existingClaim: