I want to set ingress object for EKS. Now it looks like:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:ap-northeast-1:0123456789:certificate/uuid
alb.ingress.kubernetes.io/group.name: eks-lb-group
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
alb.ingress.kubernetes.io/load-balancer-name: eks-lb-name
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/ssl-redirect: "443"
alb.ingress.kubernetes.io/subnets: public-A,public-C,public-D
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-path: /healthchek
kubernetes.io/ingress.class: alb
name: ingress-name
namespace: namespace-name
spec:
rules:
- host: example.com
http:
paths:
- backend:
service:
name: service-name
port:
number: 8080
path: /
pathType: Prefix
This configuration is translated into AWS ALB rules and it looks like
HTTP
(80) listener is redirecting all requests toHTTPS
(443) listener (controlled byalb.ingress.kubernetes.io/ssl-redirect: "443"
)HTTPS
(443) listener is forwarding traffic toservice-name
related target group if hostname isexample.com
.
It is mostly fine, but I don’t want to redirect HTTP
traffic to HTTPS
if hostname is example.com
. I want to forward this traffic to service-name
related target group without redirecting it to HTTPS
listener.
How to add this example.com
rule not only for HTTPS
but also for HTTP
external ALB listener?