1Password / connect-helm-charts

Official 1Password Helm Charts
https://developer.1password.com
MIT License
93 stars 74 forks source link

Please add support for (anti)affinity for all deployments, etc #133

Closed lhriley closed 2 months ago

lhriley commented 1 year ago

Summary

Please include the option to define pod placement using affinity: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

Use cases

We have specific node pools dedicated to different resource requirements, and we place our pods using node / pod affinity. This is much more flexible than using nodeSelector for our purposes.

Proposed solution

Change these (and any I missed):

https://github.com/1Password/connect-helm-charts/blob/54faa0ccffa9a09bc87b7e2ac8ba6904ec47a28f/charts/connect/templates/operator-deployment.yaml#L35-L40

https://github.com/1Password/connect-helm-charts/blob/54faa0ccffa9a09bc87b7e2ac8ba6904ec47a28f/charts/connect/templates/connect-deployment.yaml#L35-L38

to:

      {{- with .Values.<deployment>.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.<deployment>.affinity }}
      affinity:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.<deployment>.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
      {{- end }}

Is there a workaround to accomplish this today?

n/a

References & Prior Work

jillianwilson commented 1 year ago

Hi there, I logged this internally to implement this. However, I can't give a timeline for when this can be completed. Please feel free to make a PR for this if you wish :)