Step 1: kubectl get nodes
NAME STATUS ROLES AGE VERSION
docker-for-desktop Ready master 4h v1.10.11
Cannot find any nodes from the Kubenetes clusters I created on GCP console, why?
Step 2: kubectl apply -f ./ping-deploy.yml
error: the path "./ping-deploy.yml" does not exist
Pls help…cannot follow the demo…
all sorted, need to cd to the right directory in GCP
An option is:
Download Google Cloud SDK.
Once that is done you will have a "Cloud SDK" folder in your computer directory. If you are running windows it may be in C:UsersUser .
Save "your-file .yml" in that Cloud SDK folder.
In your Cloud SDK, be sure to run the "get-credentials" command. If your not sure what that is, run
"gcloud container clusters –help" to figure it out.
When you run the command "kubectl apply -f ./your-file.yml" from your downloaded Cloud SDK console it will locate the file.
I hope that helps, my apologies if the explanaition was bad. If I missed anything and/or there is a better way please share.
In Cloud Shell (within GCP):
-run ls in home directory
-Click More (top right-corner)
-Upload File (i.e. ping-deploy.yml)
-run ls in home directory (you should see ping-deploy.yml)
-run kubectl apply -f ping-deploy.yml
Proceed as normal.
Please let me know if you have any questions
Had the same problem in Google Cloud Platform with executing command "kubectl apply -f .ping-deploy.yml", although I had uploaded those files to my home directory and those were indeed there.
However, I managed to run this command successfully by leaving the " . "- notation out of the command.
For me the right command for this was "kubectl apply -f ping-deploy.yml". Hope this helps someone having similar difficulties. 🙂
You can also clone the git repo that has the files, so you don’t have to download and upload files as manually.
git clone https://github.com/ACloudGuru-Resources/Course_Kubernetes_Deep_Dive_NP.git
2) navigate to the directory of the file directory
3) run the
kubectl apply -f ping-deploy.yml