码迷,mamicode.com
首页 > Windows程序 > 详细

k8s遇坑:The connection to the server k8s-api.virtual.local:6443 was refused - did you specify the right host or port?

时间:2019-01-30 13:05:22      阅读:2709      评论:0      收藏:0      [点我收藏+]

标签:sys   发布   pre   tor   集群   K8S集群   ref   csharp   use   

k8s坑The connection to the server localhost:8080 was refused - did you specify the right host or port
2019年01月08日 17:21:06 金柱 阅读数:47

定义一个mysql的RC文件:mysql-rc.yaml

apiVersion: v1
kind: ReplicationController
metadata:
  name: mysql
spec:
  replicas: 1
  selector:
    app: mysql
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - name: mysql
        image: mysql
        ports:
        - containerPort: 3306
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: "123456"



发布到k8s集群中

# kubectl create -f mysql-rc.yaml

    1
    2

报错:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

    1
    2

没有启动k8s集群或启动顺序不对,重新按一下顺序启动所有服务:

# systemctl start etcd
# systemctl start docker
# systemctl start kube-apiserver
# systemctl start kube-controller-manager
# systemctl start kube-scheduler
# systemctl start kubelet
# systemctl start kube-proxy



然后再发布mysql-rc.yaml就不报错了

 

k8s遇坑:The connection to the server k8s-api.virtual.local:6443 was refused - did you specify the right host or port?

标签:sys   发布   pre   tor   集群   K8S集群   ref   csharp   use   

原文地址:https://www.cnblogs.com/fuyuteng/p/10337354.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!