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就不報錯了