From f1c9917612c5ad3aaaa23aeecfdf065afe7d4c3a Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Sat, 30 Jan 2021 13:31:12 +0500 Subject: [PATCH] Render nextcloud postgres service using library chart --- .../1.1.0/templates/postgres-service.yaml | 23 ++++--------------- .../1.1.0/templates/serviceaccount.yaml | 8 ++----- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/test/nextcloud/1.1.0/templates/postgres-service.yaml b/test/nextcloud/1.1.0/templates/postgres-service.yaml index 4d2837e4d5..7e895c9c4b 100644 --- a/test/nextcloud/1.1.0/templates/postgres-service.yaml +++ b/test/nextcloud/1.1.0/templates/postgres-service.yaml @@ -1,18 +1,5 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "nextcloud.fullname" . }}-postgres - labels: - app.kubernetes.io/name: {{ include "nextcloud.name" . }}-postgres - helm.sh/chart: {{ include "nextcloud.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: app -spec: - type: ClusterIP - ports: - - port: 5432 - protocol: TCP - name: postgres-tcp - selector: - {{- include "nextcloud.postgres.selectorLabels" . | nindent 4 }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "postgres-tcp" "port" 5432 "targetPort" 5432) }} +{{ $params := . }} +{{ $_ := set $params "service" (dict "type" "ClusterIP" "ports" $ports "nameSuffix" "postgres" ) }} +{{ include "common.classes.service" $params }} diff --git a/test/nextcloud/1.1.0/templates/serviceaccount.yaml b/test/nextcloud/1.1.0/templates/serviceaccount.yaml index c25bd439fd..a5b1f453b5 100644 --- a/test/nextcloud/1.1.0/templates/serviceaccount.yaml +++ b/test/nextcloud/1.1.0/templates/serviceaccount.yaml @@ -1,8 +1,4 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: "{{ template "nextcloud.serviceAccountName" . }}" - namespace: {{ .Release.Namespace }} +{{- include "common.serviceaccount" . -}} --- @@ -12,7 +8,7 @@ metadata: name: "{{ .Release.Name }}-service-account-role-binding" subjects: - kind: ServiceAccount - name: "{{ template "nextcloud.serviceAccountName" . }}" + name: "{{ template "common.names.serviceAccountName" . }}" namespace: {{ .Release.Namespace }} roleRef: kind: Role