1
votes

I am new to k8s and exploring more on production grade deployment. We have py Django app which is running in (say in 9000) node port. When I try to expose them using a k8s-service ELB, - it works by running 80 and 443 separately; where as 80 to 443 redirection is not supported in AWS classic ELB.

Then I switched to aws alb ingress controller; the problem i faced was - ALB does not works with node port and only with http and https port.

Any thoughts would be much appreciated!!

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ABC
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/target-type: instance
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/subnets: 'subnet-1, subnet-2'
    alb.ingress.kubernetes.io/security-group: sg-ABC
    alb.ingress.kubernetes.io/healthcheck-path: "/"
    alb.ingress.kubernetes.io/success-codes: "200"
  labels:
    name: ABC
spec:
  rules:
    - http:
        paths:
         - path: /
           backend:
             serviceName: ABC
             servicePort: 80 ```
1
Thanks for the reply; However this works only for the app/pods which are running in port 80; we have our app running in 9000, any thoughts how to proxy them?Jothimani
Listeners are created for every port specified as Ingress resource annotation. When no port is specified, sensible defaults (80 or 443) are used. so you can create listeners for 9000sulabh chaturvedi
I am not sure; that works. does ALB works on layer4 protocols? I have tried the same with ELB, it works. for redirection purpose i prefer ALB. Thank you for your continuous supportJothimani
added snippet from my alb ingress file. Please have look aboveJothimani

1 Answers

1
votes

Thank you @sulabh and @Fahri it works perfect now. I went through the doc again and corrected my mistake.

Issues was with route path in ALb;

Setup is like;

python-django-uwsgi app in pods and expose it as service in NodePort and use aws ingress controller for ALB;

Cheers!