![IP-Kubespray konfigurieren: „msg“: „IPv4: ‚[‘…….‘]‘ und IPv6: ‚[‘f…….‘]‘ enthalten nicht ‚…….‘“](https://rvso.com/image/789360/IP-Kubespray%20konfigurieren%3A%20%E2%80%9Emsg%E2%80%9C%3A%20%E2%80%9EIPv4%3A%20%E2%80%9A%5B%E2%80%98%E2%80%A6%E2%80%A6.%E2%80%98%5D%E2%80%98%20und%20IPv6%3A%20%E2%80%9A%5B%E2%80%98f%E2%80%A6%E2%80%A6.%E2%80%98%5D%E2%80%98%20enthalten%20nicht%20%E2%80%9A%E2%80%A6%E2%80%A6.%E2%80%98%E2%80%9C.png)
Ich möchte Kubernetes mit Kubespray auf Oracle Cloud-VMs installieren. Ich habe diese Schritte ausprobiert:
apt install python3-pip
git clone https://github.com/kubernetes-sigs/kubespray
cd kubespray
git checkout master #if you want to change version
sudo pip3 install -r requirements.txt
cp -rfp inventory/sample inventory/mycluster
declare -a IPS=(192.168.1.24 192.168.1.25 192.168.1.26)
CONFIG_FILE=inventory/mycluster/hosts.yaml python3 contrib/inventory_builder/inventory.py ${IPS[@]}
vi inventory/mycluster/hosts.yaml
ansible-playbook -i inventory/mycluster/hosts.yaml --become --become-user=root cluster.yml
In der Oracle-Cloud hat jede VM eine private IP, z. B. 10.0.0.x und eine öffentliche 141.147.3.x. Während der Ausführung von Kubespray erhalte ich diesen Fehler:
fatal: [node1]: FAILED! => {
"assertion": "(ip in ansible_all_ipv4_addresses) or (ip in ansible_all_ipv6_addresses)",
"changed": false,
"evaluated_to": false,
"msg": "IPv4: '['10.0.0.x']' and IPv6: '['........']' do not contain '141.147.3.x'"
}
In der Clusterdatei habe ich diese Konfiguration:
all:
hosts:
node1:
ansible_host: 192.168.1.24
ip: 192.168.1.24
access_ip: 192.168.1.24
node2:
ansible_host: 192.168.1.25
ip: 192.168.1.25
access_ip: 192.168.1.25
node3:
ansible_host: 192.168.1.26
ip: 192.168.1.26
access_ip: 192.168.1.26
children:
kube_control_plane:
hosts:
node1:
kube_node:
hosts:
node2:
node3:
etcd:
hosts:
node1:
node2:
node3:
k8s_cluster:
children:
kube_control_plane:
kube_node:
calico_rr:
hosts: {}
- Dies sind nur Beispiel-IPs
Wissen Sie, wie ich dieses Problem lösen kann?