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
• 14,960 points
77 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
• 41,170 points

Related Questions In Kubernetes

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
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
• 41,170 points
531 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
• 41,170 points
41 views
0 votes
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
• 41,170 points
315 views