kubectl apply -f k8s/
kubectl get pods
kubectl get deployments
kubectl get pv # persistent volume
kubectl get pvc
kubectl get pods
kubectl exec -it ipengine-net-benchmark-488656591-gjrpc /bin/bash
kubectl exec -it ipengine-net-benchmark-488656591-gjrpc -c ipengine-net-benchmark-iperf-server /bin/bash
- If you have permission to your pod which is running a server on port 8000, run the following
kubectl get pods
kubectl port-forward ipengine-net-benchmark-488656591-gjrpc 8000:8000
kubectl logs ipengine-net-benchmark-488656591-gjrpc
- if you have multiple containers in a pod, use
-c
to specify
kubectl logs ipengine-net-benchmark-488656591-gjrpc -c ipengine-net-benchmark
kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* docker-desktop docker-desktop docker-desktop
kubectl config use-context docker-desktop
kubectl get namespace
kubectl create namespace my-namespace
kubectl delete namespace my-namespace
kubectl config set-context --current --namespace=my-namespace
kubectl get pods -n my-namespace
kubectl exec -n my-namespace -it ipengine-net-benchmark-488656591-gjrpc -- sh
kubectl wait --for=condition=complete --timeout=30s job/myjob
kubectl rollout status deployment/some-deployment