我试了好几次,搜索了很多次,但不知道为什么我的吊舱仍然处于待定状态。
我有一个非常简单的docker-compose.yml文件如下所示:
version: '3'
services:
nginx:
build: .
container_name: "something_cool"
ports:
- '80:80'并使用kompose命令将其转换为Kubernetes语法,因此它创建了两个deployment和service文件,如下所示。
部署:
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.22.0 (955b78124)
creationTimestamp: null
labels:
io.kompose.service: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: nginx
strategy: {}
template:
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.22.0 (955b78124)
creationTimestamp: null
labels:
io.kompose.service: nginx
spec:
containers:
- image: nginx
name: something-cool
ports:
- containerPort: 80
resources: {}
restartPolicy: Always
status: {}服务:
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.22.0 (955b78124)
creationTimestamp: null
labels:
io.kompose.service: nginx
name: nginx
spec:
ports:
- name: "80"
port: 80
targetPort: 80
selector:
io.kompose.service: nginx
status:
loadBalancer: {}现在,当我运行kubectl apply -k .时,我看到了service/nginx configured和deployment.apps/nginx configured,但是kubectl get pods以挂起的状态显示它。
这是在事件中庆祝荚名的结果:
6s Warning FailedScheduling pod/nginx-77546f7866-j5gmd 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 node(s) had taint {node.kubernetes.io/unreachable: }, that the pod didn't tolerate.
4m4s Warning FailedScheduling pod/nginx-77546f7866-j5gmd 0/3 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 2 node(s) had taint {node.kubernetes.io/unreachable: }, that the pod didn't tolerate.
5m6s Normal SuccessfulCreate replicaset/nginx-77546f7866 Created pod: nginx-77546f7866-j5gmd如果我是正确的,我看到我可以平和nslookup kubernetes.io好,但我不知道为什么我要得到这个错误。
发布于 2021-05-25 11:12:22
我首先通过以下方式重新设置库伯奈特人来解决这个问题:
kubeadm resetrm ~/.kube/configkubeadm init --pod-network-cidr=10.244.0.0/16kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.ymlkubectl apply -k .https://stackoverflow.com/questions/67683671
复制相似问题