-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdeployment.yaml
215 lines (177 loc) · 6.62 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "provider.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ include "provider.fullname" . }}
{{- include "provider.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
app: {{ include "provider.fullname" . }}
{{- include "provider.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/cm-boot: {{ include (print $.Template.BasePath "/configmap-boot.yaml") . | sha256sum }}
checksum/cm-bidscripts: {{ include (print $.Template.BasePath "/configmap-bidscripts.yaml") . | sha256sum }}
labels:
app: {{ include "provider.fullname" . }}
{{- include "provider.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "provider.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["/bin/bash", "/boot/run.sh"]
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: AKASH_DEBUG
value: "{{ $.Values.debug }}"
##
# boot config
##
# location of key export. must contain two files:
#
# key.txt: exported wallet key
# key-pass.txt: password used to encrypt exported key
- name: AKASH_BOOT_KEYS
value: "/boot-keys"
##
# cosmos-sdk client config
##
# --home
- name: AKASH_HOME
value: "{{ .Values.home }}"
# --from
- name: AKASH_FROM
value: "{{ .Values.from }}"
# --node
- name: AKASH_NODE
value: "{{ .Values.node }}"
# --chain-id
- name: AKASH_CHAIN_ID
value: "{{ .Values.chainid }}"
# --keyring-backend
- name: AKASH_KEYRING_BACKEND
value: "{{ .Values.keyringbackend }}"
# --trust-node
- name: AKASH_TRUST_NODE
value: "{{ .Values.trustnode }}"
- name: AKASH_BROADCAST_MODE
value: "block"
- name: AKASH_VERSION
value: "{{ .Values.image.tag | default .Chart.AppVersion }}"
##
# akash-provider config
##
- name: AKASH_CLUSTER_WAIT_READY_DURATION
value: "{{ .Values.waitready }}"
- name: AKASH_DEPLOYMENT_INGRESS_DOMAIN
value: "ingress.{{ .Values.domain }}"
- name: DEPLOYMENT_NETWORK_POLICIES_ENABLED
value: "{{ .Values.deploymentnetworkpoliciesenabled }}"
- name: AKASH_YES
value: "true"
- name: AKASH_GAS_PRICES
value: "{{ .Values.gasprices }}"
- name: AKASH_GAS
value: "{{ .Values.gas }}"
- name: AKASH_GAS_ADJUSTMENT
value: "{{ .Values.gasadjustment }}"
- name: AKASH_DEPLOYMENT_INGRESS_STATIC_HOSTS
value: "true"
- name: AKASH_DEPLOYMENT_BLOCKED_HOSTNAMES
value: ""
- name: AKASH_CLUSTER_NODE_PORT_QUANTITY
value: "2500"
# This needs to stay as it gets shown upon 'akash provider lease-status` under the forwarded_ports (nodePorts).
# This is NOT used to connect to K8s cluster itself (6443/tcp).
# akash-provider uses kubeconfig to connect to K8s cluster.
- name: AKASH_CLUSTER_PUBLIC_HOSTNAME
value: "provider.{{ .Values.domain }}"
- name: AKASH_BID_PRICE_STRATEGY
value: "{{ ternary "scale" "shellScript" (empty .Values.bidpricescript) }}"
{{ if .Values.bidpricescript }}
- name: AKASH_BID_PRICE_SCRIPT_PATH
value: "/bidscripts/price_script.sh"
{{- end }}
- name: AKASH_BID_PRICE_CPU_SCALE
value: "{{ .Values.bidpricecpuscale }}"
- name: AKASH_BID_PRICE_MEMORY_SCALE
value: "{{ .Values.bidpricememoryscale }}"
- name: AKASH_BID_PRICE_ENDPOINT_SCALE
value: "{{ .Values.bidpricendpointscale }}"
- name: AKASH_BID_PRICE_STORAGE_SCALE
value: "{{ .Values.bidpricestoragescale }}"
- name: AKASH_OVERCOMMIT_PCT_CPU
value: "0"
- name: AKASH_OVERCOMMIT_PCT_MEM
value: "0"
- name: AKASH_OVERCOMMIT_PCT_STORAGE
value: "0"
- name: AKASH_LOG_LEVEL
value: "info"
- name: AKASH_CLUSTER_K8S
value: "true"
- name: KUBE_CONFIG
value: "{{ .Values.home }}/.kube/config"
- name: AKASH_DEPLOYMENT_RUNTIME_CLASS
value: "none"
- name: AKASH_WITHDRAWAL_PERIOD
value: "{{ .Values.withdrawalperiod }}"
- name: AKASH_MINIMUM_BALANCE
value: "{{ .Values.minimumbalance }}"
- name: AKASH_BID_DEPOSIT
value: "5000000uakt"
ports:
- name: api
containerPort: 8443
protocol: TCP
volumeMounts:
- name: boot
mountPath: /boot
readOnly: true
- name: bidscripts
mountPath: /bidscripts
readOnly: true
- name: keys
mountPath: /boot-keys
readOnly: true
volumes:
- name: boot
configMap:
name: {{ include "provider.fullname" . }}-boot
- name: bidscripts
configMap:
name: {{ include "provider.fullname" . }}-bidscripts
defaultMode: 0744
- name: keys
secret:
secretName: {{ include "provider.fullname" . }}-keys
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}