From 6035bab3d934eba7be068311854c4b3755985576 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Mon, 18 Sep 2023 17:15:37 +1000 Subject: [PATCH] feat: add support for targeting node labels, taints, and affinity Signed-off-by: Lenin Mehedy --- .../templates/network-node-statefulset.yaml | 19 +++++++++++++++++++ charts/hedera-network/values.yaml | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/charts/hedera-network/templates/network-node-statefulset.yaml b/charts/hedera-network/templates/network-node-statefulset.yaml index 2f9491197..2da48ddf0 100644 --- a/charts/hedera-network/templates/network-node-statefulset.yaml +++ b/charts/hedera-network/templates/network-node-statefulset.yaml @@ -16,6 +16,13 @@ metadata: name: network-{{ $node.name }} labels: app: network-{{ $node.name }} + {{- if $.Values.deployment.podLabels }} + {{- $.Values.deployment.podLabels | toYaml | nindent 4 }} + {{- end }} + {{- if $.Values.deployment.podAnnotations }} + annotations: + {{- $.Values.deployment.podAnnotations | toYaml | nindent 4 }} + {{- end }} spec: replicas: 1 serviceName: "network-{{ $node.name }}" @@ -29,6 +36,18 @@ spec: fullstack.hedera.com/type: network-node fullstack.hedera.com/node-name: {{ $node.name }} spec: + {{- if $.Values.deployment.nodeSelectors }} + nodeSelector: + {{- $.Values.deployment.nodeSelectors | toYaml | nindent 8 }} + {{- end }} + {{- if $.Values.deployment.tolerations }} + tolerations: + {{- $.Values.deployment.tolerations | toYaml | nindent 8 }} + {{- end }} + {{- if $.Values.deployment.affinity }} + affinity: + {{- $.Values.deployment.affinity | toYaml | nindent 8 }} + {{- end }} terminationGracePeriodSeconds: {{ $.Values.terminationGracePeriodSeconds }} volumes: - name: hgcapp-storage # change me diff --git a/charts/hedera-network/values.yaml b/charts/hedera-network/values.yaml index 489ed4913..a05052f5f 100644 --- a/charts/hedera-network/values.yaml +++ b/charts/hedera-network/values.yaml @@ -268,6 +268,24 @@ hedera-explorer: } ] +deployment: + podAnnotations: {} + podLabels: {} + nodeSelectors: {} + tolerations: + - key: "fullstack-scheduling.io/os" + operator: "Equal" + value: "linux" + effect: "NoSchedule" + - key: "fullstack-scheduling.io/role" + operator: "Equal" + value: "network" + effect: "NoSchedule" + # Specify pod affinity + # Use complete affinity spec starting with key "nodeAffinity:" + # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity + affinity: {} + # hedera node configuration # Only the name of the node is required. The rest of the configuration will be inherited from `defaults` section hedera: