charts icon indicating copy to clipboard operation
charts copied to clipboard

Add nodeSelector and tolerations to cluster chart for storage nodes

Open Jamison1 opened this issue 1 year ago • 0 comments

When deploying to an automated k8s cluster with separate storage nodes, the pg cluster needs to utilize either nodeAffinity or nodeSelector to ensure placement on storage nodes. NodeSelector is preferred.

Additionally, for the taints on the storage nodes the cluster needs tolerations with key, operator, value & effect fields.

Example for values.yaml file:

# -- Nodeselector for the cluster to be installed.
nodeSelector:
  node-role.kubernetes.io/storage: storage

# -- Tolerations for the cluster to be installed.
tolerations:
  - key: "storage"
    operator: "Equal"
    value: "true"
    effect: "NoSchedule"

This could be added to the cluster chart values file before the affinity rules to keep uniformity with the operator chart values file.

It would also need to be added to the cluster.yaml file before affinity

Example for templates cluster.yaml file:

{{- with .Values.cluster.nodeSelector }}
  nodeSelector:
    {{- toYaml . | nindent 4 }}
  {{- end }}
{{- with .Values.cluster.tolerations }}
  tolerations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
{{- with .Values.cluster.affinity }} # Add before affinity
  affinity:
    {{- toYaml . | nindent 4 }}
  {{- end }}

Jamison1 avatar Feb 18 '24 15:02 Jamison1