From 8ae2494991b40b6256537959dd5876c762079879 Mon Sep 17 00:00:00 2001 From: Dima Kniazev Date: Tue, 16 Jan 2024 09:26:08 -0800 Subject: [PATCH] change k8s DNS endpoint for celestia secret (#314) --- localnet/kubernetes/celestia-rollkit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localnet/kubernetes/celestia-rollkit.yaml b/localnet/kubernetes/celestia-rollkit.yaml index 7854dd664..25e81f46a 100644 --- a/localnet/kubernetes/celestia-rollkit.yaml +++ b/localnet/kubernetes/celestia-rollkit.yaml @@ -51,7 +51,7 @@ spec: # TODO(@okdas): Very scary line. Basically, waits until the node key (NJ3XILLTMVRXEZLUFZVHO5A) exists, signs the JWT and pushes it to k8s secret. args: [ - 'while true; do if [ -f /home/celestia/bridge/keys/NJ3XILLTMVRXEZLUFZVHO5A ]; then OUTPUT=$(celestia bridge --node.store /home/celestia/bridge auth admin); BASE64_OUTPUT=$(echo -n $OUTPUT | base64 -w 0); TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token); PAYLOAD=$(echo -n ''{"apiVersion":"v1","kind":"Secret","metadata":{"name":"celestia-secret"},"data":{"auth_token":"''${BASE64_OUTPUT}''"}}''); RESPONSE=$(curl -k -H "Authorization: Bearer $TOKEN" -H ''Content-Type: application/json'' -X PUT -d "$PAYLOAD" https://kubernetes.default.svc/api/v1/namespaces/default/secrets/celestia-secret); echo $RESPONSE | grep ''"code": 404'' >/dev/null && curl -k -H "Authorization: Bearer $TOKEN" -H ''Content-Type: application/json'' -X POST -d "$PAYLOAD" https://kubernetes.default.svc/api/v1/namespaces/default/secrets; while true; do sleep 86400; done; fi; sleep 2; done;', + 'while true; do if [ -f /home/celestia/bridge/keys/NJ3XILLTMVRXEZLUFZVHO5A ]; then OUTPUT=$(celestia bridge --node.store /home/celestia/bridge auth admin); BASE64_OUTPUT=$(echo -n $OUTPUT | base64 -w 0); TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token); PAYLOAD=$(echo -n ''{"apiVersion":"v1","kind":"Secret","metadata":{"name":"celestia-secret"},"data":{"auth_token":"''${BASE64_OUTPUT}''"}}''); RESPONSE=$(curl -k -H "Authorization: Bearer $TOKEN" -H ''Content-Type: application/json'' -X PUT -d "$PAYLOAD" https://kubernetes.default.svc.cluster.local/api/v1/namespaces/default/secrets/celestia-secret); echo $RESPONSE | grep ''"code": 404'' >/dev/null && curl -k -H "Authorization: Bearer $TOKEN" -H ''Content-Type: application/json'' -X POST -d "$PAYLOAD" https://kubernetes.default.svc.cluster.local/api/v1/namespaces/default/secrets; while true; do sleep 86400; done; fi; sleep 2; done;', ] volumeMounts: - name: bridge-volume