diff --git a/packages/apps/harbor/templates/httproute.yaml b/packages/apps/harbor/templates/httproute.yaml index e231131d..8fed6fd7 100644 --- a/packages/apps/harbor/templates/httproute.yaml +++ b/packages/apps/harbor/templates/httproute.yaml @@ -39,6 +39,23 @@ spec: --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute +metadata: + name: {{ .Release.Name }}-harbor-redirect-to-https +spec: + parentRefs: + - name: {{ .Release.Name }}-harbor + sectionName: http + hostnames: + - {{ $harborHost | quote }} + rules: + - filters: + - type: RequestRedirect + requestRedirect: + scheme: https + statusCode: 301 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute metadata: name: {{ .Release.Name }}-harbor spec: diff --git a/packages/extra/bootbox/templates/matchbox/httproute.yaml b/packages/extra/bootbox/templates/matchbox/httproute.yaml index 759b099e..a58cf9ca 100644 --- a/packages/extra/bootbox/templates/matchbox/httproute.yaml +++ b/packages/extra/bootbox/templates/matchbox/httproute.yaml @@ -39,6 +39,23 @@ spec: --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute +metadata: + name: bootbox-redirect-to-https +spec: + parentRefs: + - name: bootbox + sectionName: http + hostnames: + - {{ $bootboxHost | quote }} + rules: + - filters: + - type: RequestRedirect + requestRedirect: + scheme: https + statusCode: 301 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute metadata: name: bootbox spec: diff --git a/packages/system/bucket/templates/httproute.yaml b/packages/system/bucket/templates/httproute.yaml index 889818cd..766d168d 100644 --- a/packages/system/bucket/templates/httproute.yaml +++ b/packages/system/bucket/templates/httproute.yaml @@ -39,6 +39,23 @@ spec: --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute +metadata: + name: {{ .Values.bucketName }}-ui-redirect-to-https +spec: + parentRefs: + - name: {{ .Values.bucketName }}-ui + sectionName: http + hostnames: + - {{ $bucketHost | quote }} + rules: + - filters: + - type: RequestRedirect + requestRedirect: + scheme: https + statusCode: 301 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute metadata: name: {{ .Values.bucketName }}-ui spec: diff --git a/packages/system/cozystack-gateway/templates/gateway.yaml b/packages/system/cozystack-gateway/templates/gateway.yaml index eba4ba9c..b37aa84e 100644 --- a/packages/system/cozystack-gateway/templates/gateway.yaml +++ b/packages/system/cozystack-gateway/templates/gateway.yaml @@ -3,11 +3,12 @@ {{- $exposeServices := splitList "," ((index .Values._cluster "expose-services") | default "") }} {{- $oidcEnabled := (index .Values._cluster "oidc-enabled") | default "false" }} {{- $hostnames := .Values._cluster.hostnames | default dict }} +{{- $gatewayName := (index .Values._cluster "gateway-name") | default "cozystack" }} --- apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: - name: cozystack + name: {{ $gatewayName }} annotations: cert-manager.io/cluster-issuer: {{ $clusterIssuer }} spec: @@ -81,3 +82,18 @@ spec: namespaces: from: All {{- end }} +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $gatewayName }}-redirect-to-https +spec: + parentRefs: + - name: {{ $gatewayName }} + sectionName: http + rules: + - filters: + - type: RequestRedirect + requestRedirect: + scheme: https + statusCode: 301 diff --git a/packages/system/keycloak/templates/httproute.yaml b/packages/system/keycloak/templates/httproute.yaml index 6831cedd..9ad41687 100644 --- a/packages/system/keycloak/templates/httproute.yaml +++ b/packages/system/keycloak/templates/httproute.yaml @@ -5,7 +5,9 @@ {{- $gatewayNamespace := (index .Values._cluster "gateway-namespace") | default "cozy-gateway" }} {{- $keycloakHost := .Values.ingress.host | default (index $hostnames "keycloak") | default (printf "keycloak.%s" $host) }} -{{- if eq $gatewayAPI "true" }} +{{- $oidcEnabled := (index .Values._cluster "oidc-enabled") | default "false" }} + +{{- if and (eq $gatewayAPI "true") (eq $oidcEnabled "true") }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: diff --git a/packages/system/kubevirt-cdi/templates/cdi-uploadproxy-tlsroute.yaml b/packages/system/kubevirt-cdi/templates/cdi-uploadproxy-tlsroute.yaml index 2c35da55..fa6694b9 100644 --- a/packages/system/kubevirt-cdi/templates/cdi-uploadproxy-tlsroute.yaml +++ b/packages/system/kubevirt-cdi/templates/cdi-uploadproxy-tlsroute.yaml @@ -10,7 +10,6 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TLSRoute metadata: name: cdi-uploadproxy - namespace: cozy-kubevirt-cdi spec: parentRefs: - name: {{ $gatewayName }} diff --git a/packages/system/kubevirt/templates/vm-exportproxy-tlsroute.yaml b/packages/system/kubevirt/templates/vm-exportproxy-tlsroute.yaml index 6c88ecdb..5146f48f 100644 --- a/packages/system/kubevirt/templates/vm-exportproxy-tlsroute.yaml +++ b/packages/system/kubevirt/templates/vm-exportproxy-tlsroute.yaml @@ -10,7 +10,6 @@ apiVersion: gateway.networking.k8s.io/v1alpha2 kind: TLSRoute metadata: name: vm-exportproxy - namespace: cozy-kubevirt spec: parentRefs: - name: {{ $gatewayName }} diff --git a/packages/system/monitoring/templates/alerta/httproute.yaml b/packages/system/monitoring/templates/alerta/httproute.yaml index 85bbd968..05c2ecb5 100644 --- a/packages/system/monitoring/templates/alerta/httproute.yaml +++ b/packages/system/monitoring/templates/alerta/httproute.yaml @@ -39,6 +39,23 @@ spec: --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute +metadata: + name: alerta-redirect-to-https +spec: + parentRefs: + - name: alerta + sectionName: http + hostnames: + - {{ $alertaHost | quote }} + rules: + - filters: + - type: RequestRedirect + requestRedirect: + scheme: https + statusCode: 301 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute metadata: name: alerta spec: diff --git a/packages/system/monitoring/templates/grafana/httproute.yaml b/packages/system/monitoring/templates/grafana/httproute.yaml index e380dcd3..88a3322e 100644 --- a/packages/system/monitoring/templates/grafana/httproute.yaml +++ b/packages/system/monitoring/templates/grafana/httproute.yaml @@ -39,6 +39,23 @@ spec: --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute +metadata: + name: grafana-redirect-to-https +spec: + parentRefs: + - name: grafana + sectionName: http + hostnames: + - {{ $grafanaHost | quote }} + rules: + - filters: + - type: RequestRedirect + requestRedirect: + scheme: https + statusCode: 301 +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute metadata: name: grafana spec: