diff --git a/kind/cluster-api/capi-quickstart.kubeconfig b/kind/cluster-api/capi-quickstart.kubeconfig deleted file mode 100644 index c1a87a8..0000000 --- a/kind/cluster-api/capi-quickstart.kubeconfig +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v1 -clusters: -- cluster: - certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM2akNDQWRLZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1Ea3dPREUwTkRReE5Wb1hEVE14TURrd05qRTBORGt4TlZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTHZwClJlY1NOUVJNSmNwWFBBeXN5SHA4a09pTFdyRFp6WWZaWmFWT2lIK0lxWHg3TXFrMmkwNW1lYlBTajNXRVVjenQKYUlGMjRkOHFaMUREUTBLT2o0SUoxR3poYzJNYzFUcnFHSW43WDQ3Vmx3OTJJQXUycUlPejArK0FpT3VReVpYbApNYlRWS0lZNUhMZnROZWJ6N1grSzczczQ5UUpkZGN0ZVRhY3FVUVNFWnVCSEpnc3JEbTFMYW5xUDUyakwxZDFmCnd0cGd6c2pBRU96TnlaY3ZwYVE0MHgwZXlwcTZvZTYwcXd5Y1BPd0JmSy82cnh3R1FpWFRMTUJsVHJmQXR4SVoKYXo3QUhEUk8wbXVJMlVObVhTaXJmaUVHZG4venc2N0Y4eHBUa2w3MDg3UVBOOFBsOXo2WDhRcjlHdjBHNUhqZAp4eUlSZXMvT0JUSTNEQ1UrZWJjQ0F3RUFBYU5GTUVNd0RnWURWUjBQQVFIL0JBUURBZ0trTUJJR0ExVWRFd0VCCi93UUlNQVlCQWY4Q0FRQXdIUVlEVlIwT0JCWUVGSS9YTkl6SStZR3VRdFlKVDFpTU5DY2MrVW5JTUEwR0NTcUcKU0liM0RRRUJDd1VBQTRJQkFRQVA5OWltL2ZzWi9lUklHUUV4R1Q2RTdTUFdwK3pxcENjMlJrOEpjT0czZTFmZAp2aUtUNEhLRXp4aGFpWDFUY2U2TEZwS1BkWVJIODFXRVZRdVVEclhZS3hZYTlvVFVROUJYNUhTa2JkbFlMaXJUCjVDRmJySWlhd3RiQ0Jpc0ZjYzFMNjRBZXVxMzJuSlF4ODJnalVOQ3RYT1pDMm1oaThKU0lZVHNiWWxaN1ZnMVkKb3RVcS9hZGtVV0Y2cFYwbk55NWhDdm1PVHZHOHN2blBCRlNkdWxlTlkvRldndzk0eGV5LzU4U0lmQVVyd2l2SwpiK2REWnRjbG5ZTUNBYXVPTlN6WUdYS09hK1M1SUptMmdWVERGVnhibzVMaTBGY1VtZ2JQYi9nRlBQVW5MbXZvCnI2K1hTYThJV0ExTzY2bk56NzBQMnpBZTAvR3BiN0ZlbUh0KzFKSGMKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= - server: https://172.19.0.3:6443 - name: capi-quickstart -contexts: -- context: - cluster: capi-quickstart - user: capi-quickstart-admin - name: capi-quickstart-admin@capi-quickstart -current-context: capi-quickstart-admin@capi-quickstart -kind: Config -preferences: {} -users: -- name: capi-quickstart-admin - user: - client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFekNDQWZ1Z0F3SUJBZ0lJR3JPV1h2NEJEVWd3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TVRBNU1EZ3hORFEwTVRWYUZ3MHlNakE1TURneE5EUTVNVFphTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXpaV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tPOUZCMGNwS2FSWXpTNE1kNFlTb1dNWWV0NW9RL0YwK1gKWUFxMC9pMXNBY0lTZlJNbW84ZTFZYzE2UEwwQjA4VzZMS1kxR1JEYUdHbGNqSzZRU3VEeVY1d2RtWWNSOVJDRwprdTl0LzJiNkpMdXlWS1lyUmJuYUUxYzZCM0RDelAwUTUyQkxYYUR5NG40TU4wTEs3Z1FUWVNBPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= - diff --git a/kind/cluster-api/dockercluster.yaml b/kind/cluster-api/dockercluster.yaml deleted file mode 100644 index ff796a9..0000000 --- a/kind/cluster-api/dockercluster.yaml +++ /dev/null @@ -1,3 +0,0 @@ -images: - all: - repository: cncamp \ No newline at end of file diff --git a/kind/readme.MD b/kind/readme.MD deleted file mode 100644 index 10c669f..0000000 --- a/kind/readme.MD +++ /dev/null @@ -1,26 +0,0 @@ -### Create host cluster - -```shell -$ ./create_cluster.sh -``` - -### Generate cluster specs - -```shell -$ cd cluster-api -$ ./generate_workload_cluster.sh -$ kubectl apply -f capi-quickstart.yaml -``` - -### Check - -```shell -$ docker ps|grep control-plane -b107b11771e5 kindest/haproxy:v20210715-a6da3463 "haproxy -sf 7 -W -d…" 4 minutes ago Up 4 minutes 40295/tcp, 0.0.0.0:40295->6443/tcp capi-quickstart-lb - -$ clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig -$ k get no --kubeconfig capi-quickstart.kubeconfig --server https://127.0.0.1:40295 -NAME STATUS ROLES AGE VERSION -capi-quickstart-control-plane-6slwd NotReady control-plane,master 4m19s v1.22.0 -capi-quickstart-md-0-765cf784c5-6klwr NotReady 3m41s v1.22.0 -``` diff --git a/module9/kind/cluster-api/capi-quickstart.kubeconfig b/module9/kind/cluster-api/capi-quickstart.kubeconfig new file mode 100644 index 0000000..e121133 --- /dev/null +++ b/module9/kind/cluster-api/capi-quickstart.kubeconfig @@ -0,0 +1,20 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: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HdUVnVLMXg3cURVRTg4WXZ5a2FjClQvRVJwbExsL0pGaTA5aW1tSU5CWGZpdGpONGdKQzZjQWNFdklpUS9mdzIva0VON09IQk5wVTlRWTlQSHZOZXMKS1M0THAvQ3M3VXJ1NlE3enRqM0F3bDFHZUhBZ2Z0c1AzWGV1Nk9GQVF2MXhwTFE5VHdKUm9HeTV4QkkxVUJNYQpIR3d3M0FXOFh5d2p4RmRMTmdMN3VtRGwrbnZMditpSkJIa1JkVTJlbGFCT0ZjblFtbWNmOUtjVi9zRmE4cHJ5CklCNFgvdkVpMlVGTmt1ejNhZ2ttTVpGTi94Q2VtVEthcEh1OUFzNy8KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + server: https://172.18.0.3:6443 + name: capi-quickstart +contexts: +- context: + cluster: capi-quickstart + user: capi-quickstart-admin + name: capi-quickstart-admin@capi-quickstart +current-context: capi-quickstart-admin@capi-quickstart +kind: Config +preferences: {} +users: +- name: capi-quickstart-admin + user: + client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFekNDQWZ1Z0F3SUJBZ0lJWWN1aitJQTA1dVl3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TVRFeE1EY3hNalV5TVRkYUZ3MHlNakV4TURjeE1qVTNNVGhhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXlEMTJNTXllUkpZRHp5cmMKdkxNTnBhWW51d041enZaZXluK0x5YTNMMjlWNDRIRThSNldZdzhWaTdNRFVPOGJPdjNlOGJzOUJJemV2TzRISAo5VWduVnh3aTBiOU13ZUliUDNBSnk1a3o5WXp4MllLS3pGK09iZnB0NW93dlltQ05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jA4KzFFRUlmTjBPCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg== + diff --git a/kind/cluster-api/capi-quickstart.yaml b/module9/kind/cluster-api/capi-quickstart.yaml similarity index 76% rename from kind/cluster-api/capi-quickstart.yaml rename to module9/kind/cluster-api/capi-quickstart.yaml index d5bc752..d65c44c 100644 --- a/kind/cluster-api/capi-quickstart.yaml +++ b/module9/kind/cluster-api/capi-quickstart.yaml @@ -1,4 +1,4 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: capi-quickstart @@ -13,23 +13,23 @@ spec: cidrBlocks: - 10.128.0.0/12 controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 kind: KubeadmControlPlane name: capi-quickstart-control-plane namespace: default infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerCluster name: capi-quickstart namespace: default --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerCluster metadata: name: capi-quickstart namespace: default --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerMachineTemplate metadata: name: capi-quickstart-control-plane @@ -41,7 +41,7 @@ spec: - containerPath: /var/run/docker.sock hostPath: /var/run/docker.sock --- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 kind: KubeadmControlPlane metadata: name: capi-quickstart-control-plane @@ -49,7 +49,6 @@ metadata: spec: kubeadmConfigSpec: clusterConfiguration: - imageRepository: registry.aliyuncs.com/google_containers apiServer: certSANs: - localhost @@ -71,14 +70,14 @@ spec: eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% machineTemplate: infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerMachineTemplate name: capi-quickstart-control-plane namespace: default replicas: 1 - version: v1.22.0 + version: v1.22.2 --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerMachineTemplate metadata: name: capi-quickstart-md-0 @@ -87,7 +86,7 @@ spec: template: spec: {} --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate metadata: name: capi-quickstart-md-0 @@ -100,10 +99,8 @@ spec: kubeletExtraArgs: cgroup-driver: cgroupfs eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% - clusterConfiguration: - imageRepository: registry.aliyuncs.com/google_containers --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: name: capi-quickstart-md-0 @@ -117,14 +114,14 @@ spec: spec: bootstrap: configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate name: capi-quickstart-md-0 namespace: default clusterName: capi-quickstart infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerMachineTemplate name: capi-quickstart-md-0 namespace: default - version: v1.22.0 + version: v1.22.2 diff --git a/module9/kind/cluster-api/dockercluster.yaml b/module9/kind/cluster-api/dockercluster.yaml new file mode 100644 index 0000000..e69de29 diff --git a/kind/cluster-api/generate_workload_cluster.sh b/module9/kind/cluster-api/generate_workload_cluster.sh similarity index 82% rename from kind/cluster-api/generate_workload_cluster.sh rename to module9/kind/cluster-api/generate_workload_cluster.sh index 90d78e9..b0ffd68 100755 --- a/kind/cluster-api/generate_workload_cluster.sh +++ b/module9/kind/cluster-api/generate_workload_cluster.sh @@ -1,5 +1,5 @@ clusterctl generate cluster capi-quickstart --flavor development \ - --kubernetes-version v1.22.0 \ + --kubernetes-version v1.22.2 \ --control-plane-machine-count=1 \ --worker-machine-count=1 \ > capi-quickstart.yaml diff --git a/kind/cluster-api/init_docker_provider.sh b/module9/kind/cluster-api/init_docker_provider.sh similarity index 100% rename from kind/cluster-api/init_docker_provider.sh rename to module9/kind/cluster-api/init_docker_provider.sh diff --git a/module9/kind/cluster-api/my-cluster.yaml b/module9/kind/cluster-api/my-cluster.yaml new file mode 100644 index 0000000..e69de29 diff --git a/kind/create_cluster.sh b/module9/kind/create_cluster.sh similarity index 100% rename from kind/create_cluster.sh rename to module9/kind/create_cluster.sh diff --git a/kind/kind.conf b/module9/kind/kind.conf similarity index 100% rename from kind/kind.conf rename to module9/kind/kind.conf diff --git a/module9/kind/readme.MD b/module9/kind/readme.MD new file mode 100644 index 0000000..19687d6 --- /dev/null +++ b/module9/kind/readme.MD @@ -0,0 +1,30 @@ +### create host cluster + +``` +./create_cluster.sh +``` + +### generate cluster specs + +``` +cd cluster-api +./init_docker_provider.sh +./generate_workload_cluster.sh +kubectl apply -f capi-quickstart.yaml +``` + +### check + +``` +docker ps|grep control-plane +b107b11771e5 kindest/haproxy:v20210715-a6da3463 "haproxy -sf 7 -W -d…" 4 minutes ago Up 4 minutes 40295/tcp, 0.0.0.0:40295->6443/tcp capi-quickstart-lb +clusterctl get kubeconfig capi-quickstart > capi-quickstart.kubeconfig +kubectl get no --kubeconfig capi-quickstart.kubeconfig --server https://127.0.0.1:40295 +NAME STATUS ROLES AGE VERSION +capi-quickstart-control-plane-6slwd NotReady control-plane,master 4m19s v1.22.0 +capi-quickstart-md-0-765cf784c5-6klwr NotReady 3m41s v1.22.0 +``` + +### kubectl get cluster + +### kubectl get machineset diff --git a/module9/kubeadm-ha/1.k8s-ha.md b/module9/kubeadm-ha/1.k8s-ha.md index fb03ffc..60f7f59 100644 --- a/module9/kubeadm-ha/1.k8s-ha.md +++ b/module9/kubeadm-ha/1.k8s-ha.md @@ -1,8 +1,9 @@ +## first master ### reset ``` kubeadm reset ``` -### run the following command on all master candidates +### run the following command on 1st master ``` echo "192.168.34.2 cadmin" >> /etc/hosts echo "192.168.34.2 master.cncamp.io" >> /etc/hosts @@ -18,16 +19,41 @@ $ mkdir -p $HOME/.kube $ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config $ sudo chown $(id -u):$(id -g) $HOME/.kube/config ``` -### join the 2nd master ### untaint master ``` $ kubectl taint nodes --all node-role.kubernetes.io/master- ``` + ### install calico cni plugin https://docs.projectcalico.org/getting-started/kubernetes/quickstart ``` $ kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml $ kubectl create -f https://docs.projectcalico.org/manifests/custom-resources.yaml ``` +### second master +### reset +``` +kubeadm reset +``` +### run the following command on 2nd master +``` +echo "192.168.34.2 cadmin" >> /etc/hosts +echo "192.168.34.2 master.cncamp.io" >> /etc/hosts +echo "192.168.34.3 cadmin2" >> /etc/hosts +``` +### join the 2nd master +``` +kubeadm join master.cncamp.io:6443 --token 2m54gi.0v6s155lujz3ruyk \ +--discovery-token-ca-cert-hash sha256:22aee251c9a2ea7442862555ed6fce301f44548069e46bfad9210aaffa4f1cef \ +--control-plane --certificate-key 8a4d46120ad3eaa63b6e3395a59b4ef8c84eb90c2ef7aa375e707086959fa72b \ +--apiserver-advertise-address=192.168.34.3 +``` + +ETCDCTL_API=3 +etcdctl --endpoints https://192.168.34.2:2379 \ +--cacert /etc/kubernetes/pki/etcd/ca.crt \ +--cert /etc/kubernetes/pki/etcd/server.crt \ +--key /etc/kubernetes/pki/etcd/server.key \ +member list \ No newline at end of file diff --git a/module9/kubeadm-ha/kubeadm-conf.yaml b/module9/kubeadm-ha/kubeadm-conf.yaml index b2a9874..eba0b5d 100644 --- a/module9/kubeadm-ha/kubeadm-conf.yaml +++ b/module9/kubeadm-ha/kubeadm-conf.yaml @@ -9,6 +9,18 @@ etcd: # one of local or external local: dataDir: "/var/lib/etcd" + serverCertSANs: + - "127.0.0.1" + - "192.168.34.2" + - "192.168.34.3" + - "localhost" + - "master.cncamp.io" + peerCertSANs: + - "127.0.0.1" + - "192.168.34.2" + - "192.168.34.3" + - "localhost" + - "master.cncamp.io" networking: podSubnet: "192.168.0.0/16" dnsDomain: "cluster.local" diff --git a/module9/kubespray/kubespray.MD b/module9/kubespray/kubespray.MD new file mode 100644 index 0000000..11be46e --- /dev/null +++ b/module9/kubespray/kubespray.MD @@ -0,0 +1,100 @@ +## prepare k8s vm +### install 2 ubuntu20.04 vm +### set network adapter +### add a host only adaptor and add the following settings +node1 +``` +cat /etc/netplan/00-installer-config.yaml +network: + ethernets: + enp0s3: + dhcp4: true + enp0s8: + dhcp4: no + addresses: + - 192.168.34.10/24 + version: 2 +``` +``` +netplan apply +``` +node2 +``` +cat /etc/netplan/00-installer-config.yaml + +network: + ethernets: + enp0s3: + dhcp4: true + enp0s8: + dhcp4: no + addresses: + - 192.168.34.11/24 + version: 2 +``` +``` +netplan apply +``` +## Start k8s by kubespary +### Download kubespary docker image +docker pull quay.io/kubespray/kubespray:v2.16.0 + +### Clone kubespary source code +git clone https://github.com/kubernetes-sigs/kubespray.git + +``` +ssh-keygen -t rsa +ssh-copy-id -i ~/.ssh/id_rsa.pub cadmin@192.168.34.10 +ssh-copy-id -i ~/.ssh/id_rsa.pub cadmin@192.168.34.11 +``` + +### Start kubespray +``` +cd kubespray +docker run --net host --rm -it --name kubespray --mount type=bind,source="$(pwd)"/inventory/sample,dst=/inventory --mount type=bind,source="${HOME}"/.ssh/id_rsa,dst=/root/.ssh/id_rsa quay.io/kubespray/kubespray:v2.16.0 bash +``` + +### prepare no password login for server + +### build ansible inventory +cp -r inventory/sample inventory/mycluster +declare -a IPS=(192.168.34.10 192.168.34.11) +CONFIG_FILE=inventory/mycluster/hosts.yml python3 contrib/inventory_builder/inventory.py ${IPS[@]} + +### change gcr.io to mirror +cat > inventory/mycluster/group_vars/k8s_cluster/vars.yml << EOF +gcr_image_repo: "registry.aliyuncs.com/google_containers" +kube_image_repo: "registry.aliyuncs.com/google_containers" +etcd_download_url: "https://ghproxy.com/https://github.com/coreos/etcd/releases/download/{{ etcd_version }}/etcd-{{ etcd_version }}-linux-{{ image_arch }}.tar.gz" +cni_download_url: "https://ghproxy.com/https://github.com/containernetworking/plugins/releases/download/{{ cni_version }}/cni-plugins-linux-{{ image_arch }}-{{ cni_version }}.tgz" +calicoctl_download_url: "https://ghproxy.com/https://github.com/projectcalico/calicoctl/releases/download/{{ calico_ctl_version }}/calicoctl-linux-{{ image_arch }}" +calico_crds_download_url: "https://ghproxy.com/https://github.com/projectcalico/calico/archive/{{ calico_version }}.tar.gz" +crictl_download_url: "https://ghproxy.com/https://github.com/kubernetes-sigs/cri-tools/releases/download/{{ crictl_version }}/crictl-{{ crictl_version }}-{{ ansible_system | lower }}-{{ image_arch }}.tar.gz" +nodelocaldns_image_repo: "cncamp/k8s-dns-node-cache" +dnsautoscaler_image_repo: "cncamp/cluster-proportional-autoscaler-amd64" +EOF + +### change remote user +#### on host src folder +vi ansible.cfg +add remote_user=cadmin to [default] section +docker cp ansible.cfg kubespray:/kubespray/ansible.cfg + +ansible-playbook -i inventory/mycluster/hosts.yml cluster.yml -b -v \ + --private-key=~/.ssh/id_rsa +``` + +```markdown + +### error, the following error cause by slow network in China +Data could not be sent to remote host \"192.168.34.11\". Make sure this host can be reached over ssh: +### error +dpkg: error: dpkg frontend lock is locked by another process + +rm /var/lib/dpkg/lock +rm /var/lib/dpkg/lock-frontend +rm /var/cache/apt/archives/lock + +### if you meet same error when downloading image, you can pull the image before retry + +``` \ No newline at end of file