gcloud ingress https redirect define through a helm chart

5/6/2020

Now that http to https redirect is implemented in gcloud I am wondering how to define this programmatically in my helm chart template that defines my ingress. See google issuetracker for the google issue.

Here is one of the tutorials on how to set this up in the console setting-up-traffic-management. This is straight forward but if it can't be scripted it is not cool. I use helm and I have set up a working ingress with google managed certificate like this:

templates/ingress-service.yaml

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: managed-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: {{ .Values.static_ip }}
    networking.gke.io/managed-certificates: {{ .Values.managed-certificates }}
spec:
  backend:
    serviceName: {{ .Values.name }}
    servicePort: {{ .Values.backend.port }}

That works nicely and I have both http and https access to my service. How do I configure a https redirect rule directly into this ingress definition?

If I simply set up another ingress with the tutorial setting-up-traffic-management, I get a 'external ip conflict' because I already have the aforementioned ingress service set up through the helm release.

-- Vess Perfanov
gcloud
google-kubernetes-engine
https
kubernetes
kubernetes-helm

1 Answer

5/7/2020

Standard ingress controller in GKE does not support http to https redirection. You can install NGINX Ingress controller instead.

There is a similar thread

-- Wilfred L.
Source: StackOverflow