Skip to content

Commit

Permalink
feat: add support for targeting node labels, taints, and affinity
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <[email protected]>
  • Loading branch information
leninmehedy committed Sep 18, 2023
1 parent 8a2f6e1 commit 6035bab
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
19 changes: 19 additions & 0 deletions charts/hedera-network/templates/network-node-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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
Expand Down
18 changes: 18 additions & 0 deletions charts/hedera-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6035bab

Please sign in to comment.