devtron
devtron copied to clipboard
added new charts having functionality of pod-affinity and pod-antiaffinity in deployment, rollout and sts charts.
Description
This PR introduces the ability to apply Pod Affinity and Anti-Affinity rules to our Kubernetes deployments, enhancing the scheduling flexibility and resilience of our applications. The changes include:
Features
Pod Affinity and Anti-Affinity Functionality:
Added support for both Pod Affinity and Anti-Affinity in the deployment rollout and StatefulSet (STS) Helm charts. Users can now define affinity rules based on multiple key values, providing more granular control over pod placement.
Helm Chart Modifications:
Updated the deployment rollout and StatefulSet Helm charts to include configurations for pod affinity and anti-affinity. Ensured backward compatibility so that existing deployments without affinity configurations remain unaffected. Values.yaml Changes:
Introduced new fields in values.yaml to allow users to specify affinity and anti-affinity rules. Documented examples in values.yaml to guide users on how to leverage these new features effectively.
Spec:
Affinity:
NodeAffinity:
Key: null
Values: ["instancegroup1" ]
PodAffinity:
Key: null
Values: [ "my-app" ]
PodAntiAffinity:
Key: null
Values: [ "my-app" ]
Benefits:
Improved Scheduling:
Allows for more flexible and efficient pod scheduling, improving resource utilization and application performance.
Enhanced Resilience:
Ensures better fault tolerance by enabling rules that spread pods across different nodes or zones.
Greater Control:
Provides users with the ability to define complex affinity and anti-affinity rules, tailoring pod placement to specific needs and requirements.
Testing and Validation:
Thoroughly tested the new functionality with various configurations to ensure stability and correctness. Validated that the changes do not impact existing deployments without affinity rules.