Skip to content

Instantly share code, notes, and snippets.

@onpaws
Created May 12, 2019 13:59
Show Gist options
  • Save onpaws/9db6215593e2083849c7a19b0323e684 to your computer and use it in GitHub Desktop.
Save onpaws/9db6215593e2083849c7a19b0323e684 to your computer and use it in GitHub Desktop.
Fixed manifests for parity 2.5.0
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: default
name: pv-default-100g-disk01
annotations:
volume.beta.kubernetes.io/storage-class: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
---
apiVersion: v1
kind: Service
metadata:
name: parity-service
namespace: default
spec:
selector:
app: parity
ports:
- name: eth-net
port: 30303
protocol: TCP
---
apiVersion: v1
kind: ConfigMap
metadata:
name: parity-config
namespace: default
data:
parity.toml: |
[parity]
mode = "dark"
base_path = "/data"
[footprint]
db_compaction = "hdd"
pruning_memory = 128
tracing = "off"
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: parity
namespace: default
labels:
app: parity
spec:
replicas: 1
selector:
matchLabels:
app: parity
template:
metadata:
labels:
app: parity
name: parity
spec:
terminationGracePeriodSeconds: 20
securityContext:
runAsUser: 1000
fsGroup: 1000
containers:
- image: parity/parity:v2.5.0
name: parity
imagePullPolicy: IfNotPresent
args: ["--config=/config/parity.toml"]
volumeMounts:
- name: parity-config
mountPath: /config
- name: pv
mountPath: /data
volumes:
- name: parity-config
configMap:
name: parity-config
- name: pv
persistentVolumeClaim:
claimName: pv-default-100g-disk01
@ArseniiPetrovich
Copy link

Well, we are running a set of our own Parity nodes for a long time, so we are a bit "experienced" about all the Parity problems. And now we are thinking if that would be handy to migrate Parity to K8s.
Also we do have a pretty simple custom serverless script that do copy the Blockchain state and makes a snapshot from it in AWS. The thing I don't know is how to tell Kubernetes to not to bring up node's disk from scratch while creating a new pod, but to copy it from snapshot. Any tips here, maybe?

Thanks, Arsenii

@onpaws
Copy link
Author

onpaws commented Oct 15, 2019

Make sure you're on v1.13 or later so you get CSI GA release. Then you can check out volume snapshots.

NB: I haven't personally tried this with Parity myself

@ArseniiPetrovich
Copy link

Thanks, @onpaws, will check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment