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 {{- range keys .Values.e2term }}
20 {{- with index $topCtx.Values.e2term . }}
22 {{- $imagectx := dict "ctx" $topCtx "defaultregistry" .image.registry }}
23 {{- $pullpolicyctx := dict "ctx" $topCtx "defaultpullpolicy" .imagePullPolicy }}
28 name: {{ include "common.deploymentname.e2term" $topCtx }}-{{ $key }}
29 namespace: {{ include "common.namespace.platform" $topCtx }}
31 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}
32 chart: {{ $topCtx.Chart.Name }}-{{ $topCtx.Chart.Version | replace "+" "_" }}
33 release: {{ $topCtx.Release.Name }}
34 heritage: {{ $topCtx.Release.Service }}
36 replicas: {{ .replicaCount }}
39 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}
40 release: {{ $topCtx.Release.Name }}
43 {{- if $.Values.global }}
44 {{- if $.Values.global.danm_networks }}
45 {{- $networklist := list }}
46 {{- range $network := $.Values.global.danm_networks }}
47 {{- if $network.tenants }}
48 {{- if $network.tenants.e2term }}
49 {{- if (hasKey $network.tenants.e2term $key) }}
50 {{- $networklist = append $networklist $network }}
55 {{- if $networklist }}
57 danm.k8s.io/interfaces: |
59 {{- range $network := $networklist }}
60 {{- printf "\n {\"clusterNetwork\": \"%s\"" $network.name }}
61 {{- with index $network.tenants.e2term $key }}
63 {{- printf ", \"ip\": \"%s\"" .ip }}
65 {{- printf ", \"ip\": \"dynamic\"" }}
68 {{- printf ", \"ip6\": \"%s\"" .ip6 }}
71 {{- printf ", \"proutes\": {" }}
72 {{- range $subnet, $gw := .proutes }}
73 {{- if eq $subnet ( first ( keys .proutes ))}}
74 {{- printf "\"%s\": \"%s\"" $subnet $gw }}
76 {{- printf ", \"%s\": \"%s\"" $subnet $gw }}
82 {{- if ne $network.name (last $networklist).name }}
93 app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}
94 release: {{ $topCtx.Release.Name }}
96 hostname: {{ include "common.name.e2term" $topCtx }}-{{ $key }}
97 hostNetwork: {{ .hostnetworkmode }}
98 dnsPolicy: ClusterFirstWithHostNet
100 - name: {{ include "common.dockerregistry.credential" $imagectx }}
101 {{- with .nodeselector }}
102 nodeSelector: {{ toYaml . | trim | nindent 8 -}}
105 - name: {{ include "common.containername.e2term" $topCtx }}
106 image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .image.name }}:{{ .image.tag }}
107 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
109 - mountPath: /opt/e2/router.txt
110 name: local-router-file
112 - mountPath: /tmp/rmr_verbose
113 name: local-router-file
115 {{ if .pizpub.enabled }}
116 - mountPath: "{{ .env.messagecollectorfile }}"
119 subPath: "{{ .pizpub.scanDirectory }}"
121 - mountPath: "{{ .env.messagecollectorfile }}"
127 name: {{ include "common.configmapname.e2term" $topCtx }}-env-{{ $key }}
129 - name: "rmrroute-{{ $key }}"
130 containerPort: {{ include "common.serviceport.e2term.rmr.route" $topCtx }}
131 - name: "rmrdata-{{ $key }}"
132 containerPort: {{ include "common.serviceport.e2term.rmr.data" $topCtx }}
133 - name: "rmrsctp-{{ $key }}"
139 privileged: {{ .privilegedmode }}
141 {{ if .pizpub.enabled }}
142 - name: {{ include "common.containername.e2term" $topCtx }}-pizpub
143 {{- $pizpubimagectx := dict "ctx" $topCtx "defaultregistry" .pizpub.image.registry }}
144 image: {{ include "common.dockerregistry.url" $pizpubimagectx }}/{{ .pizpub.image.name }}:{{ .pizpub.image.tag }}
145 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $pullpolicyctx }}
147 - mountPath: /etc/localtime
150 - mountPath: "{{ .pizpub.dataRootDir }}"
153 - name: pizpub-config
154 mountPath: /opt/app/config/conf/
158 command: ["/bin/sh", "/opt/app/config/conf/cleaner.sh", "{{ .pizpub.dataRootDir }}/{{ .pizpub.processedDirectory }}", "3"]
161 - name: local-router-file
163 name: {{ include "common.configmapname.e2term" $topCtx }}-router-configmap
164 {{ if .pizpub.enabled }}
168 - name: pizpub-config
170 name: {{ include "common.configmapname.e2term" $topCtx }}-pizpub-{{ $key }}
173 persistentVolumeClaim:
174 claimName: {{ include "common.pvcname.e2term" $topCtx }}-{{ $key }}