Skip to content

Commit

Permalink
Merge pull request #42 from FIWARE-Ops/onboarding-did
Browse files Browse the repository at this point in the history
Added init job to onboarding waltid
  • Loading branch information
Beknazar Esenbek authored Feb 28, 2024
2 parents 28fd7cb + 70c2e85 commit e0a8737
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aws/dsba/onboarding-portal/walt-id/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: vcwaltid
description: Chart holder for argo-cd

type: application
version: 0.0.16
version: 0.0.18
appVersion: "0.0.1"

dependencies:
Expand Down
18 changes: 18 additions & 0 deletions aws/dsba/onboarding-portal/walt-id/templates/init-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "waltid.fullname" . }}-did-config
data:
import.sh: |-
export KEY=$(cat /opt/did/secret/tls.key)
export KEY_ID=$(curl --location "http://{{ include "waltid.fullname" . }}:{{ .Values.vcwaltid.api.core.port }}/v1/key/import" --header 'Content-Type: text/plain' --data "${KEY}" | jq -r '.id')
echo The key id: ${KEY_ID}
curl -v --location "http://{{ include "waltid.fullname" . }}:{{ .Values.vcwaltid.api.core.port }}/v1/did/create" \
--header 'Content-Type: application/json' \
--data "{
\"method\": \"web\",
\"keyAlias\":\"${KEY_ID}\",
\"domain\": \"{{ .Values.route.host }}\",
\"path\": \"did\",
\"x5u\": \"https://{{ .Values.route.host }}/certs/tls.crt\"
}"
27 changes: 27 additions & 0 deletions aws/dsba/onboarding-portal/walt-id/templates/init-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "waltid.fullname" . }}-init
spec:
template:
spec:
containers:
- name: init
image: quay.io/opencloudio/curl:4.2.0-build.8
command:
- /bin/sh
- /opt/did/script/import.sh
volumeMounts:
- name: did-config
mountPath: /opt/did/script
- name: did-secret
mountPath: /opt/did/secret
restartPolicy: OnFailure
volumes:
- name: did-config
configMap:
name: {{ include "waltid.fullname" . }}-did-config
- name: did-secret
secret:
secretName: {{ include "waltid.fullname" . }}-tls-sec
backoffLimit: 10

0 comments on commit e0a8737

Please sign in to comment.