Warning
I just learned Kubernetes in one night. My notes are just for myself.
docker tag hello registry.digitalocean.com/hello/hello
docker push registry.digitalocean.com/hello/hello
doctl kubernetes cluster kubeconfig save {your-cluster}
kubectl config get-contexts
kubectl apply -f k8s/deployment.yaml
kubectl get pod
In this case, use cluster ip
kubectl apply -f k8s/service.yaml
kubectl get services
In this case, k8s/nginx-values.yaml
to expose custom port at load-balancer
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx -f k8s/nginx-values.yaml
kubectl apply -f k8s/ingress.yaml
kubectl get service --namespace default ingress-nginx-controller --output wide
kubectl create namespace cert-manager
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v1.10.1 --set installCRDs=true
kubectl apply -f k8s/issuer.yaml
kubectl describe certificate {your-cert}
follow https://docs.digitalocean.com/products/kubernetes/how-to/set-up-autoscaling
kubectl apply -f k8s/hpa.yaml
kubectl top nodes
kubectl get hpa
update nginx value
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx -f k8s/nginx-values.yaml
re-deploy
kubectl rollout restart deployment
https://docs.digitalocean.com/products/kubernetes/how-to/configure-load-balancers/