WSL2 - How to use Kind Cluster with ansible in Clara Deploy SDK?

Dear’s

I do not want to give up!

** Is this solution possible?**

Reference:
[How to use Kind Cluster with ansible in Clara Deploy SDK?] (kind – Using WSL2)

Who can help me, I appreciate it!

diyander@Ander:~/bin/ansible$ cd ~/bin/ansible/playbooks/
diyander@Ander:~/bin/ansible/playbooks$ sudo ansible-playbook -K clara.yml
BECOME password: 

PLAY [localhost] *********************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************
ok: [127.0.0.1]

TASK [Install Nvidia Docker] *********************************************************************************************************************

TASK [install-nvidia-docker : Install Docker CE] *************************************************************************************************
included: /home/diyander/bin/ansible/playbooks/roles/install-nvidia-docker/tasks/install-docker-ce.yml for 127.0.0.1

TASK [install-nvidia-docker : Add package ca-certificates before adding GPG keys] ****************************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Add apt package apt-transport-https before adding GPG keys] ********************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Add Docker CE GPG Apt Key (Ubuntu)] ********************************************************************************
skipping: [127.0.0.1]

TASK [install-nvidia-docker : Add Docker CE Repository (Bionic)] *********************************************************************************
skipping: [127.0.0.1]

TASK [install-nvidia-docker : Update apt and Install Docker CE on Bionic] ************************************************************************
skipping: [127.0.0.1]

TASK [install-nvidia-docker : Update apt and Install Docker.io on Focal] *************************************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Add the user to Docker group] **************************************************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Install Nvidia Docker 2] *******************************************************************************************
included: /home/diyander/bin/ansible/playbooks/roles/install-nvidia-docker/tasks/install-nvidia-docker.yml for 127.0.0.1

TASK [install-nvidia-docker : Add Repository Key] ************************************************************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Add Repository Source] *********************************************************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Install Nvidia Docker 2] *******************************************************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Update daemon.json with NVIDIA as Default Runtime] *****************************************************************
ok: [127.0.0.1]

TASK [install-nvidia-docker : Reload Docker Configuration] ***************************************************************************************
skipping: [127.0.0.1]

TASK [Install Kubernetes Configured for Clara] ***************************************************************************************************

TASK [install-kubernetes : Turn Swap Off] ********************************************************************************************************
included: /home/diyander/bin/ansible/playbooks/roles/install-kubernetes/tasks/swapoff.yml for 127.0.0.1

TASK [install-kubernetes : Remove swapfile from /etc/fstab] **************************************************************************************
ok: [127.0.0.1] => (item=swap)
ok: [127.0.0.1] => (item=none)

TASK [install-kubernetes : check swap] ***********************************************************************************************************
ok: [127.0.0.1]

TASK [install-kubernetes : Install Kubernetes] ***************************************************************************************************
included: /home/diyander/bin/ansible/playbooks/roles/install-kubernetes/tasks/install-kubernetes.yml for 127.0.0.1

TASK [install-kubernetes : Add K8s GPG apt Key] **************************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Add Kubernetes Repository] ********************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Update apt and Install kubelet] ***************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Hold kubelet at current version] **************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Update apt and Install kubeadm] ***************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Hold kubeadm at current version] **************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Update apt and Install kubectl] ***************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Hold kubectl at current version] **************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Copy Kubernetes Files to Remote Host] *********************************************************************************
changed: [127.0.0.1] => (item=kube-flannel-rbac.yml)

TASK [install-kubernetes : Add kube-flannel template] ********************************************************************************************
changed: [127.0.0.1]

TASK [install-kubernetes : Check if Kubernetes is initialized] ***********************************************************************************
ok: [127.0.0.1]

TASK [install-kubernetes : Check if Kubernetes has been initiated] *******************************************************************************
skipping: [127.0.0.1]

TASK [install-kubernetes : Initialize kubeadm] ***************************************************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": "kubeadm init --pod-network-cidr=\"10.254.0.0/16\" --apiserver-cert-extra-sans=\"172.26.254.60\" --log-file=/tmp/kubernetes_init.log", "delta": "0:00:01.690996", "end": "2021-10-14 17:18:15.505140", "msg": "non-zero return code", "rc": 1, "start": "2021-10-14 17:18:13.814144", "stderr": "I1014 17:18:14.721488    7141 version.go:252] remote version is much newer: v1.22.2; falling back to: stable-1.19\nW1014 17:18:15.201733    7141 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]\n\t[WARNING IsDockerSystemdCheck]: detected \"cgroupfs\" as the Docker cgroup driver. The recommended driver is \"systemd\". Please follow the guide at https://kubernetes.io/docs/setup/cri/\n\t[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.8. Latest validated version: 19.03\nerror execution phase preflight: [preflight] Some fatal errors occurred:\n\t[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'\n\t[ERROR Swap]: running with swap on is not supported. Please disable swap\n[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`\nTo see the stack trace of this error execute with --v=5 or higher", "stderr_lines": ["I1014 17:18:14.721488    7141 version.go:252] remote version is much newer: v1.22.2; falling back to: stable-1.19", "W1014 17:18:15.201733    7141 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]", "\t[WARNING IsDockerSystemdCheck]: detected \"cgroupfs\" as the Docker cgroup driver. The recommended driver is \"systemd\". Please follow the guide at https://kubernetes.io/docs/setup/cri/", "\t[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.8. Latest validated version: 19.03", "error execution phase preflight: [preflight] Some fatal errors occurred:", "\t[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'", "\t[ERROR Swap]: running with swap on is not supported. Please disable swap", "[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`", "To see the stack trace of this error execute with --v=5 or higher"], "stdout": "[init] Using Kubernetes version: v1.19.15\n[preflight] Running pre-flight checks", "stdout_lines": ["[init] Using Kubernetes version: v1.19.15", "[preflight] Running pre-flight checks"]}

