- Build a custom docker image using Dockerfile:
docker build -t python/server .
- Test the image:
docker run -i -t -p 8000:8000 python/server
curl http://localhost:8000
- Deploy on Kubernetes
kubectl create -f myapp.yaml
- Look around:
[dims@ubuntu-brix 17:30] ~/Downloads ⟩ kubectl get pods
NAME READY STATUS RESTARTS AGE
myapp-jxd9f 1/1 Running 0 47s
[dims@ubuntu-brix 17:30] ~/Downloads ⟩ kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.0.0.1 <none> 443/TCP 3h
myappsvc 10.0.0.74 nodes 8000/TCP 52s
[dims@ubuntu-brix 17:30] ~/Downloads ⟩ kubectl get replicationcontrollers
NAME DESIRED CURRENT AGE
myapp 1 1 56s
- Test the app:
curl -kvs 10.0.0.74:8000
- Alternate to step #3:
kubectl run myapp-node --image=python/server --port=8000
kubectl expose deployment myapp-node --port=8000 --name=myapp-node-http
kubectl describe pods
Where do you actually store your custom images for use with Kubernetes?