Skip to content

Commit

Permalink
Merge pull request #307 from shriramsharma/fix-sa-token
Browse files Browse the repository at this point in the history
Fixes #306 manually generating sa token
  • Loading branch information
nirvanagit authored Aug 13, 2024
2 parents 0aea582 + c3c4045 commit 033be91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion install/admiralremote/base/remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,15 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: admiral
namespace: admiral-sync
namespace: admiral-sync

---

apiVersion: v1
kind: Secret
metadata:
name: admiral-token
namespace: admiral-sync
annotations:
kubernetes.io/service-account.name: admiral
type: kubernetes.io/service-account-token
2 changes: 1 addition & 1 deletion install/scripts/cluster-secret.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export KUBECFG_FILE=/tmp/${CLUSTER_NAME}
SERVER=$(kubectl config view --minify=true -o "jsonpath={.clusters[].cluster.server}")
NAMESPACE_SYNC=admiral-sync
SERVICE_ACCOUNT=admiral
SECRET_NAME=$(kubectl get sa ${SERVICE_ACCOUNT} -n ${NAMESPACE_SYNC} -o jsonpath='{.secrets[].name}')
SECRET_NAME=admiral-token
CA_DATA=$(kubectl get secret ${SECRET_NAME} -n ${NAMESPACE_SYNC} -o "jsonpath={.data['ca\.crt']}")
RAW_TOKEN=$(kubectl get secret ${SECRET_NAME} -n ${NAMESPACE_SYNC} -o "jsonpath={.data['token']}")
TOKEN=$(kubectl get secret ${SECRET_NAME} -n ${NAMESPACE_SYNC} -o "jsonpath={.data['token']}" | base64 --decode)
Expand Down

0 comments on commit 033be91

Please sign in to comment.