Merge "[DCAEMOD] Uses new tpls for repos / images"
[oom.git] / kubernetes / common / postgres / templates / _deployment.tpl
index b1aae5f..6142baa 100644 (file)
@@ -18,7 +18,7 @@
 {{- define "common.postgres.deployment" -}}
   {{- $dot := .dot }}
   {{- $pgMode := .pgMode }}
-apiVersion: apps/v1beta1
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ include "common.fullname" $dot }}-{{ $pgMode }}
@@ -30,8 +30,10 @@ metadata:
     heritage: {{ $dot.Release.Service }}
     name: "{{ index $dot.Values "container" "name" $pgMode }}"
 spec:
-  serviceName: {{ $dot.Values.service.name }}
   replicas: 1
+  selector:
+    matchLabels:
+      app: {{ include "common.name" $dot }}-{{ $pgMode }}
   template:
     metadata:
       labels:
@@ -71,7 +73,7 @@ spec:
           subPath: setup.sql
         - mountPath: /config
           name: pgconf
-        image: "{{ $dot.Values.global.envsubstImage }}"
+        image: {{ include "repositoryGenerator.image.envsubst" $dot }}
         imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
         name: {{ include "common.name" $dot }}-update-config
 
@@ -82,14 +84,14 @@ spec:
         - |
           chown 26:26 /podroot/;
           chmod 700 /podroot/;
-        image: {{ $dot.Values.global.busyboxRepository | default $dot.Values.busyboxRepository }}/{{ $dot.Values.busyboxImage }}
+        image: {{ include "repositoryGenerator.image.busybox" $dot }}
         imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
         volumeMounts:
         - name: {{ include "common.fullname" $dot }}-data
           mountPath: /podroot/
       containers:
       - name: {{ include "common.name" $dot }}
-        image: "{{ $dot.Values.postgresRepository }}/{{ $dot.Values.image }}"
+        image: {{ include "repositoryGenerator.image.postgres" $dot }}
         imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
         ports:
         - containerPort: {{ $dot.Values.service.internalPort }}
@@ -144,8 +146,7 @@ spec:
         - mountPath: /backup
           name: {{ include "common.fullname" $dot }}-backup
           readOnly: true
-        resources:
-{{ include "common.resources" $dot | indent 12 }}
+        resources: {{ include "common.resources" $dot | nindent 12 }}
         {{- if $dot.Values.nodeSelector }}
         nodeSelector:
 {{ toYaml $dot.Values.nodeSelector | indent 10 }}