no way to compare when less than two revisions
Diferencias
Muestra las diferencias entre dos versiones de la página.
| — | docs:virtualizacion:kubernetes:kops_cluster_mamagement [2020/04/08 21:59] (actual) – creado rodolfo | ||
|---|---|---|---|
| Línea 1: | Línea 1: | ||
| + | ====== kops cluster management ====== | ||
| + | |||
| + | ===== Create cluster ===== | ||
| + | |||
| + | ==== Previous ==== | ||
| + | |||
| + | |||
| + | export NAME=myfirstcluster.k8s.local | ||
| + | export KOPS_STATE_STORE=s3:// | ||
| + | |||
| + | $ ssh-keygen -t rsa -f / | ||
| + | |||
| + | ==== Create cluster config ==== | ||
| + | |||
| + | Store config at at S3 bucket | ||
| + | |||
| + | $ kops create cluster --zones us-east-1a ${NAME} | ||
| + |  | ||
| + | Cluster configuration has been created. | ||
| + |  | ||
| + | Suggestions: | ||
| + | * list clusters with: kops get cluster | ||
| + | * edit this cluster with: kops edit cluster myfirstcluster.k8s.local | ||
| + | * edit your node instance group: kops edit ig --name=myfirstcluster.k8s.local nodes | ||
| + | * edit your master instance group: kops edit ig --name=myfirstcluster.k8s.local master-us-east-1a | ||
| + |  | ||
| + | Finally configure your cluster with: kops update cluster myfirstcluster.k8s.local --yes | ||
| + | |||
| + | Modify stored config | ||
| + | |||
| + | $ kops create secret --name ${NAME} sshpublickey admin -i ~/ | ||
| + | |||
| + | ==== Edit configuration ==== | ||
| + | |||
| + | Modify kubernetes version to install: | ||
| + | |||
| + | $ kops edit cluster ${NAME} | ||
| + |  | ||
| + | kubernetesVersion: | ||
| + | |||
| + | $ kops edit ig --name ${NAME} master-us-east-1a | ||
| + |  | ||
| + | $ kops edit ig --name ${NAME} nodes | ||
| + | |||
| + | ==== Deploy cluster ==== | ||
| + | |||
| + | $ kops update cluster ${NAME} --yes | ||
| + |  | ||
| + | Cluster is starting. | ||
| + |  | ||
| + | Suggestions: | ||
| + | * validate cluster: kops validate cluster | ||
| + | * list nodes: kubectl get nodes --show-labels | ||
| + | * ssh to the master: ssh -i ~/ | ||
| + | * the admin user is specific to Debian. If not using Debian please use the appropriate user based on your OS. | ||
| + | * read about installing addons at: https:// | ||
| + | |||
| + | ==== Validate cluster ==== | ||
| + | |||
| + | $ kops validate cluster | ||
| + | Using cluster from kubectl context: myfirstcluster.k8s.local | ||
| + |  | ||
| + | Validating cluster myfirstcluster.k8s.local | ||
| + |  | ||
| + | INSTANCE GROUPS | ||
| + | NAME ROLE MACHINETYPE MIN MAX SUBNETS | ||
| + | master-us-west-2a Master m3.medium 1 1 us-west-2a | ||
| + | nodes Node t2.medium 2 2 us-west-2a | ||
| + |  | ||
| + | NODE STATUS | ||
| + | NAME ROLE READY | ||
| + | ip-172-20-32-120.us-west-2.compute.internal master True | ||
| + | ip-172-20-51-89.us-west-2.compute.internal node True | ||
| + | ip-172-20-58-56.us-west-2.compute.internal node True | ||
| + |  | ||
| + | Your cluster myfirstcluster.k8s.local is ready | ||
| + | |||
| + | $ kubectl get nodes | ||
| + | NAME                                          STATUS | ||
| + | ip-172-20-32-120.us-west-2.compute.internal | ||
| + | ip-172-20-51-89.us-west-2.compute.internal | ||
| + | ip-172-20-58-56.us-west-2.compute.internal | ||
| + | |||
| + | $ kubectl cluster-info | ||
| + | Kubernetes master is running at https:// | ||
| + | KubeDNS is running at https:// | ||
| + |  | ||
| + | To further debug and diagnose cluster problems, use ' | ||
| + | |||
| + | $ kubectl -n kube-system get po | ||
| + | NAME | ||
| + | dns-controller-6d6b7f78b-8jv7z | ||
| + | etcd-server-events-ip-172-20-34-76.ec2.internal | ||
| + | etcd-server-ip-172-20-34-76.ec2.internal | ||
| + | kube-apiserver-ip-172-20-34-76.ec2.internal | ||
| + | kube-controller-manager-ip-172-20-34-76.ec2.internal | ||
| + | kube-dns-5fbcb4d67b-n2srl | ||
| + | kube-dns-5fbcb4d67b-rg84t | ||
| + | kube-dns-autoscaler-6874c546dd-k8f4m | ||
| + | kube-proxy-ip-172-20-34-76.ec2.internal | ||
| + | kube-proxy-ip-172-20-51-76.ec2.internal | ||
| + | kube-proxy-ip-172-20-63-90.ec2.internal | ||
| + | kube-scheduler-ip-172-20-34-76.ec2.internal | ||
| + | |||
| + | ===== Delete cluster ===== | ||
| + | |||
| + | Complete delete cluster, content and all configuration. | ||
| + | |||
| + | Preview: | ||
| + | |||
| + | $ kops delete cluster --name ${NAME} | ||
| + | |||
| + | Apply changes: | ||
| + | |||
| + | $ kops delete cluster --name ${NAME} --yes | ||
| + |  | ||
| + | Deleted kubectl config for myfirstcluster.k8s.local | ||
| + |  | ||
| + | Deleted cluster: " | ||
| + | |||
| + | ===== Update cluster ===== | ||
| + | |||
| + | $ kops edit cluster ${NAME} | ||
| + |  | ||
| + | ... | ||
| + | kubernetesVersion: | ||
| + | ... | ||
| + | |||
| + | Preview: | ||
| + | |||
| + | $ kops update cluster ${NAME} | ||
| + |  | ||
| + | Apply | ||
| + | |||
| + | $ kops update cluster ${NAME} --yes | ||
| + | |||
| + | Rolling update preview | ||
| + | |||
| + | $ kops rolling-update cluster ${NAME} | ||
| + | |||
| + | Rolling update apply | ||
| + | |||
| + | $ kops rolling-update cluster ${NAME} --yes | ||
| + | |||
| + | |||
| + | ===== Referencias ===== | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
 rodolfo
 rodolfo