配置 kubernetes

1711293058發表於2019-10-14

1. 匯出配置報錯

mkdir -p /usr/local/docker/kubernetes/
cd /usr/local/docker/kubernetes/
kubeadm config print init-defaults --kubeconfig ClusterConfiguration > kubeadm.yml

nodeRegistration.name: Invalid value: "kb_master": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

原因是 hostname 和 DNS 的解析規則不匹配,改掉自己的hostname就好了。

hostname
#kb_master 存在下劃線,不符合dns規則
hostnamectl set-hostname kbmaster
hostname
#kbmaster

相關文章