github.com/dominant-strategies/go-quai@v0.28.2/helm/templates/statefulset.yaml (about) 1 {{- $name := include "go-quai.name" . -}} 2 apiVersion: v1 3 kind: Service 4 metadata: 5 annotations: 6 labels: 7 app: {{ $name }} 8 name: {{ $name }} 9 namespace: {{ .Values.goQuai.env }} 10 spec: 11 ports: 12 {{- range $chain := .Values.goQuai.chains }} 13 {{ include "go-quai.clusterIP" $ | replace "<HTTP>" $chain.ports.http | replace "<WS>" $chain.ports.ws | replace "<DISC>" $chain.ports.disc | replace "prime" $chain.name | indent 2 }} 14 {{- end }} 15 selector: 16 app: {{ $name }} 17 type: ClusterIP 18 --- 19 apiVersion: apps/v1 20 kind: StatefulSet 21 metadata: 22 annotations: 23 name: {{ $name }} 24 namespace: {{ .Values.goQuai.env }} 25 spec: 26 replicas: {{ .Values.goQuai.replicas }} 27 selector: 28 matchLabels: 29 app: {{ $name }} 30 serviceName: {{ $name }} 31 template: 32 metadata: 33 labels: 34 app: {{ $name }} 35 spec: 36 tolerations: 37 - effect: NoSchedule 38 key: app 39 operator: Equal 40 value: go-quai 41 affinity: 42 nodeAffinity: 43 preferredDuringSchedulingIgnoredDuringExecution: 44 - weight: 99 45 preference: 46 matchExpressions: 47 - key: app 48 operator: In 49 values: 50 - go-quai 51 containers: 52 {{- $root := . -}} 53 {{- range $chain := .Values.goQuai.chains }} 54 {{- $minerEtherbase := ternary (printf "\"--miner.etherbase\", %s, " "$(COINBASE_ADDR)") "" (regexMatch "[0-9]$" $chain.name) }} 55 {{/*{{- $minerEtherbase := ternary "\"--miner.etherbase\", '${COINBASE_ADDR}', " "" (regexMatch "[0-9]$" $chain.name) }}*/}} 56 {{- $region := ternary (printf ", \"--region\", %s" ($chain.region | quote)) "" (ne (len (toString $chain.region)) 0)}} 57 {{- $zone := ternary (printf ", \"--zone\", %s" ($chain.zone | quote)) "" (ne (len (toString $chain.zone)) 0) }} 58 {{- $sub := ternary (printf ", \"--sub.urls\", %s" ($chain.sub | quote)) "" (ne (len (toString $chain.sub)) 0) }} 59 {{- $dom := ternary (printf ", \"--dom.url\", %s" ($chain.dom | quote)) "" (ne (len (toString $chain.dom)) 0) }} 60 {{ include "go-quai.statefulset" $ | replace "<HTTP>" $chain.ports.http | replace "<WS>" $chain.ports.ws | replace "<DISC>" $chain.ports.disc | replace "prime" $chain.name | replace "PRIME" ($chain.name | upper) | replace "<MINER_ETHERBASE>, " $minerEtherbase | replace ", <REGION>" $region | replace ", <ZONE>" $zone | replace ", <SUB>" $sub | replace ", <DOM>" $dom | indent 6 }} 61 {{- end }} 62 volumeClaimTemplates: 63 - apiVersion: v1 64 kind: PersistentVolumeClaim 65 metadata: 66 name: {{ $name }} 67 spec: 68 accessModes: 69 - ReadWriteOnce 70 resources: 71 requests: 72 storage: 2Ti 73 storageClassName: premium-rwo