Root Login to Node01(worker) for kubenetes Setup

Hi All,
I am tasked to create PV with host path. for that i have to login to Worker node. I don’t the Login details for worker node so that i can ssh it from jumphost.
kubectl get nodes -owide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
controlplane Ready master 44m v1.19.0 172.17.0.21 Ubuntu 18.04.5 LTS 4.15.0-122-generic docker://19.3.13
node01 Ready 44m v1.19.0 172.17.0.22 Ubuntu 18.04.5 LTS 4.15.0-122-generic docker://19.3.13

ssh root@172.17.0.22
The authenticity of host ‘172.17.0.22 (172.17.0.22)’ can’t be established.
ECDSA key fingerprint is SHA256:sT4/25ncuNVMhOdbaCuK5fDsqu+Xyqoql4FGXzX576A.
ECDSA key fingerprint is MD5:d8:23:cb:58:93:52:78:15:f3:0b:7b:e8:a1:83:5f:8f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘172.17.0.22’ (ECDSA) to the list of known hosts.
root@172.17.0.22’s password:

could you please clarify to me what you asking for ?

i need password for root user on worker (node01).

Hello, @lalitjangra
We don’t require to login into node01. In PV hostPath, you can specify a “type” field.
In the “type” field, there is an option “DirectoryOrCreate”. If the directory doesn’t exist, it will create an empty directory and If it already exists then it’ll be ignored.
Reference:-
PV’ hostPath

thanks a lot it solved my issue

hi player001
thanks for sharing

1 Like

Hello, @KodeKloud
Welcome!! :+1: