Create an nginx load balancer without using gcp load balancer

0 votes
I've been using GCP load balancer but its getting expensive now, my expenditure has increased majorly. I thought of using it without cloud, how do i do this?
Sep 28, 2018 in Kubernetes by Hannah
• 18,540 points
686 views

1 answer to this question.

0 votes

Yes this is possible. Deploy your ingress controller, and deploy it with a NodePort service. Example:

---
apiVersion: v1
kind: Service
metadata:
  name: nginx-ingress-controller
  namespace: kube-system
  labels:
    k8s-app: nginx-ingress-controller
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
    nodePort: 32080
    protocol: TCP
    name: http
  - port: 443
    targetPort: 443
    nodePort: 32443
    protocol: TCP
    name: https
  selector:
    k8s-app: nginx-ingress-controller

Now, create an ingress with a DNS entry:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
spec:
  rules:
  - host: myapp.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: my-app-service 
          servicePort: 80
answered Sep 28, 2018 by Kalgi
• 52,360 points

Related Questions In Kubernetes

0 votes
2 answers

Using a local image to create a pod in K8s

I'm not sure but you can try ...READ MORE

answered Apr 29, 2019 in Kubernetes by Vishaka
19,602 views
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

Nginx routing for kubernetes services

Hey, backend is a service running on ...READ MORE

answered Feb 8, 2019 in Kubernetes by Kalgi
• 52,360 points
1,531 views
0 votes
1 answer

Kubernetes nginx-ingress TLS issue

You have to create a secret named test-secret. ➜ ...READ MORE

answered Sep 11, 2018 in Kubernetes by Kalgi
• 52,360 points
1,925 views
0 votes
1 answer

Is it possible to access GCP resources using api without a user interaction.?

yes that's totally possible. You'd have to create ...READ MORE

answered Sep 19, 2018 in Kubernetes by Kalgi
• 52,360 points
630 views
+1 vote
1 answer

kubernetes ingress controller and resource using nginx

Ingress is just collection of rules that forwards ...READ MORE

answered Sep 12, 2018 in Kubernetes by Kalgi
• 52,360 points
1,727 views
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