Skip to content

elofaso/do-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DigitalOcean Kubernetes Set Up

  1. Install and configure doctl https://www.digitalocean.com/docs/apis-clis/doctl/how-to/install/
  2. Create Kubernetes cluster. Change min-nodes and max-nodes to desired values. Change region if desired.

doctl kubernetes cluster create <cluster-name> --node-pool "auto-scale=true;min-nodes=1;max-nodes=3" --region=sfo3

  1. Install kubectl https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
  2. Create Docker repository, if you do not already have one.

doctl registry create <globally-unique-registry-name>

  1. Add container registry support to the docker cluster.

doctl kubernetes cluster registry add <cluster-name>

  1. Log in docker to registry.

doctl registry login

  1. Install Kubernetes metrics server.

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

  1. Install Kubernetes Redis failover operator.

kubectl create -f https://raw.githubusercontent.com/spotahome/redis-operator/master/example/operator/all-redis-operator-resources.yaml

  1. Edit k8s/node-deployment.yaml to replace 'hello' with your app name, 'elofaso/node-hello' with your repository-name/image-name. Replace Load Balancer size 'lb-small with 'lb-medium' or 'lb-large', if desired; Load Balancer cannot be resized.
  2. Deploy Node app and Redis to Kubernetes cluster.

cd k8s kubectl apply -f .

  1. Edit .github/workflows/main.yml to match project file structure and Docker image name.
  2. Create GitHub Actions secret named DIGITALOCEAN_ACCESS_TOKEN with DigitalOcean API access token. https://github.com/elofaso/do-k8s/settings/secrets/actions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published