1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| kubectl run test-postfix --restart='Never' --image postfix:1.1 --command -- sleep infinity kubectl exec -it test-postfix -- bash kubectl delete pod test-postfix --force
docker run -d --restart=always -e DOMAIN=cluster --name nginx-app -p 80:80 nginx kubectl run --image=nginx nginx-app --port=80 --env="DOMAIN=cluster"
docker exec nginx-app cat /etc/hostname kubectl exec nginx-app -- cat /etc/hostname
docker exec -it nginx-app /bin/sh kubectl exec -it nginx-app -- /bin/sh
docker logs -f --tail 100 nginx-app kubectl logs -f --tail 100 nginx-app
docker stop nginx-app && docker rm -f nginx-app kubectl delete pod nginx-app --force
docker run -itd --name redis \ -p 6379:6379 \ -v /tmp/data:/data \ --env foo=bar \ redis:5.0.14-alpine --requirepass "123456"
kubectl run test-redis \ --image=redis:5.0.14-alpine \ --restart=Never \ --port=6379 \ --env="foo=bar" \ -- --requirepass "123456"
|