PLAY RECAP ***************************************************************************************************************************************
127.0.0.1                  : ok=26   changed=10   unreachable=0    failed=1    skipped=5    rescued=0    ignored=0

My Configuration:

Attached GPUs : 1
GPU 00000000:01:00.0
Product Name : NVIDIA GeForce RTX 2070 SUPER
Product Brand : GeForce
Windows 11 pro version 21H2 build 22000.194
WSL2 - Distributor ID: Ubuntu - Description: Ubuntu 20.04.3 LTS - Release: 20.04
Docker Desktop version 4.1.0
ansible [core 2.11.6]

Best Regards
@diyanderson

Hi, @Developer_Nvidia

I do not know where to start…

Problems list:

1. fatal: [127.0.0.1]: FAILED! => {"changed": true
2. cmd: "kubeadm init --pod-network-cidr=\"10.254.0.0/16\" --apiserver-cert-extra-sans=\"172.19.24.83\" --log-file=/tmp/kubernetes_init.log"
3. delta: "0:00:01.521669"
4. end: "2021-10-17 21:17:25.400549"
5. msg: "non-zero return code"
6. rc: 1
7. start: "2021-10-17 21:17:23.878880"
8. stderr: "I1017 21:17:24.608686   17243 version.go:252] remote version is much newer: v1.22.2; falling back to: stable-1.19\nW1017 21:17:25.102806   17243 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]\n\t[WARNING IsDockerSystemdCheck]: detected \"cgroupfs\" as the Docker cgroup driver. The recommended driver is \"systemd\". Please follow the guide at https://kubernetes.io/docs/setup/cri/\n\t[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.8. Latest validated version: 19.03\nerror execution phase preflight: [preflight] Some fatal errors occurred:\n\t[ERROR Port-6443]: Port 6443 is in use\n\t[ERROR Service-Docker]: docker service is not active
9. please run 'systemctl start docker.service'\n\t[ERROR Swap]: running with swap on is not supported. Please disable swap\n[preflight] If you know what you are doing
10. you can make a check non-fatal with `--ignore-preflight-errors=...`\nTo see the stack trace of this error execute with --v=5 or higher"
11. stderr_lines: ["I1017 21:17:24.608686   17243 version.go:252] remote version is much newer: v1.22.2; falling back to: stable-1.19"
12. W1017 21:17:25.102806   17243 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
13. \t[WARNING IsDockerSystemdCheck]: detected \cgroupfs\" as the Docker cgroup driver. The recommended driver is \"systemd\". Please follow the guide at https://kubernetes.io/docs/setup/cri/"
14. \t[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.8. Latest validated version: 19.03
15. error execution phase preflight: [preflight] Some fatal errors occurred:
16. \t[ERROR Port-6443]: Port 6443 is in use
17. \t[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
18. \t[ERROR Swap]: running with swap on is not supported. Please disable swap
19. [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
20. To see the stack trace of this error execute with --v=5 or higher]
21. stdout: "[init] Using Kubernetes version: v1.19.15\n[preflight] Running pre-flight checks"
22. stdout_lines: ["[init] Using Kubernetes version: v1.19.15"
23. [preflight] Running pre-flight checks]}

Best Regards.
@diyanderson

Hello @diyanderson

Thank you for your interest in Clara Deploy. Unfortunately WSL/WSL2 is not a supported or tested Clara Deploy configuration. However, from the log; it seems there’s an issue with the docker services not being active and swap enabled. In addition, there appears to be a port (6443) conflict?

1 Like

Thanks, @aquraini

why a guide
Cuda WSL/WSL2, not to use …

I would be very happy for an attention from NVIDIA to my need, maybe it is not in your interest to perform the tests on the Windows WSL platform, but as a novice developer and NVIDIA customer, I would kindly ask for a guide to this new tool that allows for better integration of development.

Best Regards
@diyanderson

The error itself is complaining that you already have Kubernetes 1.22.x installed, but Clara Deploy requires Kubernetes 1.19.2 to function.

You might say to yourself “but, why can’t Clara Deploy work with 1.19.2 or newer?”, and the answer is simply:

Kubernetes broke their own API contract between 1.19.2 and 1.20.x which prevents Clara from being able to deploy into a cluster based on 1.22.x.

1 Like