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 {{- range keys .Values.e2term }}
21 {{- with index $topCtx.Values.e2term . }}
23 {{- $imagectx := dict "ctx" $topCtx "defaultregistry" .image.registry }}
24 {{- $pullpolicyctx := dict "ctx" $topCtx "defaultpullpolicy" .imagePullPolicy }}
29 name: {{ include "common.deploymentname.e2term" $topCtx }}-{{ $key }}
30 namespace: {{ include "common.namespace.platform" $topCtx }}
32 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
33 chart: {{ $topCtx.Chart.Name }}-{{ $topCtx.Chart.Version | replace "+" "_" }}
34 release: {{ $topCtx.Release.Name }}
35 heritage: {{ $topCtx.Release.Service }}
37 replicas: {{ .replicaCount }}
40 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
41 release: {{ $topCtx.Release.Name }}
44 {{- if $.Values.global }}
45 {{- if $.Values.global.danm_networks }}
46 {{- $networklist := list }}
47 {{- range $network := $.Values.global.danm_networks }}
48 {{- if $network.tenants }}
49 {{- if $network.tenants.e2term }}
50 {{- if (hasKey $network.tenants.e2term $key) }}
51 {{- $networklist = append $networklist $network }}
56 {{- if $networklist }}
58 danm.k8s.io/interfaces: |
60 {{- range $network := $networklist }}
61 {{- printf "\n {\"clusterNetwork\": \"%s\"" $network.name }}
62 {{- with index $network.tenants.e2term $key }}
64 {{- printf ", \"ip\": \"%s\"" .ip }}
66 {{- printf ", \"ip\": \"dynamic\"" }}
69 {{- printf ", \"ip6\": \"%s\"" .ip6 }}
72 {{- printf ", \"proutes\": {" }}
73 {{- range $subnet, $gw := .proutes }}
74 {{- if eq $subnet ( first ( keys .proutes ))}}
75 {{- printf "\"%s\": \"%s\"" $subnet $gw }}
77 {{- printf ", \"%s\": \"%s\"" $subnet $gw }}
83 {{- if ne $network.name (last $networklist).name }}
94 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
95 release: {{ $topCtx.Release.Name }}
97 hostname: {{ include "common.name.e2term" $topCtx }}-{{ $key }}
98 hostNetwork: {{ .hostnetworkmode }}
99 dnsPolicy: ClusterFirstWithHostNet
101 - name: {{ include "common.dockerregistry.credential" $imagectx }}
102 {{- with .nodeselector }}
103 nodeSelector: {{ toYaml . | trim | nindent 8 -}}
106 - name: {{ include "common.containername.e2term" $topCtx }}
107 image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .image.name }}:{{ .image.tag }}
108 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
110 - mountPath: /opt/e2/router.txt
111 name: local-router-file
113 - mountPath: /tmp/rmr_verbose
114 name: local-router-file
116 {{ if .pizpub.enabled }}
117 - mountPath: "{{ .env.messagecollectorfile }}"
120 subPath: "{{ .pizpub.scanDirectory }}"
122 - mountPath: "{{ .env.messagecollectorfile }}"
128 name: {{ include "common.configmapname.e2term" $topCtx }}-env-{{ $key }}
130 - name: "rmrroute-{{ $key }}"
131 containerPort: {{ include "common.serviceport.e2term.rmr.route" $topCtx }}
132 - name: "rmrdata-{{ $key }}"
133 containerPort: {{ include "common.serviceport.e2term.rmr.data" $topCtx }}
134 - name: "sctp-{{ $key }}"
140 privileged: {{ .privilegedmode }}
141 {{- if eq $health.liveness.enabled true }}
144 command: [ "/bin/sh", "-c", "{{ $health.readiness.command }}:{{ include "common.serviceport.e2term.rmr.data" . }}" ]
145 initialDelaySeconds: {{ $health.readiness.initialDelaySeconds }}
146 periodSeconds: {{ $health.readiness.periodSeconds }}
148 {{- if eq $health.liveness.enabled true }}
151 command: [ "/bin/sh", "-c", "{{ $health.liveness.command }}:{{ include "common.serviceport.e2term.rmr.data" . }}" ]
152 initialDelaySeconds: {{ $health.liveness.initialDelaySeconds }}
153 periodSeconds: {{ $health.liveness.periodSeconds }}
155 {{ if .pizpub.enabled }}
156 - name: {{ include "common.containername.e2term" $topCtx }}-pizpub
157 {{- $pizpubimagectx := dict "ctx" $topCtx "defaultregistry" .pizpub.image.registry }}
158 image: {{ include "common.dockerregistry.url" $pizpubimagectx }}/{{ .pizpub.image.name }}:{{ .pizpub.image.tag }}
159 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
161 - mountPath: /etc/localtime
164 - mountPath: "{{ .pizpub.dataRootDir }}"
167 - name: pizpub-config
168 mountPath: /opt/app/config/conf/
172 command: ["/bin/sh", "/opt/app/config/conf/cleaner.sh", "{{ .pizpub.dataRootDir }}/{{ .pizpub.processedDirectory }}", "3"]
175 - name: local-router-file
177 name: {{ include "common.configmapname.e2term" $topCtx }}-router-configmap
178 {{ if .pizpub.enabled }}
182 - name: pizpub-config
184 name: {{ include "common.configmapname.e2term" $topCtx }}-pizpub-{{ $key }}
187 persistentVolumeClaim:
188 claimName: {{ include "common.pvcname.e2term" $topCtx }}-{{ $key }}