Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions charts/prom-label-proxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}

{{/*
On the ACE hub, service-gateway runs in its own tenant namespace and its cert is synced into
this namespace by config-syncer, so fall back to the default GatewayClass when none matches the namespace.
*/}}
{{- define "prom-label-proxy.gatewayClass" -}}
{{- $ns := include "prom-label-proxy.namespace" . -}}
{{- $gc := $ns -}}
{{- if not (lookup "gateway.networking.k8s.io/v1" "GatewayClass" "" $ns) -}}
{{- range (dig "items" list (lookup "gateway.networking.k8s.io/v1" "GatewayClass" "" "")) -}}
{{- if eq (dig "metadata" "annotations" "catalog.appscode.com/is-default-gatewayclass" "" .) "true" -}}
{{- $gc = .metadata.name -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $gc -}}
{{- end -}}

{{/*
The image to use for kubeRBACProxy
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/prom-label-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ spec:
- name: proxy-tls
secret:
defaultMode: 420
secretName: {{ template "prom-label-proxy.namespace" . }}-gw-cert
secretName: {{ include "prom-label-proxy.gatewayClass" . }}-gw-cert
{{- if and .Values.kubeRBACProxy.enabled .Values.kubeRBACProxy.config }}
- name: kube-rbac-proxy-config
configMap:
Expand Down
6 changes: 3 additions & 3 deletions charts/prom-label-proxy/templates/gw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: {{ include "prom-label-proxy.name" . }}-gw
namespace: {{ template "prom-label-proxy.namespace" . }}
spec:
gatewayClassName: {{ template "prom-label-proxy.namespace" . }}
gatewayClassName: {{ include "prom-label-proxy.gatewayClass" . }}
listeners:
- name: https
port: 443
Expand All @@ -13,7 +13,7 @@ spec:
mode: Terminate
certificateRefs:
- kind: Secret
name: {{ template "prom-label-proxy.namespace" . }}-gw-cert
name: {{ include "prom-label-proxy.gatewayClass" . }}-gw-cert
namespace: {{ template "prom-label-proxy.namespace" . }}
- name: mtls
port: 10001
Expand Down Expand Up @@ -61,7 +61,7 @@ spec:
caCertificateRefs:
- group: ""
kind: Secret
name: {{ template "prom-label-proxy.namespace" . }}-gw-cert
name: {{ include "prom-label-proxy.gatewayClass" . }}-gw-cert
hostname: {{ include "prom-label-proxy.name" . }}.{{ template "prom-label-proxy.namespace" . }}.svc.cluster.local

---
Expand Down
Loading