FreeBSD/k8s/apps/deploy-pyserver.txt

26 lines
745 B
Plaintext
Raw Permalink Normal View History

2021-04-20 12:34:43 -07:00
cd pyserver
docker build -t localhost:5000/pyserver:0.1 -f Dockerfile .
# docker build -t sahlawat/pyserver:0.1 -f Dockerfile .
docker run -it -p 8080:8080 --rm localhost:5000/pyserver:0.1
# curl localhost:8080
# docker run -d -p 8080:8080 diyit/pyserver:0.1
docker push localhost:5000/pyserver:0.1
kubectl create namespace demo
kubectl config set-context --current --namespace=demo
kubectl create deployment myapp --image=localhost:5000/pyserver:0.1
kubectl expose deployment myapp --port=8080 --type=LoadBalancer
# kubectl get service
# kubectl get all
# curl 172.18.255.200:8080
kubectl scale deployment myapp --replicas=3
# kubectl get service
kubectl delete service myapp
kubectl delete deployment myapp
kubectl delete namespace/demo