1、minikube安装
curl-LOhttps://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
其中“minikube-linux-amd64”就是个.file文件,通过install 编译到bin目录下。
2、kubectl安装
2.1 安装
curl-LO"https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
2.2 验证
curl-LO"https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
echo"$(cat kubectl.sha256) kubectl" | sha256sum --check
3、容器运行时安装
3.1 必须组件和key
Update the apt
package index and install packages to allow apt
to use a repository over HTTPS:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
Add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Use the following command to set up the repository:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"(. /etc/os-release && echo "(. /etc/os-release && echo "(. /etc/os-release && echo "VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
3.2 Install Docker Engine
1、sudo apt-get update
2、Install Docker Engine, containerd, and Docker Compose.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
3、Verify that the Docker Engine installation is successful by running the hello-world
image.
docker run hello-world
4、增加权限
sudo usermod -aG docker $USER && newgrp docker
3.3 安装kustomize
kustomize是kubectl原生支持的功能,不用安装也可以。
The following script detects your OS and downloads the appropriate kustomize binary to your current working directory.
curl-s"https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash