You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
报错信息:
fatal: [192.168.0.30]: FAILED! => {"attempts": 5, "changed": true, "cmd": ["/opt/kube/bin/kubectl", "get", "node"], "delta": "0:00:00.101798", "end": "2018-08-15 09:58:04.305938", "msg": "non-zero return code", "rc": 1, "start": "2018-08-15 09:58:04.204140", "stderr": "The connection to the server 192.168.0.35:8443 was refused - did you specify the right host or port?", "stderr_lines": ["The connection to the server 192.168.0.35:8443 was refused - did you specify the right host or port?"], "stdout": "", "stdout_lines": []}
The text was updated successfully, but these errors were encountered:
hosts.m-masters.example
配置如下
部署节点:运行这份 ansible 脚本的节点
[deploy]
192.168.0.30
etcd集群请提供如下NODE_NAME,注意etcd集群必须是1,3,5,7...奇数个节点
[etcd]
192.168.0.30 NODE_NAME=etcd1
192.168.0.31 NODE_NAME=etcd2
192.168.0.32 NODE_NAME=etcd3
[kube-master]
192.168.0.30
192.168.0.31
负载均衡有且仅有两个节点,安装 haproxy+keepalived
[lb]
192.168.0.30 LB_IF="ens192" LB_ROLE=backup # 注意根据实际使用网卡设置 LB_IF变量
192.168.0.31 LB_IF="ens192" LB_ROLE=master
[kube-node]
192.168.0.32
192.168.0.33
如果启用harbor,请配置后面harbor相关参数
[harbor]
#192.168.1.8
预留组,后续添加master节点使用
[new-master]
#192.168.1.5
预留组,后续添加node节点使用
[new-node]
#192.168.1.xx
[all:vars]
---------集群主要参数---------------
#集群部署模式:allinone, single-master, multi-master
DEPLOY_MODE=multi-master
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11
K8S_VER="v1.11"
集群 MASTER IP即 LB节点VIP地址,为区别与默认apiserver端口,设置VIP监听的服务端口8443
公有云上请使用云负载均衡内网地址和监听端口
MASTER_IP="192.168.0.35"
KUBE_APISERVER="https://{{ MASTER_IP }}:8443"
#TLS Bootstrapping 使用的 Token,使用 head -c 16 /dev/urandom | od -An -t x | tr -d ' ' 生成
BOOTSTRAP_TOKEN="c30302226d4b810e08731702d3890f50"
集群网络插件,目前支持calico, flannel, kube-router, cilium
CLUSTER_NETWORK="flannel"
服务网段 (Service CIDR),注意不要与内网已有网段冲突
SERVICE_CIDR="10.68.0.0/16"
POD 网段 (Cluster CIDR),注意不要与内网已有网段冲突
CLUSTER_CIDR="172.20.0.0/16"
服务端口范围 (NodePort Range)
NODE_PORT_RANGE="20000-40000"
kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP)
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
CLUSTER_DNS_SVC_IP="10.68.0.2"
集群 DNS 域名
CLUSTER_DNS_DOMAIN="cluster.local."
etcd 集群间通信的IP和端口, 根据etcd组成员自动生成
TMP_NODES="{% for h in groups['etcd'] %}{{ hostvars[h]['NODE_NAME'] }}=https://{{ h }}:2380,{% endfor %}"
ETCD_NODES="{{ TMP_NODES.rstrip(',') }}"
etcd 集群服务地址列表, 根据etcd组成员自动生成
TMP_ENDPOINTS="{% for h in groups['etcd'] %}https://{{ h }}:2379,{% endfor %}"
ETCD_ENDPOINTS="{{ TMP_ENDPOINTS.rstrip(',') }}"
集群basic auth 使用的用户名和密码
BASIC_AUTH_USER="admin"
BASIC_AUTH_PASS="test1234"
---------附加参数--------------------
#默认二进制文件目录
bin_dir="/opt/kube/bin"
#证书目录
ca_dir="/etc/kubernetes/ssl"
#部署目录,即 ansible 工作目录,建议不要修改
base_dir="/etc/ansible"
#私有仓库 harbor服务器 (域名或者IP)
#HARBOR_IP="192.168.1.8"
#HARBOR_DOMAIN="harbor.yourdomain.com"
报错信息:
fatal: [192.168.0.30]: FAILED! => {"attempts": 5, "changed": true, "cmd": ["/opt/kube/bin/kubectl", "get", "node"], "delta": "0:00:00.101798", "end": "2018-08-15 09:58:04.305938", "msg": "non-zero return code", "rc": 1, "start": "2018-08-15 09:58:04.204140", "stderr": "The connection to the server 192.168.0.35:8443 was refused - did you specify the right host or port?", "stderr_lines": ["The connection to the server 192.168.0.35:8443 was refused - did you specify the right host or port?"], "stdout": "", "stdout_lines": []}
The text was updated successfully, but these errors were encountered: