Render nextcloud postgres service using library chart

This commit is contained in:
Waqar Ahmed
2021-01-30 13:31:12 +05:00
parent 4b3bad4efc
commit f1c9917612
2 changed files with 7 additions and 24 deletions

View File

@@ -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 }}

View File

@@ -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