created: 20190607080439124 creator: user modified: 20190607143730359 modifier: user tags: title: Deploy 2 k8s using kops type: text/vnd.tiddlywiki ```sh # Configure AWS CLI - aws configure # Export Kops variables so Kops knows of the AWS cluster export KOPS_CLUSTER_NAME=difa-test.k8s.local export KOPS_STATE_STORE=s3://digitalefactuur-tst-kops-state-store # Export kubeconfig kops export kubecfg # Run Kubernetes Dashboard on localhost as a background service kubectl proxy & # Check the status of the Kubernetes cluster kops validate cluster # Edit the AWS nodes in a YAML file (instance type, min, max nodes) kops edit ig nodes # Update AWS cluster using Kops - specify --yes to make actual changes kops update cluster # Check metrics of AWS nodes kubectl top nodes # top of nodes kubectl top nodes # change nodes kops edit instancegroup nodes kops update cluster --yes # Rolling update AWS cluster - specify --yes to make actual changes kops rolling-update cluster --yes # password for dashboard kops get secrets admin --type secret -oplaintext ``` ```sh helm del --purge database ; sleep 5; helm install --name database $GENIFER_HOME/operations/helm/databases helm del --purge genifer-release ; sleep 5; helm install --name genifer-release $GENIFER_HOME/operations/helm/genifer ``` Heb de loadbalancer service om moeten bouwen naar een ingress nginx service, daarna een cert-manager tutorial gevolgd om https te kunnen gebruiken via letsencrypt. Gebruiken nu: * nginx ingress controller (Layer 4) tutorial: https://kubernetes.github.io/ingress-nginx/deploy/#aws * external dns, hierdoor zal de dns automatisch toegewezen worden aan je subdomein die je in je ingress definieert (via route53): https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/aws.md * cert manager tutorial: https://docs.cert-manager.io/en/latest/getting-started/install/kubernetes.html * cert aanmaak tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes (edited)