Minikube快速安装
useradd k8spasswd k8susermod -aG docker k8schmod u+w /etc/sudoersvim /etc/sudoerschmod u-w /etc/sudoersyum install -y yum-utils device-mapper-persistent-data lvm2yum-config-manager --add-repo http://m
·
sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config
grep --color=auto '^SELINUX' /etc/selinux/config
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=0
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
yum -y install docker-ce kubectl
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
install minikube-linux-amd64 /usr/local/bin/minikube
systemctl start docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://0k0953tv.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
useradd k8s
echo "123456" | passwd --stdin k8s
usermod -aG docker k8s
安装
su - k8s
minikube start --driver=docker \
--image-mirror-country=cn \
--registry-mirror=https://0k0953tv.mirror.aliyuncs.com \
--image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers \
--iso-url=https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.23.0.iso
自动补齐
echo "source <(kubectl completion bash)" >> ~/.bashrc
集群外部访问
kubectl port-forward --address='192.168.1.13' service/nginx-svc 8088:80
更多推荐
已为社区贡献82条内容
所有评论(0)