Quantcast
Channel: User Recoba20 - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 17

Answer by Recoba20 for Is there a way through which I can control type of load balancer like round robin , least-connections etc using helm charts?

$
0
0

Well there are 2 possibble options.

One is to create a LoadBalancer type for each service you want to be exposed. In case you have just one service that's great. That's rarely the case of course :)

If you build your k8s cluster properly ( having Prometheus-Operator doing the monitoring for example ) most likely besides the business logic service/s, you would want to expose internal cluster valuable services like Grafana.

That's why even if you have just 1 service, for future extension of such type of need the best would be to use an Ingress resource. It providees a way to expose multiple services through a single IP address — HTTP level (network layer 7).

You could play with HTTP headers essentially and do some path/host routing.

You express the definition for your object and helm would do the installation. Another option is to use a tool like ArgoCD, basically sticking to GitOps policy.

A fundamnetal knowledge is to be aware that the Load Balancer/Ingress would forward the traffic to the service, not the pods. Services are abstracted entities by kube-proxy, by default kube-proxy uses a round-robin algorithm.

https://kubernetes.io/docs/concepts/services-networking/service/

Regarding the definition, it follows the standart K8s scheme [ apiVersion, kind, metadata, spec fields]. Example would be an Ingress created from AWS-Ingress-Controller.

apiVersion: extensions/v1beta1kind: Ingressmetadata:  name: ingress  namespace: management  annotations:    kubernetes.io/ingress.class: alb    alb.ingress.kubernetes.io/scheme: internet-facingspec:  rules:  - host: grafana.com    http:      paths:      - backend:          serviceName: grafana          servicePort: 80        path: /*

Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>