Skip to content

Instantly share code, notes, and snippets.

@mgodf89
Last active April 26, 2024 15:57
Show Gist options
  • Save mgodf89/4e99c10fbc96efdfe0d3833d32bd4df8 to your computer and use it in GitHub Desktop.
Save mgodf89/4e99c10fbc96efdfe0d3833d32bd4df8 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: PersistentVolume
metadata:
name: cometbft-init-pv
namespace: sv
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
hostPath:
path: /data/cometbft
persistentVolumeReclaimPolicy: Retain
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- hostname-controlplane
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cometbft-init-pvc
namespace: sv
spec:
storageClassName: ""
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
volumeName: cometbft-init-pv
---
apiVersion: batch/v1
kind: Job
metadata:
name: canton-network-comet-bft-job-1
namespace: sv
spec:
template:
metadata:
name: canton-network-comet-bft
spec:
initContainers:
- name: cbft-job-1-generate-keys
image: digitalasset-canton-enterprise-docker.jfrog.io/cometbft-canton-network:2.8.3
args: ['init', '--home', '/init']
volumeMounts:
- name: cometbft-init-pv
mountPath: /init
- name: cbft-job-2-show-node-id
image: digitalasset-canton-enterprise-docker.jfrog.io/cometbft-canton-network:2.8.3
args: ['show-node-id', '--home', '/init', '2>&1', '>', '/init/node-id.txt']
volumeMounts:
- name: cometbft-init-pv
mountPath: /init
containers:
- name: cbft-job-complete
image: busybox
command: ['sh', '-c', 'echo "job-1 and job-2 completed"']
imagePullSecrets:
- name: jfrog-registry
restartPolicy: Never
volumes:
- name: cometbft-init-pv
persistentVolumeClaim:
claimName: cometbft-init-pvc
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- hostname-controlplane
tolerations:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment