Skip to content

Instantly share code, notes, and snippets.

View matheus-goncalves's full-sized avatar

Matheus Gonçalves matheus-goncalves

View GitHub Profile
#It's a list of objects, so let's display the pod names
kubectl get pods -l app=hello-world -o jsonpath='{ .items[*].metadata.name }'
#Display all pods names, this will put the new line at the end of the set rather then on each object output to screen.
#Additional tips on formatting code in the examples below including adding a new line after each object
kubectl get pods -l app=hello-world -o jsonpath='{ .items[*].metadata.name }{"\n"}'
#It's a list of objects, so let's display the first (zero'th) pod from the output
@matheus-goncalves
matheus-goncalves / Docker Cheat Sheet
Last active April 26, 2021 18:11
Docker Cheat Sheet
Basics
# docker container run hello-world
# docker image ls
# docker ps
# docker container ls
# docker container ls -a
# docker container run -ti centos:7
# docker container run -ti ubuntu
# docker container -d nginx
# docker container attach [CONTAINER ID]
@matheus-goncalves
matheus-goncalves / kubectl commands
Last active March 23, 2021 20:21
Kubectl commands storage
DEBUG
kubectl get pods -n “namespace”
kubectl get services
kubectl get pods -n “namespace ”-o wide
kubectl logs {pod-name}
kubectl exec -it {pod-name} -- bin/bash
get all pods from all namespaces
kubectl get all -n namespace
kubectl describe endpoins