Skip to content

Commit 87f7841

Browse files
author
Tal Muskal
committed
init
1 parent 518f007 commit 87f7841

File tree

8 files changed

+405
-0
lines changed

8 files changed

+405
-0
lines changed

Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v1
2+
appVersion: "1.0"
3+
description: A Helm chart for eosio node
4+
name: eosnode
5+
version: 0.1.0

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Deploying a full EOS Node
2+
3+
## Getting started
4+
### AWS
5+
https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html
6+
7+
### GCP
8+
https://cloud.google.com/kubernetes-engine/docs/quickstart
9+
10+
## Deployment using helm
11+
### Install helm
12+
13+
Download client from: https://docs.helm.sh/using_helm/#installing-helm
14+
#### Ubuntu
15+
```
16+
sudo snap install helm --classic
17+
```
18+
19+
Run:
20+
```
21+
helm init
22+
helm update repo
23+
24+
kubectl create serviceaccount --namespace kube-system tiller
25+
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
26+
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
27+
28+
```
29+
### Setup dashboard
30+
```
31+
helm install stable/kubernetes-dashboard
32+
```
33+
### Install DAPP-DSP helm chart
34+
```
35+
wget https://.../charts/eosnode-config.yaml
36+
helm dependency update
37+
helm install -f eosnode-config.yaml https://.../charts/eosnode.tgz
38+
39+
40+
```
41+

templates/NOTES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
1. Get the application URL by running these commands:
2+
3+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
4+
You can watch the status of by running 'kubectl get svc -w {{ include "eosnode.nodeosfullname" . }}'
5+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "eosnode.nodeosfullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
6+
echo http://$SERVICE_IP:{{ .Values.service.port }}

templates/_helpers.tpl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "eosnode.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
10+
{{- define "eosnode.fullname" -}}
11+
{{- $name := include "eosnode.name" . -}}
12+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
13+
{{- end -}}
14+
15+
{{- define "eosnode.headlessname" -}}
16+
{{- printf "%s-headless" .Release.Name | trunc 63 | trimSuffix "-" -}}
17+
{{- end -}}
18+
19+
{{- define "eosnode.nodeosfullname" -}}
20+
{{- printf "%s-nodeos" .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- end -}}
22+
23+
24+
{{/*
25+
Create chart name and version as used by the chart label.
26+
*/}}
27+
{{- define "eosnode.chart" -}}
28+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
29+
{{- end -}}
30+
31+
{{- define "eosnode.nodeargs" -}}
32+
{{- join " " .Values.args }}
33+
{{- end -}}
34+
35+
{{- define "eosnode.morenodeargs" -}}
36+
{{- join " " .Values.moreargs }}
37+
{{- end -}}

templates/configmap.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "eosnode.fullname" . }}
5+
labels:
6+
app: {{ include "eosnode.name" . }}
7+
chart: {{ include "eosnode.chart" . }}
8+
release: {{ .Release.Name }}
9+
heritage: {{ .Release.Service }}
10+
data:
11+
test: dummy

templates/service.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "eosnode.nodeosfullname" . }}
5+
labels:
6+
app: {{ include "eosnode.name" . }}
7+
chart: {{ include "eosnode.chart" . }}
8+
release: {{ .Release.Name }}
9+
heritage: {{ .Release.Service }}
10+
spec:
11+
type: {{ .Values.service.type }}
12+
{{- if eq .Values.service.type "LoadBalancer" }}
13+
loadBalancerSourceRanges:
14+
{{- range $index, $cidr := .Values.service.loadBalancerSourceRanges | split "," }}
15+
- {{ $cidr }}
16+
{{- end }}
17+
{{- end }}
18+
ports:
19+
- port: {{ .Values.service.port }}
20+
targetPort: 8888
21+
protocol: TCP
22+
name: api
23+
- port: {{ .Values.service.qport }}
24+
targetPort: 5556
25+
protocol: TCP
26+
name: queue
27+
- port: {{ .Values.service.pport }}
28+
targetPort: 9876
29+
protocol: TCP
30+
name: p2p
31+
selector:
32+
app: nodeos
33+
release: {{ .Release.Name }}

templates/statefulset.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: {{ include "eosnode.nodeosfullname" . }}
5+
labels:
6+
app: {{ include "eosnode.name" . }}
7+
chart: {{ include "eosnode.chart" . }}
8+
release: {{ .Release.Name }}
9+
heritage: {{ .Release.Service }}
10+
spec:
11+
replicas: {{ .Values.replicaCount }}
12+
selector:
13+
matchLabels:
14+
app: nodeos
15+
release: {{ .Release.Name }}
16+
serviceName: {{ include "eosnode.headlessname" . }}
17+
template:
18+
metadata:
19+
labels:
20+
app: nodeos
21+
release: {{ .Release.Name }}
22+
spec:
23+
terminationGracePeriodSeconds: 10
24+
initContainers:
25+
- name: init-data
26+
image: liquidapps/eosio-mainnet-loader
27+
imagePullPolicy: {{ .Values.image.pullPolicy }}
28+
env:
29+
- name: CLEAR_DB
30+
value: "{{ .Values.clear }}"
31+
- name: DOWNLOAD_NEW
32+
value: "{{ .Values.download }}"
33+
volumeMounts:
34+
- name: data
35+
mountPath: /eos.data
36+
- name: link-latest
37+
volumeMounts:
38+
- name: data
39+
mountPath: /eos.data
40+
image: ubuntu
41+
imagePullPolicy: {{ .Values.image.pullPolicy }}
42+
command:
43+
- bash
44+
- -ec
45+
- ln -sf `ls /eos.data/snapshots/snapshot-* | head -n 1` /eos.data/snapshots/latest
46+
containers:
47+
- name: {{ .Chart.Name }}
48+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
49+
imagePullPolicy: {{ .Values.image.pullPolicy }}
50+
command:
51+
- bash
52+
- -ec
53+
- nodeos {{- if .Values.snapshot }} --snapshot=/eos.data/snapshots/latest {{- end }} {{ include "eosnode.nodeargs" . }} {{ include "eosnode.morenodeargs" . }}
54+
ports:
55+
- containerPort: 8888
56+
protocol: TCP
57+
- containerPort: 9876
58+
protocol: TCP
59+
readinessProbe:
60+
httpGet:
61+
path: /v1/chain/get_info
62+
port: 8888
63+
resources:
64+
{{ toYaml .Values.resources | indent 12 }}
65+
volumeMounts:
66+
- name: data
67+
mountPath: /eos.data
68+
volumes:
69+
- name: config-volume
70+
configMap:
71+
name: {{ include "eosnode.fullname" . }}
72+
volumeClaimTemplates:
73+
- metadata:
74+
name: data
75+
labels:
76+
app: {{ include "eosnode.name" . }}
77+
chart: {{ include "eosnode.chart" . }}
78+
release: {{ .Release.Name }}
79+
heritage: {{ .Release.Service }}
80+
spec:
81+
accessModes: [ "ReadWriteOnce" ]
82+
resources:
83+
requests:
84+
storage: {{ .Values.persistence.size | quote }}
85+
{{- if .Values.persistence.storageClass }}
86+
{{- if (eq "-" .Values.persistence.storageClass) }}
87+
storageClassName: ""
88+
{{- else }}
89+
storageClassName: "{{ .Values.persistence.storageClass }}"
90+
{{- end }}
91+
{{- end }}

0 commit comments

Comments
 (0)