Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add affinity and tolerations to ASOv2 helm chart #3765

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

super-harsh
Copy link
Collaborator

Closes #3646

What this PR does / why we need it:

This PR adds changes to the helm chart generation script to add Affinity and Tolerations to ASOv2 helm chart. Also updates values.yaml to specify the above.

Copy link
Member

@matthchr matthchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but consider using the slightly more robust but also moderately more horrible perl line above, to capture spaces.

@@ -49,6 +49,10 @@ sed -i "s@$LOCAL_REGISTRY_CONTROLLER_DOCKER_IMAGE@{{.Values.image.repository}}@g
# Perl multiline replacements - using this because it's tricky to do these sorts of multiline replacements with sed
perl -0777 -i -pe 's/(template:\n.*metadata:\n.*annotations:\n(\s*))/$1\{\{- if .Values.podAnnotations \}\}\n$2\{\{ toYaml .Values.podAnnotations \}\}\n$2\{\{- end \}\}\n$2/igs' "$GEN_FILES_DIR"/*_deployment_* # Add pod annotations

# Affinity and Toleration
sed -i '/ spec:/a\ {{- with .Values.affinity }}\n affinity:\n {{- toYaml . | nindent 8 }}\n {{- end }}' "$GEN_FILES_DIR"/*_deployment_*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might wanna steal the (horrible) perl line above as it captures spaces and so deals with variable indentation?

I assume that you've tested and this works have we have it today... we really should probably fix how we generate the Helm template (might be better to just duplicate stuff, I dunno)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with either. Perl looks a bit messy. But good point, it takes care of the spaces.

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (73c1660) 53.54% compared to head (ad32801) 53.49%.
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3765      +/-   ##
==========================================
- Coverage   53.54%   53.49%   -0.05%     
==========================================
  Files        1417     1419       +2     
  Lines      484060   483386     -674     
==========================================
- Hits       259177   258603     -574     
+ Misses     185651   185629      -22     
+ Partials    39232    39154      -78     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matthchr matthchr added this pull request to the merge queue Feb 8, 2024
Merged via the queue into main with commit 314960b Feb 8, 2024
8 checks passed
@matthchr matthchr deleted the feature/affinity-tolerations branch February 8, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

ASO helm chart should allow specifying affinity and tolerations for pod deployments.
3 participants