...
- $Env:POD_NAME=$(kubectl get pods -o go-template --template '{{range .item}}{{.metadata.name}}{{end}}')
- echo $Env:POD_NAME
- curl http://localhost:8001/api/v1/namespaces/default/pods/$Env:POD_NAME/proxy/
Developing a microservice
When you start minikube using the command minikube start
, it will create a cluster of 1.
Kubernetes Deployment
A Kubernetes Pod is a group of one or more Containers, tied together for the purposes of administration and networking. The Pod in the online tutorial has only one Container. A Kubernetes Deployment checks on the health of your Pod and restarts the Pod’s Container if it terminates. Deployments are the recommended way to manage the creation and scaling of Pods.
Use the kubectl create
command to create a Deployment that manages a Pod. The Pod runs a Container based on the provided Docker image.
Code Block | ||||
---|---|---|---|---|
| ||||
kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node |
Creating a Service
By default, the Pod is only accessible by its internal IP address within the Kubernetes cluster. To make the hello-node
Container accessible from outside the Kubernetes virtual network, you have to expose the Pod as a Kubernetes Service.