Skip to content

Instantly share code, notes, and snippets.

@tonyyang-svail
Last active September 21, 2018 00:09
Show Gist options
  • Save tonyyang-svail/87f4666ceb81e223557c3b3a221b5fc1 to your computer and use it in GitHub Desktop.
Save tonyyang-svail/87f4666ceb81e223557c3b3a221b5fc1 to your computer and use it in GitHub Desktop.

Start a pod:

kubectl run $POD_NAME --image=$IMAGE_NAME --port=$PORT_NUMBER --image-pull-policy=Never

Get stdout of POD/CONTAINER

kubectl logs two-ubuntu-bash bash1

Attach a bash session in the Pod’s container:

# kubectl exec POD [-c CONTAINER] -- COMMAND [args...]
kubectl exec -it $POD_NAME bash

Web UI (Dashboard)

http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
@tonyyang-svail
Copy link
Author

minikube start --vm-driver=virtualbox

@tonyyang-svail
Copy link
Author

apiVersion: v1
kind: Pod
metadata:
    name: two-ubuntu-bash
spec:
    containers:
    - name: bash1
      image: ubuntu:14.04
      command: ["/bin/sh"]
      args: ["-c", "while true; do echo hello; sleep 10;done"]
    - name: bash2
      image: ubuntu:14.04
      command: ["/bin/sh"]
      args: ["-c", "while true; do echo hello; sleep 10;done"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment