|
| 1 | +--- |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: StatefulSet |
| 4 | +metadata: |
| 5 | + labels: |
| 6 | + {{- include "handshake-node.labels" . | nindent 4 }} |
| 7 | + name: {{ include "handshake-node.network-fullname" . }} |
| 8 | +spec: |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | + selector: |
| 11 | + matchLabels: |
| 12 | + handshake_network: {{ include "handshake-node.network" . }} |
| 13 | + app.kubernetes.io/name: {{ include "handshake-node.name" . }} |
| 14 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 15 | + serviceName: {{ include "handshake-node.network-fullname" . }} |
| 16 | + template: |
| 17 | + metadata: |
| 18 | + annotations: |
| 19 | + cluster-autoscaler.kubernetes.io/safe-to-evict: "false" |
| 20 | + kubectl.kubernetes.io/default-container: handshake-node |
| 21 | + labels: |
| 22 | + handshake_network: {{ include "handshake-node.network" . }} |
| 23 | + app.kubernetes.io/name: {{ include "handshake-node.name" . }} |
| 24 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 25 | + {{- include "handshake-node.labels" . | nindent 8 }} |
| 26 | + spec: |
| 27 | + {{- with .Values.affinity }} |
| 28 | + affinity: {{ toYaml . | nindent 8 }} |
| 29 | + {{- end }} |
| 30 | + {{- with .Values.nodeSelector }} |
| 31 | + nodeSelector: {{ toYaml . | nindent 8 }} |
| 32 | + {{- end }} |
| 33 | + {{- with .Values.tolerations }} |
| 34 | + tolerations: {{ toYaml . | nindent 8 }} |
| 35 | + {{- end }} |
| 36 | + securityContext: |
| 37 | + fsGroup: 1000 |
| 38 | + containers: |
| 39 | + - name: handshake-node |
| 40 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" |
| 41 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 42 | + args: |
| 43 | + - --network={{ include "handshake-node.network" . }} |
| 44 | + - --listen={{ .Values.nodeConfig.listen }} |
| 45 | + - --max-inbound={{ .Values.nodeConfig.maxInbound }} |
| 46 | + - --max-outbound={{ .Values.nodeConfig.maxOutbound }} |
| 47 | + - --http-host={{ .Values.nodeConfig.httpHost }} |
| 48 | + - --http-port={{ include "handshake-node.http-port" . }} |
| 49 | + {{- if .Values.nodeConfig.api.secretName }} |
| 50 | + - --api-key=$(HSD_API_KEY) |
| 51 | + {{- end }} |
| 52 | + {{- if .Values.nodeConfig.publicHost }} |
| 53 | + - --public-host={{ .Values.nodeConfig.publicHost }} |
| 54 | + {{- end }} |
| 55 | + - --brontide-port={{ include "handshake-node.brontide-port" . }} |
| 56 | + - --prune={{ .Values.nodeConfig.prune }} |
| 57 | + - --index-tx={{ .Values.nodeConfig.indexTx }} |
| 58 | + - --index-address={{ .Values.nodeConfig.indexAddress }} |
| 59 | + - --checkpoints={{ .Values.nodeConfig.checkpoints }} |
| 60 | + - --log-level={{ .Values.nodeConfig.logLevel }} |
| 61 | + - --cors={{ .Values.nodeConfig.cors }} |
| 62 | + {{- if .Values.nodeConfig.ssl }} |
| 63 | + - --ssl=true |
| 64 | + - --ssl-cert={{ .Values.nodeConfig.sslCert }} |
| 65 | + - --ssl-key={{ .Values.nodeConfig.sslKey }} |
| 66 | + {{- end }} |
| 67 | + - --ns-host={{ .Values.nodeConfig.nsHost }} |
| 68 | + - --ns-port={{ include "handshake-node.ns-port" . }} |
| 69 | + - --rs-host={{ .Values.nodeConfig.rsHost }} |
| 70 | + - --rs-port={{ include "handshake-node.rs-port" . }} |
| 71 | + - --rs-no-unbound={{ .Values.nodeConfig.rsNoUnbound }} |
| 72 | + env: |
| 73 | + {{- if .Values.nodeConfig.api.secretName }} |
| 74 | + - name: HSD_API_KEY |
| 75 | + valueFrom: |
| 76 | + secretKeyRef: |
| 77 | + name: {{ .Values.nodeConfig.api.secretName }} |
| 78 | + key: {{ .Values.nodeConfig.api.secretKey }} |
| 79 | + {{ end }} |
| 80 | + - name: HSD_NETWORK |
| 81 | + value: "{{ include "handshake-node.network" . }}" |
| 82 | + - name: HSD_PREFIX |
| 83 | + value: "/data" |
| 84 | + ports: |
| 85 | + - name: p2p |
| 86 | + containerPort: {{ include "handshake-node.p2p-port" . }} |
| 87 | + protocol: TCP |
| 88 | + - name: brontide |
| 89 | + containerPort: {{ include "handshake-node.brontide-port" . }} |
| 90 | + protocol: TCP |
| 91 | + - name: http |
| 92 | + containerPort: {{ include "handshake-node.http-port" . }} |
| 93 | + protocol: TCP |
| 94 | + - name: ns |
| 95 | + containerPort: {{ include "handshake-node.ns-port" . }} |
| 96 | + protocol: UDP |
| 97 | + - name: rs |
| 98 | + containerPort: {{ include "handshake-node.rs-port" . }} |
| 99 | + protocol: UDP |
| 100 | + resources: |
| 101 | + {{- $network := include "handshake-node.network" . }} |
| 102 | + {{- if .Values.resources }} |
| 103 | + {{- toYaml .Values.resources | nindent 12 }} |
| 104 | + {{- else }} |
| 105 | + {{- toYaml (index .Values.networkResources $network) | nindent 12 }} |
| 106 | + {{- end }} |
| 107 | + volumeMounts: |
| 108 | + - name: handshake-data-{{ include "handshake-node.network" . }} |
| 109 | + mountPath: /data |
| 110 | + updateStrategy: |
| 111 | + type: OnDelete |
| 112 | + volumeClaimTemplates: |
| 113 | + - metadata: |
| 114 | + labels: |
| 115 | + handshake_network: {{ include "handshake-node.network" . }} |
| 116 | + name: handshake-data-{{ include "handshake-node.network" . }} |
| 117 | + spec: |
| 118 | + accessModes: |
| 119 | + - ReadWriteOnce |
| 120 | + {{- if .Values.storage.storageClassName }} |
| 121 | + storageClassName: {{ .Values.storage.storageClassName }} |
| 122 | + {{- end }} |
| 123 | + resources: |
| 124 | + requests: |
| 125 | + storage: {{ include "handshake-node.storage-size" . }} |
0 commit comments