Skip to content

Instantly share code, notes, and snippets.

@lucperkins
Last active March 4, 2020 22:53
Show Gist options
  • Save lucperkins/0ac8d41d831e4a1e8c9cbbcef2fa4217 to your computer and use it in GitHub Desktop.
Save lucperkins/0ac8d41d831e4a1e8c9cbbcef2fa4217 to your computer and use it in GitHub Desktop.
# Install doctl (DigitalOcean CLI tool)
brew install doctl
# Install kubectl
brew install kubernetes-cli
# Log into DigitalOcean
export DO_ACCESS_TOKEN=...
doctl auth login init --access-token ${DO_ACCESS_TOKEN}
# Spin up a 3-node Kubernetes cluster in the default nyc1 region. This creates the cluster
# and updates your kubeconfig in ~/.kube/config. This could take a while, so be patient!
doctl kubernetes cluster create my-dev-cluster \
--count 3 \
--update-kubeconfig
# List current contexts (you should see "do-nyc1-my-dev-cluster" or something like it in the list)
kubectl config get-contexts
# Set the current context to your newly created cluster
kubectl config set-context do-nyc1-my-dev-cluster
# Now you're ready to go
kubectl get nodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment