mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
Reorganising the repository - external renames and moves (#4074)
* Adding first rough ouline of the repository structure * Remove old CI stuff * add title * formatting fixes * move node-exits job's script to scripts dir * Move docs into subdir * move to bin * move maintainence scripts, configs and helpers into its own dir * add .local to ignore * move core->client * start up 'test' area * move test client * move test runtime * make test move compile * Add dependencies rule enforcement. * Fix indexing. * Update docs to reflect latest changes * Moving /srml->/paint * update docs * move client/sr-* -> primitives/ * clean old readme * remove old broken code in rhd * update lock * Step 1. * starting to untangle client * Fix after merge. * start splitting out client interfaces * move children and blockchain interfaces * Move trie and state-machine to primitives. * Fix WASM builds. * fixing broken imports * more interface moves * move backend and light to interfaces * move CallExecutor * move cli off client * moving around more interfaces * re-add consensus crates into the mix * fix subkey path * relieve client from executor * starting to pull out client from grandpa * move is_decendent_of out of client * grandpa still depends on client directly * lemme tests pass * rename srml->paint * Make it compile. * rename interfaces->client-api * Move keyring to primitives. * fixup libp2p dep * fix broken use * allow dependency enforcement to fail * move fork-tree * Moving wasm-builder * make env * move build-script-utils * fixup broken crate depdencies and names * fix imports for authority discovery * fix typo * update cargo.lock * fixing imports * Fix paths and add missing crates * re-add missing crates
This commit is contained in:
committed by
Bastian Köcher
parent
becc3b0a4f
commit
60e5011c72
@@ -0,0 +1,10 @@
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
maxUnavailable: 1
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- if .Values.validator.keys }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.app }}-secrets
|
||||
labels:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
type: Opaque
|
||||
data:
|
||||
secrets: {{ .Values.validator.keys | default "" }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,54 @@
|
||||
# see:
|
||||
# https://kubernetes.io/docs/tutorials/services/
|
||||
# https://kubernetes.io/docs/concepts/services-networking/service/
|
||||
# headless service for rpc
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.app }}-rpc
|
||||
spec:
|
||||
ports:
|
||||
- port: 9933
|
||||
name: http-rpc
|
||||
- port: 9944
|
||||
name: websocket-rpc
|
||||
selector:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
sessionAffinity: None
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
---
|
||||
{{- if .Values.listen_node_port }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.app }}
|
||||
spec:
|
||||
ports:
|
||||
- port: 30333
|
||||
name: p2p
|
||||
nodePort: 30333
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
sessionAffinity: None
|
||||
type: NodePort
|
||||
# don't route exteral traffic to non-local pods
|
||||
externalTrafficPolicy: Local
|
||||
{{- else if .Values.validator.keys }}
|
||||
{{- $root := . -}}
|
||||
{{- range until (int .Values.nodes.replicas) }}
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ $root.Values.app }}-{{ . }}
|
||||
spec:
|
||||
selector:
|
||||
statefulset.kubernetes.io/pod-name: {{ $root.Values.app }}-{{ . }}
|
||||
ports:
|
||||
- port: 30333
|
||||
targetPort: 30333
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- if .Values.rbac.enable }}
|
||||
# service account for substrate pods themselves
|
||||
# no permissions for the api are required
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
name: {{ .Values.rbac.name }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,139 @@
|
||||
# https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/
|
||||
# https://cloud.google.com/kubernetes-engine/docs/concepts/statefulset
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ .Values.app }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
serviceName: {{ .Values.app }}
|
||||
replicas: {{ .Values.nodes.replicas }}
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
podManagementPolicy: Parallel
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.GitlabEnvSlug | default .Values.app }}
|
||||
spec:
|
||||
{{- if .Values.rbac.enable }}
|
||||
serviceAccountName: {{ .Values.rbac.name }}
|
||||
{{- else }}
|
||||
serviceAccountName: default
|
||||
{{- end }}
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: node
|
||||
operator: In
|
||||
values:
|
||||
- substrate
|
||||
{{- if .Values.listen_node_port }}
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: "app"
|
||||
operator: In
|
||||
values:
|
||||
- {{ .Values.app }}
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: 300
|
||||
{{- if .Values.validator.keys }}
|
||||
volumes:
|
||||
- name: {{ .Values.app }}-validator-secrets
|
||||
secret:
|
||||
secretName: {{ .Values.app }}-secrets
|
||||
initContainers:
|
||||
- name: prepare-secrets
|
||||
image: busybox
|
||||
command: [ "/bin/sh" ]
|
||||
args:
|
||||
- -c
|
||||
- sed -n -r "s/^${POD_NAME}-key ([^ ]+)$/\1/p" /etc/validator/secrets > {{ .Values.image.basepath }}/key;
|
||||
sed -n -r "s/^${POD_NAME}-node-key ([^ ]+)$/\1/p" /etc/validator/secrets > {{ .Values.image.basepath }}/node-key;
|
||||
sed -n -r "s/^${POD_NAME}-name ([^ ]+)$/\1/p" /etc/validator/secrets > {{ .Values.image.basepath }}/name;
|
||||
test -s {{ .Values.image.basepath }}/name || echo "${POD_NAME}" > {{ .Values.image.basepath }}/name
|
||||
env:
|
||||
# from (workaround for hostname)
|
||||
# https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
volumeMounts:
|
||||
- name: {{ .Values.app }}-validator-secrets
|
||||
readOnly: true
|
||||
mountPath: "/etc/validator"
|
||||
- name: {{ .Values.app }}dir
|
||||
mountPath: {{ .Values.image.basepath }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Values.app }}
|
||||
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
{{- if .Values.resources }}
|
||||
resources:
|
||||
requests:
|
||||
memory: {{ .Values.resources.memory }}
|
||||
cpu: {{ .Values.resources.cpu }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: 30333
|
||||
name: p2p
|
||||
- containerPort: 9933
|
||||
name: http-rpc
|
||||
- containerPort: 9944
|
||||
name: websocket-rpc
|
||||
command: ["/bin/sh"]
|
||||
args:
|
||||
- -c
|
||||
- exec /usr/local/bin/substrate
|
||||
--base-path {{ .Values.image.basepath }}
|
||||
{{- if .Values.validator.keys }}
|
||||
--validator
|
||||
--name $(cat {{ .Values.image.basepath }}/name)
|
||||
--key $(cat {{ .Values.image.basepath }}/key)
|
||||
--node-key $(cat {{ .Values.image.basepath }}/node-key)
|
||||
{{- else }}
|
||||
--name $(POD_NAME)
|
||||
{{- end }}
|
||||
{{- range .Values.nodes.args }} {{ . }} {{- end }}
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
volumeMounts:
|
||||
- name: {{ .Values.app }}dir
|
||||
mountPath: {{ .Values.image.basepath }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http-rpc
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http-rpc
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
fsGroup: 1000
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: {{ .Values.app }}dir
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: ssd
|
||||
resources:
|
||||
requests:
|
||||
storage: 32Gi
|
||||
|
||||
Reference in New Issue
Block a user