1 前提准备

1.1 docker环境

参考地址:

https://docs.docker.com/engine/install/centos/
 sudo yum install -y yum-utils
 sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
    
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker

2 搭建k8s集群

2.1 使用 Minikube 尝鲜 Kubernetes

2.2 使用 Rancher 安装 Kubernetes

3 搭建TDengine集群

常见问题

问题1:启动minikube start 执行失败

在这里插入图片描述
解决方法:

[root@centos7 ~]# minikube start
* minikube v1.29.0 on Centos 7.9.2009
* Automatically selected the docker driver. Other choices: ssh, none
* The "docker" driver should not be used with root privileges. If you wish to continue as root, use --force.
* If you are running minikube within a VM, consider using --driver=none:
*   https://minikube.sigs.k8s.io/docs/reference/drivers/none/
X Exiting due to DRV_AS_ROOT: The "docker" driver should not be used with root privileges.

尝试执行minikube start --driver=none

[root@centos7 ~]# minikube start  --driver=none
* minikube v1.29.0 on Centos 7.9.2009
* Using the none driver based on user configuration

X Exiting due to GUEST_MISSING_CONNTRACK: Sorry, Kubernetes 1.26.1 requires conntrack to be installed in root's path
minikube start  --force

尝试

useradd test1
passwd test1 设置密码
su test1 切换用户

将test1添加到docker组

sudo usermod -aG docker $USER && newgrp docker

问题2:执行minikube start --driver=docker报错

X Exiting due to RSRC_INSUFFICIENT_CONTAINER_MEMORY: docker only has 1754MiB available, less than the required 1800MiB for Kubernetes

解决方法:
指定CPU的核数和内存的大小

# minikube start --extra-config=kubeadm.ignore-preflight-errors=NumCPU --force --cpus 1 --memory=1024mb --image-mirror-country='cn'

问题3:执行minikube start --force失败

在这里插入图片描述
解决方法:

问题4:执行minikube kubectl – get pods -A失败

在这里插入图片描述
解决方法:

问题5:执行minikube start --force --driver=docker报错

在这里插入图片描述

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