Created
November 30, 2021 00:20
-
-
Save brunoa19/25505efd56d46472b092adaf83fe56dd to your computer and use it in GitHub Desktop.
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
echo "apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: shipa-admin | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: shipa-admin | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: cluster-admin | |
subjects: | |
- kind: ServiceAccount | |
name: shipa-admin | |
namespace: kube-system" \ | |
| kubectl apply --filename - | |
echo | |
echo ---------------------------------- | |
echo | |
echo Address: | |
kubectl cluster-info | grep 'Kubernetes' | awk '/http/ {print $NF}' | |
echo | |
echo Token: | |
kubectl --namespace kube-system \ | |
get secret \ | |
$(kubectl --namespace kube-system \ | |
get secret \ | |
| grep shipa-admin \ | |
| awk '{print $1}') \ | |
--output jsonpath="{.data.token}" \ | |
| base64 --decode | |
echo | |
echo | |
echo CA Certificate: | |
kubectl get secret $(\ | |
kubectl get secret \ | |
| grep default-token \ | |
| awk '{print $1}') \ | |
--output jsonpath='{.data.ca\.crt}' \ | |
| base64 --decode | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment