OT-CONTAINER-KIT / helm-charts

A repository which that will contain helm charts with best and security practices.
https://ot-container-kit.github.io/helm-charts
49 stars 84 forks source link

[Microservices Helm Chart] Make pods aware of availability zones (AZs) #217

Closed ashwani-opstree closed 3 months ago

ashwani-opstree commented 3 months ago

Is your feature request related to a problem? Please describe. No. This is a new feature that we need to add to Microservices helm chart.

Sometimes Kubernetes schedules pods on a single node, and during voluntary or involuntary activities, the pods of that service get rescheduled to other nodes. During this rescheduling, we experience downtime.

Describe the solution you'd like

To avoid or mitigate this issue, we need to implement pod affinity or pod topology spread constraints in the microservices Helm chart.

Describe alternatives you've considered

Additional context

Find some samples configurations

topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: "topology.kubernetes.io/zone"
        whenUnsatisfiable: "DoNotSchedule"
        labelSelector:
          matchLabels:
            app: my-app
     affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - my-service
            topologyKey: "kubernetes.io/hostname"
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: my-app-pdb
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app: my-app