X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2Finfrastructure%2Fsubcharts%2Fkong%2Ftemplates%2Fdeployment.yaml;h=40afe66333b219cef9122bd65f9f6e59feaa543f;hb=3bff79d624676f22963932bccbfbcb07b6d5332f;hp=de07aa738c4ce88f9acf193ee218bbb757ba82d2;hpb=d9b07f73c5c681ac28e384285e842bc1aee6bbe5;p=ric-plt%2Fric-dep.git diff --git a/helm/infrastructure/subcharts/kong/templates/deployment.yaml b/helm/infrastructure/subcharts/kong/templates/deployment.yaml old mode 100755 new mode 100644 index de07aa7..40afe66 --- a/helm/infrastructure/subcharts/kong/templates/deployment.yaml +++ b/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