Kubernetes(2)Docker and Quickstart
I already have the docker on my MAC, try to run redis
> docker run -d redis
> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
82800f7eb4cc redis "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 6379/tcp jolly_dubinsky
Enter that Redis docker
> docker exec -it 82800f7eb4cc /bin/bash
Once we are in that docker application, we can see the redis is running
> ps -ef | grep redis
redis 1 0 0 02:57 ? 00:00:00 redis-server *:6379
root 25 18 0 03:02 pts/0 00:00:00 grep redis
Get telnet back on my MAC
https://dor.ky/restore-telnet-in-mac-os-high-sierra-10-13/
> brew install telnet
Check if we can telnet to the Redis, No, because we did not mapping the port
> telnet localhost 6379
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
Stop and remove the Redis application
>docker stop 82800f7eb4cc
82800f7eb4cc
>docker rm 82800f7eb4cc
82800f7eb4cc
Dynamic mapping
> docker run -d -P redis
We can telnet then
> telnet localhost 32768
Trying ::1...
Connected to localhost.
Escape character is '^]'.
STATS
-ERR unknown command 'STATS'
QUIT
+OK
Connection closed by foreign host.
Or mapping as follow
> docker run -d -p 6379:6379 redis
> telnet localhost 6379
Trying ::1...
Connected to localhost.
Escape character is '^]'.
MONITOR
+OK
QUIT
+OK
Connection closed by foreign host.
Set Up Kubernetes
The configuration file is here
/Users/hluo/.kube/config
/Users/hluo/.kube/config-dev
/Users/hluo/.kube/config-stage
Config is the one for my local kubernetes, the dev is for company’s DEV, stage is for stage.
Change and Switch the Kube Config
> export KUBECONFIG=~/.kube/config-dev
> echo $KUBECONFIG
/Users/hluo/.kube/config-dev
Check the cluster info
> kubectl cluster-info
Start the proxy
> kubectl proxy
Starting to serve on 127.0.0.1:8001
Visit the UI
http://localhost:8001/ui
Hapened to delete the minikube in VirtualBox, restart that with these command
> rm -rf ~/.minikube
> minikube start
Check my Kubernetes
> export KUBECONFIG=~/.kube/config
> kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443
KubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
> kubectl proxy
Starting to serve on 127.0.0.1:8001
UI page is here
http://192.168.99.100:30000
Stop the local cluster
> minikube stop
References:
http://sillycat.iteye.com/blog/2415445
Kubernetes(2)Docker and Quickstart
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326070383&siteId=291194637
Ranking