katacoda-scenarios/kubernetes-bootcamp-scenarios

Module 3 cannot be fully followed on a local minikube because of "hidden" command

Closed this issue · 1 comments

Issue

I am totally inexperienced with kubernetes at this point. I followed the getting started instructions and read through part of the concepts and tasks documentation before trying the tutorials.
In the hello-node tutorial a note mentions

If you installed Minikube locally, run minikube start.
hinting that one can follow the tutorial(s) locally. This worked fine for kubernetes basics module 1 and 2 and broke in module 3.

The init of module 3 runs

kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080

which bind the containers 8080 port and makes it exposable through the proxy.

The kubectl run command is not shown in the previous 2 modules which use instead:

kubectl create kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 

Unfortunately running kubctl create with this image does not expose port 8080 on the container, thus users following on a local minikube install get a 502 error trying to access the app through the proxy because the container cannot be reached.

For users curious enough to make it to this repo, manually running the kubctl run ... command locally yields the following warning:

kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080        [1]
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/kubernetes-bootcamp created

No option to set the port seems to exist for kubectl create

I am now confused as to how I can avoid the deprecation warning and still get operational containers (though additional research leads to declarative yaml descriptor files which haven't been broached in the tutorials though they were extensively mentionned in the concepts documentation)

Environment information

>cat /etc/lsb-release                                                                                       
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.10
DISTRIB_CODENAME=eoan
DISTRIB_DESCRIPTION="Ubuntu 19.10"
> kubectl version                                                                                       
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.3", GitCommit:"06ad960bfd03b39c8310aaf92d1e7c12ce618213", GitTreeState:"clean", BuildDate:"2020-02-12T13:43:46Z", GoVersion:"go1.13.7", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:22:30Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
> minikube version                                                                                           
minikube version: v1.7.2
commit: 50d543b5fcb0e1c0d7c27b1398a9a9790df09dfb

Thanks. This has been resolved and closing to cleanup.