Last active
September 23, 2019 14:38
-
-
Save terashim/66a04d06ea5abf29e557fb12a2d9a8ef to your computer and use it in GitHub Desktop.
k8s で default-token を取得するワンライナー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 応用例 | |
# Docker Desktopのk8sのconfigにdefault-tokenを設定する | |
kubectl config set-credentials docker-desktop --token="$(kubectl -n kube-system get secret | grep default-token | awk '{print $1}' | xargs -IXXX kubectl -n kube-system get secret XXX -o jsonpath='{.data.token}' | base64 --decode)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl -n kube-system get secret | grep default-token | awk '{print $1}' | xargs -IXXX kubectl -n kube-system get secret XXX -o jsonpath='{.data.token}' | base64 --decode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment