Merge "Make APPC compatible with Kubernetes v1.17"
[oom.git] / kubernetes / appc / charts / appc-cdt / templates / deployment.yaml
index a2cb9fc..9cf2a10 100644 (file)
@@ -1,4 +1,18 @@
-apiVersion: extensions/v1beta1
+# Copyright © 2018  AT&T, Amdocs, Bell Canada Intellectual Property.  All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ include "common.fullname" . }}
@@ -6,15 +20,18 @@ metadata:
   labels:
     app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
+  selector:
+    matchLabels:
+      app: {{ include "common.name" . }}
   replicas: {{ .Values.replicaCount }}
   template:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
     spec:
       initContainers:
       containers:
@@ -42,8 +59,8 @@ spec:
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           env:
           # This sets the port that CDT will use to connect to the main appc container.
-          # The 32 is the node port suffix that is used in the main appc oom templates
-          # for nodePort3.
+          # The 11 is the node port suffix that is used in the main appc oom templates
+          # for nodePort3. This value will be configured in appc main chart in appc-cdt section.
           - name: CDT_PORT
             value: "{{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.nodePort3 }}"
           volumeMounts:
@@ -51,7 +68,7 @@ spec:
             name: localtime
             readOnly: true
           resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ include "common.resources" . | indent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}