Skip to content

Instantly share code, notes, and snippets.

@vnugent
Last active October 28, 2019 14:06
Show Gist options
  • Save vnugent/247673b4c5ab869ab87e554a14f63282 to your computer and use it in GitHub Desktop.
Save vnugent/247673b4c5ab869ab87e554a14f63282 to your computer and use it in GitHub Desktop.
Digital Ocean K8s cheatsheet
Step 1 - Config `kubectl` client to work with a new cluster
1. Download cluster yaml config from K8s dashboard
2. `export KUBECONFIG=~/.kube/config:<new yaml file>`
3. `kubectl config view --flatten > config.new`
4 Remove ~/.kube/config. Rename config.new to config
kubectl config get-contexts
kubectl config use-context <new context>
Step 2 - Add K8s cluster to Gitlab
Instructions are self-explanatory. Leave "Let Gitlab Manage your cluster" unchecked
https://gitlab.com/help/user/project/clusters/index.md#add-existing-kubernetes-cluster
- check Install Helm
- check Install Cert-manager
Step 3 - Enable deploy key
Gitlab docker build pushes image to internal image registry. We need to provide a "deploy token" in K8s deployment in order to pull the image.
gitlap repo -> Settings -> Repository settings -> Deploy token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment