Skip to content

Instantly share code, notes, and snippets.

@zironycho
Created April 23, 2020 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zironycho/ff45018e3079d4aba69ebd433efa6a45 to your computer and use it in GitHub Desktop.
Save zironycho/ff45018e3079d4aba69ebd433efa6a45 to your computer and use it in GitHub Desktop.
example for http to https redirect
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/certificate-arn: "arn:aws:acm:..."
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80,"HTTPS": 443}]'
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
spec:
rules:
- host: example.com
http:
paths:
- backend:
serviceName: ssl-redirect
servicePort: use-annotation
- path: /api/*
backend:
serviceName: "my-api"
servicePort: 80
@zironycho
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment