diff --git a/charts/hypo/templates/fabric-api/ingress.yaml b/charts/hypo/templates/fabric-api/ingress.yaml index 0175fa287c0755d10488eba1feb40946b612753e..65cc9967d79f45aeaa1737b79ffee8de46c61ac9 100644 --- a/charts/hypo/templates/fabric-api/ingress.yaml +++ b/charts/hypo/templates/fabric-api/ingress.yaml @@ -1,6 +1,6 @@ {{ $ingressNginx := index .Values "ingress-nginx" }} {{ $fabricApi := index .Values "fabric-api" }} -{{- if $fabricApi.enabled -}} +{{- if and $fabricApi.enabled $fabricApi.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/hypo/templates/grafana/ingress.yaml b/charts/hypo/templates/grafana/ingress.yaml index f157f00f3d614d3781078453337e974248553ebf..7ef2012a1550bac2f5ee4586f9e091b646732a06 100644 --- a/charts/hypo/templates/grafana/ingress.yaml +++ b/charts/hypo/templates/grafana/ingress.yaml @@ -1,6 +1,6 @@ {{ $ingressNginx := index .Values "ingress-nginx" }} {{ $kubePrometheusStack := index .Values "kube-prometheus-stack" }} -{{- if $kubePrometheusStack.setup -}} +{{- if and $kubePrometheusStack.setup $kubePrometheusStack.grafana.ingress.setup -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/hypo/templates/grafana/job.yaml b/charts/hypo/templates/grafana/job.yaml index 431b2eee4197442a4ecadbf39b07fdab948c3ac1..4130eb174aaa6e7f39c0b05c495c36aaa1c76923 100644 --- a/charts/hypo/templates/grafana/job.yaml +++ b/charts/hypo/templates/grafana/job.yaml @@ -86,12 +86,24 @@ spec: echo "Found Prometheus CR: ${PROM}" + {{- if $kubePrometheusStack.prometheus.ingress.setup }} + + EXTERNAL_URL="http://${NODE_IP}:{{ $ingressNginx.controller.service.nodePorts.http }}/prometheus" + + {{- else }} + + EXTERNAL_URL="http://${NODE_IP}:{{ $kubePrometheusStack.prometheus.service.nodePort }}" + + {{- end }} + + echo "Setting Prometheus external URL to: ${EXTERNAL_URL}" + kubectl patch prometheus "${PROM}" \ -n "${RELEASE_NAMESPACE}" \ --type merge \ -p "{ \"spec\": { - \"externalUrl\": \"http://${NODE_IP}:{{ $ingressNginx.controller.service.nodePorts.http }}/prometheus\" + \"externalUrl\": \"${EXTERNAL_URL}\" } }" - + diff --git a/charts/hypo/templates/peering-api/ingress.yaml b/charts/hypo/templates/peering-api/ingress.yaml index 083493163750769c40d2329ac8fada0129b29960..84e2e70f5d107f0168eac512c9bdbc964a8a7bdb 100644 --- a/charts/hypo/templates/peering-api/ingress.yaml +++ b/charts/hypo/templates/peering-api/ingress.yaml @@ -1,6 +1,6 @@ {{ $ingressNginx := index .Values "ingress-nginx" }} {{ $peeringApi := index .Values "peering-api" }} -{{- if $peeringApi.enabled -}} +{{- if and $peeringApi.enabled $peeringApi.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/hypo/templates/portal-cart/ingress.yaml b/charts/hypo/templates/portal-cart/ingress.yaml index e0aedb6b895adf207eab90683d4a0fbe930c0e30..7e9fa55e1ca4f3371b7abc9f7d28eaf31a145e4e 100644 --- a/charts/hypo/templates/portal-cart/ingress.yaml +++ b/charts/hypo/templates/portal-cart/ingress.yaml @@ -1,6 +1,6 @@ {{ $ingressNginx := index .Values "ingress-nginx" }} {{ $portalCart := index .Values "portal-cart" }} -{{- if $portalCart.enabled -}} +{{- if and $portalCart.enabled $portalCart.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/hypo/templates/portal/ingress.yaml b/charts/hypo/templates/portal/ingress.yaml index e90712e032b4936bbec53dac00b2bdeeb6c1cab0..a6a468332f4d3a5b7320527b1d157332137d339d 100644 --- a/charts/hypo/templates/portal/ingress.yaml +++ b/charts/hypo/templates/portal/ingress.yaml @@ -1,5 +1,5 @@ {{ $ingressNginx := index .Values "ingress-nginx" }} -{{- if .Values.portal.enabled -}} +{{- if and .Values.portal.enabled .Values.portal.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/hypo/templates/prometheus/ingress.yaml b/charts/hypo/templates/prometheus/ingress.yaml index 94fe1d8c5875f10754be032628c971c80ff10baf..0bd300b820cba3ba768686440839a655124d7269 100644 --- a/charts/hypo/templates/prometheus/ingress.yaml +++ b/charts/hypo/templates/prometheus/ingress.yaml @@ -1,6 +1,6 @@ {{ $ingressNginx := index .Values "ingress-nginx" }} {{ $kubePrometheusStack := index .Values "kube-prometheus-stack" }} -{{- if $kubePrometheusStack.setup -}} +{{- if and $kubePrometheusStack.setup $kubePrometheusStack.prometheus.ingress.setup -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/hypo/templates/registry-api/ingress.yaml b/charts/hypo/templates/registry-api/ingress.yaml new file mode 100644 index 0000000000000000000000000000000000000000..59543333b6911a3f2963ebac0d297ae6e4f92d70 --- /dev/null +++ b/charts/hypo/templates/registry-api/ingress.yaml @@ -0,0 +1,26 @@ +{{ $ingressNginx := index .Values "ingress-nginx" }} +{{ $registryApi := index .Values "registry-api" }} +{{- if and $registryApi.enabled $registryApi.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ template "hypo.registry-api.fullname" . }} + namespace: {{ .Release.Namespace }} + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" +spec: + ingressClassName: {{ $ingressNginx.controller.ingressClass }} + rules: + - http: + paths: + - path: /registry-api + pathType: Prefix + backend: + service: + name: {{ template "hypo.registry-api.fullname" . }} + port: + number: {{ $registryApi.service.port }} + {{ if eq .Values.installation "prod" }} + host: hyper-orchestrator.eu + {{- end }} +{{- end -}} diff --git a/charts/hypo/templates/tmf-api/ingress.yaml b/charts/hypo/templates/tmf-api/ingress.yaml index f78a716464fdfa010ae8359fb65bb9e424788990..c2c1a02f9f280473b7131d78afcb6d5069b7a75e 100644 --- a/charts/hypo/templates/tmf-api/ingress.yaml +++ b/charts/hypo/templates/tmf-api/ingress.yaml @@ -1,6 +1,6 @@ {{ $ingressNginx := index .Values "ingress-nginx" }} {{ $tmfApi := index .Values "tmf-api" }} -{{- if $tmfApi.enabled -}} +{{- if and $tmfApi.enabled $tmfApi.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/hypo/values.yaml b/charts/hypo/values.yaml index 08d5ab831205db167db85802026875f1968bc85a..b807823c6b891a80b46d76cc3e50db3a587ae1a2 100644 --- a/charts/hypo/values.yaml +++ b/charts/hypo/values.yaml @@ -302,6 +302,9 @@ portal-cart: port: 8101 nodePort: 30092 + ingress: + enabled: true + securityContext: {} resources: {} @@ -447,6 +450,9 @@ registry-api: port: 8091 nodePort: 30094 + ingress: + enabled: true + securityContext: {} resources: {} @@ -769,6 +775,8 @@ kube-prometheus-stack: port: 3000 targetPort: 3000 nodePort: 30030 + ingress: + setup: true persistence: type: pvc enabled: true @@ -879,6 +887,8 @@ kube-prometheus-stack: port: 9090 targetPort: 9090 nodePort: 30090 + ingress: + setup: true prometheusSpec: externalUrl: http://__NODE_IP__:30713/prometheus routePrefix: /prometheus