출처: https://docs.tigera.io/calico/3.25/getting-started/kubernetes/quickstart
Big picture
This quickstart gets you a single-host Kubernetes cluster with Calico in approximately 15 minutes.
Value
Use this quickstart to quickly and easily try Calico features. To deploy a cluster suitable for production, refer to Calico on Kubernetes.
Before you begin
Required
- A Linux host that meets the following requirements:
- x86-64, arm64, ppc64le, or s390x processor
- 2CPU
- 2GB RAM
- 10GB free disk space
- RedHat Enterprise Linux 7.x+, CentOS 7.x+, Ubuntu 18.04+, or Debian 9.x+
- Calico can manage cali and tunl interfaces on the host
- If NetworkManager is present on the host, see Configure NetworkManager.
Concepts
Operator based installation
This quickstart guide uses the Tigera operator to install Calico. The operator provides lifecycle management for Calico exposed via the Kubernetes API defined as a custom resource definition.
It is also possible to install Calico without an operator using Kubernetes manifests directly. For platforms and guides that do not use the Tigera operator, you may notice some differences in the steps and Kubernetes resources compared to those presented in this guide.
How to
The geeky details of what you get:
Calico | Calico | Calico | VXLAN | Calico | kubernetes |
Create a single-host Kubernetes cluster
- Follow the Kubernetes instructions to install kubeadm
-
NOTE
After installing kubeadm, do not power down or restart the host. Instead, continue directly to the next step.
- As a regular user with sudo privileges, open a terminal on the host that you installed kubeadm on.
- Initialize the control plane using the following command.
NOTE
If 192.168.0.0/16 is already in use within your network you must select a different pod network CIDR, replacing 192.168.0.0/16 in the above command.
-
sudo kubeadm init --pod-network-cidr=192.168.0.0/16
- Execute the following commands to configure kubectl (also returned by kubeadm init).
-
mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config
Install Calico
- Install the Tigera Calico operator and custom resource definitions.
NOTE
Due to the large size of the CRD bundle, kubectl apply might exceed request limits. Instead, use kubectl create or kubectl replace.
-
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/tigera-operator.yaml
- Install Calico by creating the necessary custom resource. For more information on configuration options available in this manifest, see the installation reference.
NOTE
Before creating this manifest, read its contents and make sure its settings are correct for your environment. For example, you may need to change the default IP pool CIDR to match your pod network CIDR.
-
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/custom-resources.yaml
- Confirm that all of the pods are running with the following command.Wait until each pod has the STATUS of Running.
-
NOTE
The Tigera operator installs resources in the calico-system namespace. Other install methods may use the kube-system namespace instead.
-
watch kubectl get pods -n calico-system
- Remove the taints on the control plane so that you can schedule pods on it.
kubectl taint nodes --all node-role.kubernetes.io/control-plane-
kubectl taint nodes --all node-role.kubernetes.io/master-
It should return the following.
node/<your-hostname> untainted
- Confirm that you now have a node in your cluster with the following command.It should return something like the following.
-
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME <your-hostname> Ready master 52m v1.12.2 10.128.0.28 <none> Ubuntu 18.04.1 LTS 4.15.0-1023-gcp docker://18.6.1
-
kubectl get nodes -o wide
Congratulations! You now have a single-host Kubernetes cluster with Calico.
'프로그램 활용 > 클라우드 가상화 도커' 카테고리의 다른 글
헷갈리는 Docker - 수정 (0) | 2023.08.04 |
---|---|
도커(Docker)로 생성된 웹페이지의 내용 변경방법 (0) | 2023.08.04 |
Install Kubernetes Master Node on Rocky Linux 9 (0) | 2023.08.03 |
kubernetes 설치 (0) | 2023.08.03 |
도커 Docker 이미지, 컨테이너 및 볼륨을 제거하는 방법 (0) | 2023.08.01 |