X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric-aux%2Fhelm%2Finfrastructure%2Fsubcharts%2Fkong%2Ftemplates%2Fdeployment.yaml;h=40afe66333b219cef9122bd65f9f6e59feaa543f;hb=refs%2Fchanges%2F71%2F5671%2F1;hp=de07aa738c4ce88f9acf193ee218bbb757ba82d2;hpb=dc00cdf008775e2ac5dddb186d1eb81e80370b69;p=it%2Fdep.git diff --git a/ric-aux/helm/infrastructure/subcharts/kong/templates/deployment.yaml b/ric-aux/helm/infrastructure/subcharts/kong/templates/deployment.yaml index de07aa73..40afe663 100755 --- a/ric-aux/helm/infrastructure/subcharts/kong/templates/deployment.yaml +++ b/ric-aux/helm/infrastructure/subcharts/kong/templates/deployment.yaml @@ -29,6 +29,50 @@ spec: {{- if .Values.podAnnotations }} {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} + {{- if $.Values.global }} + {{- if $.Values.global.danm_networks }} + {{- $networklist := list }} + {{- range $network := $.Values.global.danm_networks }} + {{- if $network.tenants }} + {{- if $network.tenants.kong }} + {{- $networklist = append $networklist $network }} + {{- end }} + {{- end }} + {{- end }} + {{- if $networklist }} + danm.k8s.io/interfaces: | + [ + {{- range $network := $networklist }} + {{- printf "\n {\"clusterNetwork\": \"%s\"" $network.name }} + {{- if $network.tenants.kong.ip }} + {{- printf ", \"ip\": \"%s\"" $network.tenants.kong.ip }} + {{- else }} + {{- printf ", \"ip\": \"dynamic\"" }} + {{- end }} + {{- if $network.tenants.kong.ip6 }} + {{- printf ", \"ip6\": \"%s\"" $network.tenants.kong.ip6 }} + {{- end }} + {{- if $network.tenants.kong.proutes }} + {{- printf ", \"proutes\": {" }} + {{- range $subnet, $gw := $network.tenants.kong.proutes }} + {{- if eq $subnet ( first ( keys $network.tenants.kong.proutes ))}} + {{- printf "\"%s\": \"%s\"" $subnet $gw }} + {{- else }} + {{- printf ", \"%s\": \"%s\"" $subnet $gw }} + {{- end }} + {{- end }} + {{- printf "}" }} + {{- end }} + {{- if ne $network.name (last $networklist).name }} + {{- printf "}," }} + {{- else }} + {{- printf "}" }} + {{- end }} + {{- end }} + ] + {{- end }} + {{- end }} + {{- end }} labels: {{- include "kong.metaLabels" . | nindent 8 }} app.kubernetes.io/component: app