0

Is it possible to configure SSL redirection (forcing https over http) with Google Ingress and Managed certificates in GKE ? If yes, then how ? This documentation doesn't mention it: https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs

Deepak Garg
  • 366
  • 3
  • 12

2 Answers2

2

For now there is no way to force redirection to the SSL version of sites when using the GCE ingress class. However, there are feature requests to make this possible in the future.

If you need this feature you can either, do the automatic redirection directly in the backend rather than the ingress or, you can use another ingress class, such as Nginx, with support for this feature.

Alternatively, you can disallow HTTP using an ingress annotation, leaving only HTTPS available.

yyyyahir
  • 2,262
  • 1
  • 5
  • 14
0

Under annotation section of GKE Ingress yaml, try using force-ssl-redirect

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: gke-ingress-test
  annotations:
    ingress.kubernetes.io/ingress.static-ip: gke-ingress-test-stat-ip
    networking.gke.io/managed-certificates: "domain1,domain2"
    ingress.gcp.kubernetes.io/pre-shared-cert: "domain3,domain4"
    ingress.kubernetes.io/force-ssl-redirect: "true" 
spec:
  rules:
Nikhil
  • 861
  • 11
  • 15