我家里有两台 CoreOS stable (1185.5.0) 服务器。我尝试在这两个上安装 kubernetes 控制器和工作者。
我使用 coreos-kubernetes 脚本从https://github.com/coreos/coreos-kubernetes/tree/master/multi-node/generic安装,并从https://github.com/kfirufk/coreos-kubernetes修补-多节点通用安装脚本。我rkt
用来运行相关的容器。
我使用以下环境变量选项覆盖文件:
ETCD_AUTHORITY=coreos-3.tux-in.com:2379
ETCD_ENDPOINTS="https://coreos-2.tux-in.com:2379,https://coreos-3.tux-in.com:2379"
CONTROLLER_ENDPOINT=https://coreos-2.tux-in.com
K8S_VER=v1.5.0-beta.3_coreos.0
HYPERKUBE_IMAGE_REPO=quay.io/coreos/hyperkube
DNS_SERVICE_IP=10.3.0.10
USE_CALICO=true
CONTAINER_RUNTIME=rkt
OVERWRITE_ALL_FILES=true
ADVERTISE_IP=10.79.218.3
ETCD_CERT_FILE="/etc/ssl/etcd/etcd2.pem"
ETCD_KEY_FILE="/etc/ssl/etcd/etcd2-key.pem"
ETCD_TRUSTED_CA_FILE="/etc/ssl/etcd/ca.pem"
ETCD_SCHEME="https"
IS_MASK_UPDATE_ENGINE=false
coreos-2.tux-in.com
解析为10.79.218.2
控制器节点。
coreos-3.tux-in.com
解析为10.79.218.3
工作节点。
控制器脚本似乎安装得很好。
当我尝试在第二台服务器上安装 kubernetes worker 时,我注意到 kubelet 日志中不断出现以下错误消息:
2016-12-12 12:24:08,171 6960 [kube-system/kubernetes-dashboard-v1.4.1-kjj0c] ERROR Unhandled Exception killed plugin
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: Traceback (most recent call last):
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: File "<string>", line 773, in main
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: File "<string>", line 64, in __init__
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: File "site-packages/pycalico/datastore.py", line 229, in __init__
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: DataStoreError: Invalid ETCD_CA_CERT_FILE. Certificate Authority cert is required and must be a readable file path. Value provided:
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: 2016-12-12 12:24:08,171 6960 [kube-system/kubernetes-dashboard-v1.4.1-kjj0c] ERROR CNI Error:
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: {
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: "msg": "Unhandled Exception killed plugin",
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: "cniVersion": "0.1.0",
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: "code": 100,
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: "details": null
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: }
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: Traceback (most recent call last):
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: File "<string>", line 773, in main
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: File "<string>", line 64, in __init__
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: File "site-packages/pycalico/datastore.py", line 229, in __init__
Dec 12 12:24:08 coreos-3.tux-in.com kubelet-wrapper[1786]: DataStoreError: Invalid ETCD_CA_CERT_FILE. Certificate Authority cert is required and must be a readable file path. Value provided:
Invalid ETCD_CA_CERT_FILE
错误信息显示提供的值为空,这表明由于某种原因未设置 ETCD_CA_CERT_FILE 环境变量。我尝试在[服务]下编辑/etc/systemd/system/kubelet.service
和添加Environment=ETCD_CA_CERT_FILE=/etc/ssl/etcd/ca.pem
,但结果是一样的。有任何想法吗 ?