Giter Club home page Giter Club logo

alias-kubectl's Introduction

Kubectl alias

List of alias I found useful when running the kubectl command.

Feel free to suggest any other aliases ๐Ÿค“

Convention

<kubectl> <command> <kind>

e.g.

  • kubectl get deployment -> kgd
  • kubectl get replicaset -> kgrs
  • kubectl delete pod -> kdp
  • kubectl describe service -> kdess
  • kubectl edit namespace -> kens

Usage

Clone project and add to ~/.bashrc file ->

  1. Clone repo
  2. vim ~/.bashrc
  3. paste (edit file location):
    if [ -f <path-to-cloned-repo>/kubectl_aliases ]; then
        source <path-to-cloned-repo>/kubectl_aliases
    fi
    

BASIC

alias command
k kubectl
kl kubectl logs
kexec kubectl exec -it
kpf kubectl port-forward
kaci kubectl auth can-i
katt kubectl attach
kapir kubectl api-resources
kapiv kubectl api-versions

GET

alias command
kg kubectl get
kgns kubectl get namespaces
kgp kubectl get pods
kgd kubectl get deployments
kgs kubectl get secret
kgrs kubectl get replicasets
kgss kubectl get statefulsets
kgds kubectl get daemonsets
kgsvc kubectl get services -o wide
kgn kubectl get nodes -o wide
kgcm kubectl get configmaps
kgcj kubectl get cronjobs
kgj kubectl get jobs
kgsa kubectl get serviceaccounts
kgr kubectl get roles
kgrb kubectl get rolebindings
kgcr kubectl get clusterroles
kgcrb kubectl get clusterrolebindings

DESCRIBE

alias command
kd kubectl describe
kdns kubectl describe namespaces
kdp kubectl describe pods
kdd kubectl describe deployments
kds kubectl describe secret
kdrs kubectl describe replicasets
kdss kubectl describe statefulsets
kdds kubectl describe daemonsets
kdsvc kubectl describe services -o wide
kdn kubectl describe nodes -o wide
kdcm kubectl describe configmaps
kdcj kubectl describe cronjobs
kdj kubectl describe jobs
kdsa kubectl describe serviceaccounts
kdr kubectl describe roles
kdrb kubectl describe rolebindings
kdcr kubectl describe clusterroles
kdcrb kubectl describe clusterrolebindings

EDIT

alias command
ke kubectl edit
kens kubectl edit namespaces
ked kubectl edit deployments
kers kubectl edit replicasets
kes kubectl edit secret
kess kubectl edit statefulsets
keds kubectl edit daemonsets
kesvc kubectl edit services
kecm kubectl edit configmaps
kecj kubectl edit cronjobs
kesa kubectl edit serviceaccounts
ker kubectl edit roles
kerb kubectl edit rolebindings
kecr kubectl edit clusterroles
kecrb kubectl edit clusterrolebindings

DELETE

alias command
kdel kubectl delete
kdelns kubectl delete namespaces
kdelp kubectl delete pods
kdeld kubectl delete deployments
kdelrs kubectl delete replicasets
kdelss kubectl delete statefulsets
kdelds kubectl delete daemonsets
kdelsvc kubectl delete services
kdels kubectl delete secret
kdelcm kubectl delete configmaps
kdelcj kubectl delete cronjobs
kdelj kubectl delete jobs
kdelsa kubectl delete serviceaccounts
kdelr kubectl delete roles
kdelrb kubectl delete rolebindings
kdelcr kubectl delete clusterroles
kdelcrb kubectl delete clusterrolebindings

DRY-RUN (MOCK)

alias command
kmock kubectl create mock -o yaml --dry-run=client
kens kubectl create mock -o yaml --dry-run=client namespaces
kecm kubectl create mock -o yaml --dry-run=client configmaps
kesa kubectl create mock -o yaml --dry-run=client serviceaccounts

CONFIG

alias command
kcfg kubectl config
kcfgv kubectl config view
kcfgns kubectl config set-context --current --namespace
kcfgcurrent kubectl config current-context
kcfgsc kubectl config set-context
kcfggc kubectl config get-contexts
kcfguc kubectl config use-context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.