Here is the sample code with calling docker client and show the info the browser.
Visit http://localhost:4000
Kubernetes API
First two cases we ran docker as barebone deamon. Here we will run docker image on Kubernetes
Intall docker(if not installed), Intall Virtual Box
install kubectl; Using the Google Cloud SDK: gcloud components install kubectl Or, Using Homebrew package manager: brew install kubectl
install minikube. For MAC: brew cask install minikube and start byminikube start
For this blog to run on Minikube in my local machine, I ran kubectl config use-context minikube eval $(minikube docker-env) docker build -t jenkins-react-blog . kubectl run jenkins-react-blog --image=jenkins-react-blog --image-pull-policy=Never --port=3001 kubectl expose deployment jenkins-react-blog --type=LoadBalancer minikube service jenkins-react-blog
The easiest way to access Kubernetes API is to configure a proxy. The command iskubectl proxy --port=8000 Visit http://localhost:8000/swagger-ui/ from the browser to access Swagger APIs
There are command lines to call Kubernetes API and a Flask template generated UI to show my image info in the browser about the images running on Minikube Kubernetes Cluster
Visit localhost with correct port
A good post about using Python client and Here is a post about developing kubernetes friendly containerized application
0 Comments