Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chart] AWS Load Balancer Controller ssl redirect using annotation #28

Open
pshanoop opened this issue Dec 11, 2020 · 1 comment
Open

Comments

@pshanoop
Copy link

Is your feature request related to a problem? Please describe.
With current chart, It is not possible to setup ssl-redirect for aws loadbalancer controller ingress.

Describe the solution you'd like
Adding a extraPath map value to each hosts. Where serverName and servicePort can be defined will resolve this issue.
Values will look like

ingress:
  enabled: true
  annotations:
    alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
    alb.ingress.kubernetes.io/certificate-arn: ACM ARN
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: instance
    kubernetes.io/ingress.class: alb
  # Provide an array of values for the ingress host mapping
  hosts:
    - athens-proxy.host
  extraPaths:
    # This will be added to each hosts
    - service: ssl-redirect
      port: use-annotation
      path: /*

ingress template will then

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    alb.ingress.kubernetes.io/healthcheck-path: /healthz
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/tags: Service=athens-proxy,Environment=k-production
    alb.ingress.kubernetes.io/target-type: instance
    kubernetes.io/ingress.class: alb
  name: athens-proxy
  namespace: devops
spec:
  rules:
  - host: athens-proxy.legalone.io
    http:
      paths:
      - backend:
          serviceName: ssl-redirect
          servicePort: use-annotation
        path: /*
      - backend:
          serviceName: athens-proxy
          servicePort: 80
        path: /

This is a method suggest by aws loadbalancer documentation

@pshanoop
Copy link
Author

I noticed I missed the detail about the default path.
On nginx / will match all paths, But on ALB it uses glob match, so it needs /* to match all paths.

To solve this I added customPath on my PR.

@DrPsychick DrPsychick transferred this issue from gomods/athens Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant