Photo by Juan Gomez on Unsplash

DISCLAIMER: These are just some simple aliases I’ve setup in my CLI for my personal convenience while working with kubernetes / kubectl / minikube / kustomize / etc

# kubectl shortcuts
alias kc="kubectl"
alias kcg="kubectl get"
alias kcga="kubectl get --all-namespaces"
alias kcgy="kubectl get --output=yaml"
alias kcgw="kubectl get --output=wide"
alias kcge="kubectl get events"
alias kce="kubectl edit"
alias kcd="kubectl describe"
alias kcdel="kubectl delete"
alias kcl="kubectl logs"
alias kcx="kubectl exec -it"
alias kcvy="kubectl version -o=yaml"
alias kcpf="kubectl port-forward" # <localhost-port>:<remote-port>
alias kcrr="kubectl rollout restart deployment"
alias kcrs="kubectl rollout status deployment"
alias kck="kubectl kustomize"
alias kcneat="kubectl neat | yq"
alias kns="kubens"
alias kctx="kubectx"
alias kz="kustomize"
alias kdd="kubedd"

# minikube shortcuts
alias mkb="minikube"

# microk8s shortcuts
alias mks="microk8s"
alias mkc="microk8s kubectl"

# multipass shortcuts
alias mps="multipass"

Feel free to suggest more shortcuts (and “standards”) in the comments that are practiced by the people in the community.



Photo by Sixteen Miles Out on Unsplash

The Problem Statement

When there are any issues with a GCS (google cloud storage) bucket in GCP (google cloud platform), our teams / SREs / executives would almost always know (either or all of) the following info about the bucket:

  • bucket name
  • public URL
  • authenticated URL
  • gsutil URL
  • etc etc

However, from these info, it’s not clear which GCP project (out of the gazillion GCP projects in an organization account) owns the specific bucket.

The Solution

Step 1: Determine projectNumber
using the bucket API explorer
> Just add the bucket name into the bucket field of the form and leave everything else default as it is.

Step 2: Determine PROJECT_ID
using the ‘gcloud projects list’ command

gcloud projects list --filter="projectNumber:<PROJECT_NUMBER>"

Thus, you can find out the PROJECT_ID / PROJECT_NAME of the GCS bucket.




Syed Rakib Al Hasan

DevOps Engineer, Backend Developer, Cloud Architect, Night time drive-outs & nice hangouts