Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active August 4, 2022 15:50
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save vfarcic/d860631d0dd3158c32740e9260c7add0 to your computer and use it in GitHub Desktop.
Save vfarcic/d860631d0dd3158c32740e9260c7add0 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/d860631d0dd3158c32740e9260c7add0
minikube start --vm-driver=virtualbox
kubectl get nodes
git clone https://github.com/vfarcic/k8s-specs.git
cd k8s-specs
kubectl run db --image mongo
kubectl get pods
kubectl get pods
eval $(minikube docker-env)
docker container ls -f ancestor=mongo
kubectl delete pod db
cat pod/db.yml
kubectl create -f pod/db.yml
kubectl get pods
kubectl get pods -o wide
kubectl get pods -o json
kubectl get pods -o yaml
kubectl describe pod db
kubectl describe -f pod/db.yml
kubectl exec db ps aux
kubectl exec -it db sh
echo 'db.stats()' | mongo localhost:27017/test
exit
kubectl logs db
kubectl exec -it db pkill mongod
kubectl get pods
kubectl delete -f pod/db.yml
kubectl get pods
kubectl get pods
cat pod/go-demo-2.yml
kubectl create -f pod/go-demo-2.yml
kubectl get -f pod/go-demo-2.yml
kubectl get -f pod/go-demo-2.yml -o json
kubectl get -f pod/go-demo-2.yml \
-o jsonpath="{.spec.containers[*].name}"
kubectl exec -it -c db go-demo-2 ps aux
kubectl logs go-demo-2 -c db
cat pod/go-demo-2-scaled.yml
kubectl delete -f pod/go-demo-2.yml
cat pod/go-demo-2-health.yml
kubectl create \
-f pod/go-demo-2-health.yml
kubectl describe \
-f pod/go-demo-2-health.yml
minikube delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment