1 ################################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property. #
3 # Copyright (c) 2019 Nokia. #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
18 {{- $health := .Values.health }}
19 {{- $common_env := .Values.common_env_variables }}
20 {{- range keys .Values.e2term }}
22 {{- with index $topCtx.Values.e2term . }}
24 {{- $imagectx := dict "ctx" $topCtx "defaultregistry" .image.registry }}
25 {{- $pullpolicyctx := dict "ctx" $topCtx "defaultpullpolicy" .imagePullPolicy }}
30 name: {{ include "common.deploymentname.e2term" $topCtx }}-{{ $key }}
31 namespace: {{ include "common.namespace.platform" $topCtx }}
33 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
34 chart: {{ $topCtx.Chart.Name }}-{{ $topCtx.Chart.Version | replace "+" "_" }}
35 release: {{ $topCtx.Release.Name }}
36 heritage: {{ $topCtx.Release.Service }}
38 replicas: {{ .replicaCount }}
41 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
42 release: {{ $topCtx.Release.Name }}
45 {{- if $.Values.global }}
46 {{- if $.Values.global.danm_networks }}
47 {{- $networklist := list }}
48 {{- range $network := $.Values.global.danm_networks }}
49 {{- if $network.tenants }}
50 {{- if $network.tenants.e2term }}
51 {{- if (hasKey $network.tenants.e2term $key) }}
52 {{- $networklist = append $networklist $network }}
57 {{- if $networklist }}
59 danm.k8s.io/interfaces: |
61 {{- range $network := $networklist }}
62 {{- printf "\n {\"clusterNetwork\": \"%s\"" $network.name }}
63 {{- with index $network.tenants.e2term $key }}
65 {{- printf ", \"ip\": \"%s\"" .ip }}
67 {{- printf ", \"ip\": \"dynamic\"" }}
70 {{- printf ", \"ip6\": \"%s\"" .ip6 }}
73 {{- printf ", \"proutes\": {" }}
74 {{- range $subnet, $gw := .proutes }}
75 {{- if eq $subnet ( first ( keys .proutes ))}}
76 {{- printf "\"%s\": \"%s\"" $subnet $gw }}
78 {{- printf ", \"%s\": \"%s\"" $subnet $gw }}
84 {{- if ne $network.name (last $networklist).name }}
95 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
96 release: {{ $topCtx.Release.Name }}
98 hostname: {{ include "common.name.e2term" $topCtx }}-{{ $key }}
99 hostNetwork: {{ .hostnetworkmode }}
100 dnsPolicy: ClusterFirstWithHostNet
102 - name: {{ include "common.dockerregistry.credential" $imagectx }}
103 {{- with .nodeselector }}
104 nodeSelector: {{ toYaml . | trim | nindent 8 -}}
107 - name: {{ include "common.containername.e2term" $topCtx }}
108 image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .image.name }}:{{ .image.tag }}
109 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
111 - mountPath: /opt/e2/router.txt
112 name: local-router-file
114 - mountPath: /tmp/rmr_verbose
115 name: local-router-file
117 - mountPath: {{ dir $common_env.ConfigMapName }}
118 name: local-loglevel-file
119 {{ if .pizpub.enabled }}
120 - mountPath: "{{ .env.messagecollectorfile }}"
123 subPath: "{{ .pizpub.scanDirectory }}"
125 - mountPath: "{{ .env.messagecollectorfile }}"
131 name: {{ include "common.configmapname.e2term" $topCtx }}-env-{{ $key }}
135 - name: CONFIG_MAP_NAME
136 value: "{{ $common_env.ConfigMapName }}"
140 fieldPath: spec.nodeName
142 value: "{{ $common_env.ServiceName }}"
143 - name: CONTAINER_NAME
144 value: "{{ include "common.containername.e2term" $topCtx }}"
148 fieldPath: metadata.name
150 - name: "rmrroute-{{ $key }}"
151 containerPort: {{ include "common.serviceport.e2term.rmr.route" $topCtx }}
152 - name: "rmrdata-{{ $key }}"
153 containerPort: {{ include "common.serviceport.e2term.rmr.data" $topCtx }}
154 - name: "sctp-{{ $key }}"
157 - name: "prmts-{{ $key }}"
158 containerPort: {{ include "common.serviceport.e2term.prometheus" $topCtx }}
162 privileged: {{ .privilegedmode }}
163 {{- if eq $health.liveness.enabled true }}
166 command: [ "/bin/sh", "-c", "{{ $health.readiness.command }}:{{ include "common.serviceport.e2term.rmr.data" . }}" ]
167 initialDelaySeconds: {{ $health.readiness.initialDelaySeconds }}
168 periodSeconds: {{ $health.readiness.periodSeconds }}
170 {{- if eq $health.liveness.enabled true }}
173 command: [ "/bin/sh", "-c", "{{ $health.liveness.command }}:{{ include "common.serviceport.e2term.rmr.data" . }}" ]
174 initialDelaySeconds: {{ $health.liveness.initialDelaySeconds }}
175 periodSeconds: {{ $health.liveness.periodSeconds }}
177 {{ if .pizpub.enabled }}
178 - name: {{ include "common.containername.e2term" $topCtx }}-pizpub
179 {{- $pizpubimagectx := dict "ctx" $topCtx "defaultregistry" .pizpub.image.registry }}
180 image: {{ include "common.dockerregistry.url" $pizpubimagectx }}/{{ .pizpub.image.name }}:{{ .pizpub.image.tag }}
181 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
183 - mountPath: /etc/localtime
186 - mountPath: "{{ .pizpub.dataRootDir }}"
189 - name: pizpub-config
190 mountPath: /opt/app/config/conf/
194 command: ["/bin/sh", "/opt/app/config/conf/cleaner.sh", "{{ .pizpub.dataRootDir }}/{{ .pizpub.processedDirectory }}", "3"]
197 - name: local-router-file
199 name: {{ include "common.configmapname.e2term" $topCtx }}-router-configmap
200 - name: local-loglevel-file
202 name: {{ include "common.configmapname.e2term" $topCtx }}-loglevel-configmap
203 {{ if .pizpub.enabled }}
207 - name: pizpub-config
209 name: {{ include "common.configmapname.e2term" $topCtx }}-pizpub-{{ $key }}
212 persistentVolumeClaim:
213 claimName: {{ include "common.pvcname.e2term" $topCtx }}-{{ $key }}