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,110 points
183 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
• 42,510 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
• 6,880 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,810 points
1,161 views
0 votes
1 answer

External IP not working with Minikube Kubernetes

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

answered Jan 24 in Kubernetes by DareDev
• 6,810 points
422 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
• 42,510 points
1,648 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
• 42,510 points
76 views
0 votes
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
• 6,880 points
716 views
0 votes
1 answer