Skip to content

Commit

Permalink
feat(idw-witness): add witness init
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmorano committed Jul 15, 2024
1 parent 896743b commit 139479b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
12 changes: 12 additions & 0 deletions charts/cf-idw/templates/witness-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: witness
data:
witness-init.sh: |
#!/bin/bash
if [ ! -e ${KERI_SCRIPT_DIR}/data/wil-witness-sample.json ]; then
mkdir -p ${KERI_SCRIPT_DIR}/data
kli init --name witness --nopasscode --config-dir ${KERI_SCRIPT_DIR} --config-file witness
kli incept --name witness --alias witness --config ${KERI_SCRIPT_DIR} --file ${KERI_DEMO_SCRIPT_DIR}/data/wil-witness-sample.json
fi
20 changes: 19 additions & 1 deletion charts/cf-idw/templates/witness-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,25 @@ spec:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
initContainers:
- name: init-witness
image: "{{ .image.repository }}:{{ .image.tag }}"
command: ["bash", "-x", "/configmap/witness-init.sh"]
env:
- name: KERI_SCRIPT_DIR
value: /usr/local/var/keri
volumeMounts:
- mountPath: /usr/local/var/keri
name: keri-data
- mountPath: configmap
name: witness-configmap
containers:
- name: witness
image: "{{ .image.repository }}:{{ .image.tag }}"
command: ["kli", "witness", "start", "--alias main"]
command: ["kli", "witness", "start", "--name witness", "--alias witness"]
env:
- name: KERI_SCRIPT_DIR
value: /usr/local/var/keri
ports:
{{- range $port := .ports }}
- containerPort: {{ $port }}
Expand All @@ -48,6 +63,9 @@ spec:
- name: keri-data
persistentVolumeClaim:
claimName: keri-data
- name: witness-configmap
configMap:
name: witness-configmap

volumeClaimTemplates:
- metadata:
Expand Down

0 comments on commit 139479b

Please sign in to comment.