Table of Contents |
---|
@MIGU 补充应用安装相关部分
@huawei 补充控制面相关部分
Introduction
How to use this document
Deployment Architecture
Pre-Installation Requirements
Hardware Requirements
64-bit CentOS 7
- Software Perequisites
docker-ce-20.10.11
kubelet-1.23.7
kubeadm-1.23.7
kubectl-1
Table of Contents |
---|
@MIGU 补充应用安装相关部分
@huawei 补充控制面相关部分
Introduction
How to use this document
Deployment Architecture
Pre-Installation Requirements
Hardware Requirements
64-bit CentOS 7
- Software Perequisites
docker-ce-20.10.11
kubelet-1.23.7
kubeadm-1.23.7
kubectl-1.23.7
N/A
- Database Perequisites
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master kubeadm init --image-repository registry.aliyuncs.com/google_containers --kubernetes-version=v1.23.7 --pod-network-cidr=10.10.0.0/16 |
Execute screenshot
Let kubectl take effect
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config kubectl get po -A |
...
Here select cilium as the network plugin
Confirm that your current default version of the kernel is above 4.9
Check the current kernel version
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master uname -sr |
...
When you have the join statement, copy it and execute it on the worker node
Note that if an error occurs and you need to re-init, you need to execute the following statement first to ensure that kubeadm is re-executed normally
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# master
wget https://github.com/karmada-io/karmada/releases/download/v1.4.0/kubectl-karmada-linux-amd64.tgz
tar -zxf kubectl-karmada-linux-amd64.tgz
mv kubectl-karmada /usr/bin |
Execute screenshot
6.2 Install karamda via karmadactl
...
kubectl-karmada-linux-amd64.tgz
tar -zxf kubectl-karmada-linux-amd64.tgz
mv kubectl-karmada /usr/bin |
Execute screenshot
6.2 Install karamda via karmadactl
Install karamda via kubectl. China mainland registry mirror can be specified by using kube-image-mirror-country
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubectl karmada init --kube-image-registry=registry.cn-hangzhou.aliyuncs.com/google_containers |
Due to network problems, you may need to retry a few times
Execute screenshot
Check all your pod is READY
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubectl karmadaget init --kube-image-registry=registry.cn-hangzhou.aliyuncs.com/google_containers |
Due to network problems, you may need to retry a few times
...
po -A |
Execute screenshot
7 Propagate a deployment by Karmada
Before propagating a deployment, make sure the worker cluster is already working properly And get the latest config currently running
In the following steps, we are going to propagate a deployment by Karmada. We use the installation of nginx as an example
7.1 Join a worker/member cluster to karmada control plane
Here we add the working node cluster through push mode
It is worth noting that /root/.kube/config is Kubernetes config and the /etc/karmada/karmada-apiserver.config is Karmada's config
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubectl get po -A |
Execute screenshot
...
7 Propagate a deployment by Karmada
Before propagating a deployment, make sure the worker cluster is already working properly
In the following steps, we are going to propagate a deployment by Karmada. We use the installation of nginx as an example
7.1 Join a worker/member cluster to karmada control plane
...
| ||
kubectl karmada --kubeconfig /etc/karmada/karmada-apiserver.config join ${YOUR MEMBER NAME} --cluster-kubeconfig=${YOUR MEMBER CONFIG PATH} --cluster-context=${YOUR CLUSTER CONTEXT} |
Here is example command for your information: kubectl karmada --kubeconfig /etc/karmada/karmada-apiserver.config join member1 --cluster-kubeconfig=/root/.kube/192.168.30.22_config --cluster-context=kubernetes-admin@kubernetes
--kubeconfig specifies the Karmada's
kubeconfig
file and the CLI- --cluster-kubeconfig
specifies the member's config. Generally, it can be obtained from the worker cluster in "/root/.kube/config"
--cluster-context the value of current-context from --cluster-kubeconfig
If you want unjoin the member cluster, just change the join to unjoin: kubectl karmada --kubeconfig /etc/karmada/karmada-apiserver.config unjoin member2 --cluster-kubeconfig=/root/.kube/192.168.30.2_config --cluster-context=kubernetes-admin@kubernetes
check the members of karmada
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubectl karmada join worker-cluster --cluster-kubeconfig=prod --cluster-context=prod--kubeconfig /etc/karmada/karmada-apiserver.config get clusters |
7.2 Create nginx deployment in Karmada
...
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubectl get po -A |
...
create -f /root/sample/nginx/deployment.yaml --kubeconfig /etc/karmada/karmada-apiserver.config
kubectl get deployment --kubeconfig /etc/karmada/karmada-apiserver.config |
7.3 Create PropagationPolicy that will propagate nginx to member cluster
Execute command
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubectl get po -A |
...
create -f /root/sample/nginx/propagationpolicy.yaml --kubeconfig /etc/karmada/karmada-apiserver.config |
7.4 Check the deployment status from Karmada
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
kubectl get po --kubeconfig /root/.kube/member1-config kubectl get po -A --kubeconfig /root/.kube/member2-config |
Reference
https://lazytoki.cn/index.php/archives/4/
...