Hi,
I am trying to use kubevirt-ansible to deploy an all-in-one single
node cluster with kubevirt (not reusing an existing cluster). I would
prefer plain kubernetes but openshift may also work for my needs.
What I am doing is this:
0. Install galaxy deps: ansible-galaxy install -p $HOME/galaxy-roles
-r requirements.yml && export ANSIBLE_ROLES_PATH=$HOME/galaxy-roles
1. Give the node a name in /etc/hosts (kubedev) for its ip address.
2. Configure password-less login.
3. Specify 'kubedev' for the following sections in inventory file:
masters, etcd, nodes, nfs.
4. ansible-playbook -i inventory playbooks/cluster/kubernetes/config.yml
This fails with:
TASK [kubernetes-master : deploy kubernetes]
*******************************************************************************************************************************************
Tuesday 27 November 2018 11:24:27 -0800 (0:00:02.423) 0:00:54.262 ******
fatal: [kubedev]: FAILED! => {
"changed": true,
"cmd": "/root/deploy_kubernetes.sh | grep \"kubeadm join\"",
"delta": "0:02:15.227363",
"end": "2018-11-27 11:26:43.711808",
"rc": 1,
"start": "2018-11-27 11:24:28.484445"
}
STDERR:
[WARNING Port-6443]: Port 6443 is in use
[WARNING Port-10251]: Port 10251 is in use
[WARNING Port-10252]: Port 10252 is in use
[WARNING
FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]:
/etc/kubernetes/manifests/kube-apiserver.yaml already exists
[WARNING
FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]:
/etc/kubernetes/manifests/kube-controller-manager.yaml already exists
[WARNING
FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml]:
/etc/kubernetes/manifests/kube-scheduler.yaml already exists
[WARNING FileAvailable--etc-kubernetes-manifests-etcd.yaml]:
/etc/kubernetes/manifests/etcd.yaml already exists
[WARNING Port-10250]: Port 10250 is in use
[WARNING Port-2379]: Port 2379 is in use
[WARNING DirAvailable--var-lib-etcd]: /var/lib/etcd is not empty
error marking master: timed out waiting for the condition
Error from server (AlreadyExists):
clusterrolebindings.rbac.authorization.k8s.io "add-on-cluster-admin"
already exists
Error from server (AlreadyExists):
clusterrolebindings.rbac.authorization.k8s.io "add-on-default-admin"
already exists
Kubelet journal suggests some issue with certificates:
Nov 27 11:40:51 kubedev dockerd-current[7820]: E1127 19:40:51.666783
1 authentication.go:62] Unable to authenticate the request due to
an error: [x509: certificate signed by unknown authority, x509:
certificate signed by unknown authority]
Nov 27 11:40:51 kubedev kubelet[14804]: E1127 11:40:51.667243 14804
reflector.go:134]
k8s.io/kubernetes/pkg/kubelet/config/apiserver.go:47: Failed to list
*v1.Pod: Unauthorized
Nov 27 11:40:51 kubedev dockerd-current[7820]: E1127 19:40:51.667516
1 authentication.go:62] Unable to authenticate the request due to
an error: [x509: certificate signed by unknown authority, x509:
certificate signed by unknown authority]
Nov 27 11:40:51 kubedev kubelet[14804]: E1127 11:40:51.667845 14804
reflector.go:134]
k8s.io/kubernetes/pkg/kubelet/kubelet.go:442: Failed
to list *v1.Service: Unauthorized
Nov 27 11:40:51 kubedev dockerd-current[7820]: E1127 19:40:51.668635
1 authentication.go:62] Unable to authenticate the request due to
an error: [x509: certificate signed by unknown authority, x509:
certificate signed by unknown authority]
Nov 27 11:40:51 kubedev kubelet[14804]: E1127 11:40:51.668963 14804
reflector.go:134]
k8s.io/kubernetes/pkg/kubelet/kubelet.go:451: Failed
to list *v1.Node: Unauthorized
Nov 27 11:40:51 kubedev kubelet[14804]: E1127 11:40:51.718960 14804
kubelet.go:2236] node "kubedev" not found
Ideas on what's going on here?
After that, I tried to take the OpenShift route, but am stuck on
incomplete instructions in README.md. Here is what I do.
1. Again, configure passwordless ssh and /etc/hosts.
2. For inventory file, do the same except for nodes section, I use an
example from the README: kubedev openshift_node_labels="{'region':
'infra','zone': 'default'}" openshift_schedulable=true
3. ansible-playbook -i inventory -e@vars/all.yml
playbooks/cluster/openshift/config.yml
This fails because of missing openshift-ansible modules, which makes sense:
ERROR! Unable to retrieve file contents
Could not find or access
'/home/ihar/kubevirt-ansible/playbooks/cluster/openshift/openshift-ansible/playbooks/prerequisites.yml'
So I check out the repo:
git clone -b release-3.10
https://github.com/openshift/openshift-ansible
Now, I should probably somehow register the new ansible module, so I tried this:
export ANSIBLE_ROLES_PATH=$HOME/galaxy-roles:./openshift-ansible/roles/
It still gives me the same error about missing prerequisites.yml file.
Now, perhaps I am just missing some basic background about how ansible
modules are installed and imported, but I am not sure I, as a kubevirt
developer, should necessarily care about these details. At least,
instructions should guide me, ideally giving me a one liner to deploy
an all in one. Now, granted, for OpenShift, README also suggests that
I should attach and configure an extra disk for docker storage plus
update container runtime settings, which I did not (again, because I
am missing some basic information about how to do it right). But
kubernetes option doesn't suggest any changes for that, and for
OpenShift it doesn't seem like the error I receive is anything related
to wrong CRI configuration (it fails at the very start, and doesn't
deploy a single container).
Thoughts on what I am doing wrong?
Ihar