aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
authorAndreas Geissler <andreas-geissler@telekom.de>2023-03-10 13:35:25 +0000
committerGerrit Code Review <gerrit@onap.org>2023-03-10 13:35:25 +0000
commit435ab1f76147c84d622fa1d907341cf7f811c247 (patch)
tree3038f89e1392c5b104bff53c92da7c75d1e21abd /kubernetes/common
parent9ff7ee73b1f5dd0adb1ae9d3b5ae6b324e12dad5 (diff)
parenteb68c405edd326112581ad901f1ce1d3d2e2b98b (diff)
Merge "[STRIMZI] External Kafka Access via Ingress"
Diffstat (limited to 'kubernetes/common')
-rw-r--r--kubernetes/common/common/templates/_ingress.tpl15
-rw-r--r--kubernetes/common/common/templates/_service.tpl2
2 files changed, 16 insertions, 1 deletions
diff --git a/kubernetes/common/common/templates/_ingress.tpl b/kubernetes/common/common/templates/_ingress.tpl
index 7065338cf9..30ef02295f 100644
--- a/kubernetes/common/common/templates/_ingress.tpl
+++ b/kubernetes/common/common/templates/_ingress.tpl
@@ -15,6 +15,21 @@
# limitations under the License.
*/}}
{{/*
+ Helper function to check, if Ingress is globally enabled
+*/}}
+{{- define "common.ingressEnabled" -}}
+{{- $dot := default . .dot -}}
+{{- if $dot.Values.ingress -}}
+{{- if $dot.Values.global.ingress -}}
+{{- if (default false $dot.Values.global.ingress.enabled) -}}
+true
+{{- end -}}
+{{- end -}}
+{{- end -}}
+{{- end -}}
+
+
+{{/*
Create the hostname as concatination <baseaddr>.<baseurl>
- baseaddr: from component values: ingress.service.baseaddr
- baseurl: from values: global.ingress.virtualhost.baseurl
diff --git a/kubernetes/common/common/templates/_service.tpl b/kubernetes/common/common/templates/_service.tpl
index 4b6e0a1aae..3db01396ca 100644
--- a/kubernetes/common/common/templates/_service.tpl
+++ b/kubernetes/common/common/templates/_service.tpl
@@ -250,7 +250,7 @@ spec:
{{- $both_tls_and_plain:= default false $dot.Values.service.both_tls_and_plain }}
{{- $labels := default (dict) .labels -}}
{{- $matchLabels := default (dict) .matchLabels -}}
-{{- if and (include "common.onServiceMesh" $dot) (eq $serviceType "NodePort") }}
+{{- if and (include "common.ingressEnabled" $dot) (eq $serviceType "NodePort") -}}
{{- $serviceType = "ClusterIP" }}
{{- end }}