Hi All, Could someone let me know the command to create /kubernetes/data/index.html directory on a specific node with “HelloKubernetes” content in it? how to do this?
Use nodeName: name=-of-actual-node in the pod yaml
Mount a volume, then echo that text into the file?
Thank you @JohnC. i was thinking we can achieve this in 2-3 steps. Step 1: ssh <node-name>; Step 2: the command “mkdir /kubernetes/data/index.html” to create directory but how do we write the content(HelloKubernetes) into the directory?
you have a FILE as part of the directory in the mkdir
once the directory is created with mkdir:
echo “Hello Kubernetes” >> index.html
that will add the text to the file
Thanks @JohnC. i was under the impression that we need to create directory including file name and with the given content into that file. Thank you for the clarification.