kubernetes AWS ELB not working

0 votes

I have set up a front-end service via the following svc and deployment:

Deployment

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: ui-deployment
spec:
  replicas: 1
  template:
    metadata:
      labels:
        els-pod: ui
    spec:
      containers:
      - image: pkaramol/the-ui
        name: ui
        ports:
        - containerPort: 80
      restartPolicy: Always

Service

apiVersion: v1
kind: Service
metadata:
  name: ui
spec:
  ports:
  - name: ui-port
    port: 8080
    targetPort: 80
  selector:
    els-pod: ui

When exposing via an AWS ELB as follows:

kubectl expose  deployment ui-deployment --type=LoadBalancer --port=80 --target-port=8080 --name=k8s-elb
Oct 9, 2018 in Kubernetes by lina
• 8,220 points
1,045 views

2 answers to this question.

0 votes

You need to add loalbalancer Ip and type in Service yaml

loadBalancerIP: <Public Ip>
type: LoadBalancer
answered Oct 9, 2018 by Kalgi
• 52,350 points
0 votes

Set your service to loadbalancer

apiVersion: v1
kind: Service
metadata:
  name: ui
spec:
  type: LoadBalancer
  ports:
  - name: ui-port
    port: 8080
    targetPort: 80
  selector:
    els-pod: ui
answered Oct 9, 2018 by Nilesh
• 7,060 points

Related Questions In Kubernetes

+1 vote
1 answer

--image-pull-policy not working in kubernetes

Kubernetes does not automatically update the pods ...READ MORE

answered Dec 6, 2018 in Kubernetes by DareDev
• 6,890 points
5,287 views
0 votes
1 answer

External IP not working with Minikube Kubernetes

You can use an ingress controller on ...READ MORE

answered Jan 24, 2019 in Kubernetes by DareDev
• 6,890 points
2,684 views
0 votes
1 answer

Traefik: Forward Authentication not working

Look at the 7th line of your ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 52,350 points
4,119 views
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 52,350 points
1,396 views
+1 vote
1 answer
0 votes
2 answers

Kubernetes(GKE) cronjob not working

Adding to @Kalgi's answer I think you ...READ MORE

answered Sep 19, 2018 in Kubernetes by Nilesh
• 7,060 points
2,589 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP