Skip to content

Instantly share code, notes, and snippets.

@cmosh
Created February 28, 2019 12:57
Show Gist options
  • Save cmosh/d6559e663b615b11dc3d9f05b8f53a25 to your computer and use it in GitHub Desktop.
Save cmosh/d6559e663b615b11dc3d9f05b8f53a25 to your computer and use it in GitHub Desktop.
Command to generate kubernetes dashboard token and copy to clipboard on OSX
#!/usr/bin/env bash
token=$(kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}') | grep token:) && echo ${token#"token:"} | xargs -n1 echo | pbcopy && pbpaste && echo "↑ token copied to clipboard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment