Skip to content

Instantly share code, notes, and snippets.

@geek182
Last active February 22, 2018 19:46
Show Gist options
  • Select an option

  • Save geek182/08142d29837c1dcc1add701ea827d437 to your computer and use it in GitHub Desktop.

Select an option

Save geek182/08142d29837c1dcc1add701ea827d437 to your computer and use it in GitHub Desktop.

Revisions

  1. geek182 revised this gist Feb 22, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -21,3 +21,6 @@ kubectl delete deployment NAME-OF-DEPLOY

    #Forward port to pod, useful for troubleshooting, local-port->pod-port
    kubectl port-forward POD-NAME 10080:80

    #Run a deployment with spefic image repository
    kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080
  2. geek182 revised this gist Feb 21, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,5 @@ kubectl get services --watch
    #delete a deployment
    kubectl delete deployment NAME-OF-DEPLOY

    #Forward port to pod, useful for troubleshooting, local-port->port-port
    #Forward port to pod, useful for troubleshooting, local-port->pod-port
    kubectl port-forward POD-NAME 10080:80
  3. geek182 revised this gist Feb 21, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -18,3 +18,6 @@ kubectl get services --watch

    #delete a deployment
    kubectl delete deployment NAME-OF-DEPLOY

    #Forward port to pod, useful for troubleshooting, local-port->port-port
    kubectl port-forward POD-NAME 10080:80
  4. geek182 revised this gist Feb 20, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    #get logs from a spefic pod and keep reading with -f flag
    kubectl logs -f pod/ghost-1-wjf6m

    #Connect to a pod
    kubectl exec POD-NAME --stdin --tty /bin/sh

    #execute a command in container, if have more than one inside pod first will be select.
    kubectl exec 123456-7890 date

    @@ -14,4 +17,4 @@ kubectl get pod -o wide
    kubectl get services --watch

    #delete a deployment
    kubectl delete deployment NAME-OF-DEPLOY
    kubectl delete deployment NAME-OF-DEPLOY
  5. geek182 revised this gist Feb 20, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,7 @@ kubectl logs -f pod/ghost-1-wjf6m
    kubectl get pod -o wide

    #get service details and keep update in screen
    kubectl get services --watch
    kubectl get services --watch

    #delete a deployment
    kubectl delete deployment NAME-OF-DEPLOY
  6. geek182 revised this gist Feb 20, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,7 @@ kubectl logs -f pod/ghost-1-wjf6m
    kubectl exec 123456-7890 -c ruby-container date

    #get pod details
    kubectl get pod -o wide
    kubectl get pod -o wide

    #get service details and keep update in screen
    kubectl get services --watch
  7. geek182 revised this gist Feb 20, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,7 @@ kubectl logs -f pod/ghost-1-wjf6m
    kubectl exec 123456-7890 date

    #Get output from running 'date' in ruby-container from pod 123456-7890
    kubectl exec 123456-7890 -c ruby-container date
    kubectl exec 123456-7890 -c ruby-container date

    #get pod details
    kubectl get pod -o wide
  8. geek182 revised this gist Feb 20, 2018. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,8 @@
    #get logs from a spefic pod and keep reading with -f flag
    kubectl logs -f pod/ghost-1-wjf6m
    kubectl logs -f pod/ghost-1-wjf6m

    #execute a command in container, if have more than one inside pod first will be select.
    kubectl exec 123456-7890 date

    #Get output from running 'date' in ruby-container from pod 123456-7890
    kubectl exec 123456-7890 -c ruby-container date
  9. geek182 created this gist Feb 20, 2018.
    2 changes: 2 additions & 0 deletions kubernetes-survival-kit
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    #get logs from a spefic pod and keep reading with -f flag
    kubectl logs -f pod/ghost-1-wjf6m