当前位置:网站首页>Some practical, commonly used and increasingly efficient kubernetes aliases
Some practical, commonly used and increasingly efficient kubernetes aliases
2022-07-26 11:47:00 【Attack cloud primordial】
Some practical 、 Commonly used 、 More and more efficient Kubernetes Alias
https://blog.devgenius.io/daily-useful-kubernetes-aliases-c35f7f411f39
In this paper , I will share some aliases with you , These nicknames will significantly speed up your relationship with K8s Interaction .
You can directly copy and paste relevant commands at the end of the article .

Here are some useful aliases that I have used ……
This command is widely used below and in daily life .

Execute for all namespaces kubectl command

application YML file

Put the interactive terminal on the container

Quickly manage the configuration locally 、 Develop the context switching between advertising platforms

List all contexts

Delete or force deletion

Pod management .

Get by tag pod

Get through namespace pod

Service management .

Entrance management

ConfigMap management

Secret management

Deployment management

Deployment management

State set management .

Forward port

Tools to access all information

journal

Copies of documents

Node management

PVC management

Service account management

DaemonSet management

CronJob management

Job management

You can copy and paste all aliases from below .
# This command is used a LOT both below and in daily life
alias k=kubectl
# Execute a kubectl command against all namespaces
alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca'
# Apply a YML file
alias kaf='kubectl apply -f'
# Drop into an interactive terminal on a container
alias keti='kubectl exec -t -i'
# Manage configuration quickly to switch contexts between local, dev ad staging.
alias kcuc='kubectl config use-context'
alias kcsc='kubectl config set-context'
alias kcdc='kubectl config delete-context'
alias kccc='kubectl config current-context'
# List all contexts
alias kcgc='kubectl config get-contexts'
# General aliases
alias kdel='kubectl delete'
alias kdelf='kubectl delete -f'
# Pod management.
alias kgp='kubectl get pods'
alias kgpa='kubectl get pods --all-namespaces'
alias kgpw='kgp --watch'
alias kgpwide='kgp -o wide'
alias kep='kubectl edit pods'
alias kdp='kubectl describe pods'
alias kdelp='kubectl delete pods'
alias kgpall='kubectl get pods --all-namespaces -o wide'
# get pod by label: kgpl "app=myapp" -n myns
alias kgpl='kgp -l'
# get pod by namespace: kgpn kube-system"
alias kgpn='kgp -n'
# Service management.
alias kgs='kubectl get svc'
alias kgsa='kubectl get svc --all-namespaces'
alias kgsw='kgs --watch'
alias kgswide='kgs -o wide'
alias kes='kubectl edit svc'
alias kds='kubectl describe svc'
alias kdels='kubectl delete svc'
# Ingress management
alias kgi='kubectl get ingress'
alias kgia='kubectl get ingress --all-namespaces'
alias kei='kubectl edit ingress'
alias kdi='kubectl describe ingress'
alias kdeli='kubectl delete ingress'
# Namespace management
alias kgns='kubectl get namespaces'
alias kens='kubectl edit namespace'
alias kdns='kubectl describe namespace'
alias kdelns='kubectl delete namespace'
alias kcn='kubectl config set-context --current --namespace'
# ConfigMap management
alias kgcm='kubectl get configmaps'
alias kgcma='kubectl get configmaps --all-namespaces'
alias kecm='kubectl edit configmap'
alias kdcm='kubectl describe configmap'
alias kdelcm='kubectl delete configmap'
# Secret management
alias kgsec='kubectl get secret'
alias kgseca='kubectl get secret --all-namespaces'
alias kdsec='kubectl describe secret'
alias kdelsec='kubectl delete secret'
# Deployment management.
alias kgd='kubectl get deployment'
alias kgda='kubectl get deployment --all-namespaces'
alias kgdw='kgd --watch'
alias kgdwide='kgd -o wide'
alias ked='kubectl edit deployment'
alias kdd='kubectl describe deployment'
alias kdeld='kubectl delete deployment'
alias ksd='kubectl scale deployment'
alias krsd='kubectl rollout status deployment'
# Rollout management.
alias kgrs='kubectl get replicaset'
alias kdrs='kubectl describe replicaset'
alias kers='kubectl edit replicaset'
alias krh='kubectl rollout history'
alias kru='kubectl rollout undo'
# Statefulset management.
alias kgss='kubectl get statefulset'
alias kgssa='kubectl get statefulset --all-namespaces'
alias kgssw='kgss --watch'
alias kgsswide='kgss -o wide'
alias kess='kubectl edit statefulset'
alias kdss='kubectl describe statefulset'
alias kdelss='kubectl delete statefulset'
alias ksss='kubectl scale statefulset'
alias krsss='kubectl rollout status statefulset'
# Port forwarding
alias kpf="kubectl port-forward"
# Tools for accessing all information
alias kga='kubectl get all'
alias kgaa='kubectl get all --all-namespaces'
# Logs
alias kl='kubectl logs'
alias kl1h='kubectl logs --since 1h'
alias kl1m='kubectl logs --since 1m'
alias kl1s='kubectl logs --since 1s'
alias klf='kubectl logs -f'
alias klf1h='kubectl logs --since 1h -f'
alias klf1m='kubectl logs --since 1m -f'
alias klf1s='kubectl logs --since 1s -f'
# File copy
alias kcp='kubectl cp'
# Node Management
alias kgno='kubectl get nodes'
alias keno='kubectl edit node'
alias kdno='kubectl describe node'
alias kdelno='kubectl delete node'
# PVC management.
alias kgpvc='kubectl get pvc'
alias kgpvca='kubectl get pvc --all-namespaces'
alias kgpvcw='kgpvc --watch'
alias kepvc='kubectl edit pvc'
alias kdpvc='kubectl describe pvc'
alias kdelpvc='kubectl delete pvc'
# Service account management.
alias kdsa="kubectl describe sa"
alias kdelsa="kubectl delete sa"
# DaemonSet management.
alias kgds='kubectl get daemonset'
alias kgdsw='kgds --watch'
alias keds='kubectl edit daemonset'
alias kdds='kubectl describe daemonset'
alias kdelds='kubectl delete daemonset'
# CronJob management.
alias kgcj='kubectl get cronjob'
alias kecj='kubectl edit cronjob'
alias kdcj='kubectl describe cronjob'
alias kdelcj='kubectl delete cronjob'
# Job management.
alias kgj='kubectl get job'
alias kej='kubectl edit job'
alias kdj='kubectl describe job'
alias kdelj='kubectl delete job'
communication
Please follow the WeChat public account 【 Attack the cloud 】, Sweep yards attention , Learn more about consulting , There are more free resources for you to learn

边栏推荐
- MICCAI2022论文 | 进化多目标架构搜索框架:在COVID-19三维CT分类中的应用
- 【云驻共创】为了写好代码,你坚持了哪些好习惯?
- 28. Implementation of file directory parsing code
- "Mongodb" mongodb high availability deployment architecture - replica set
- 程序员成长第二十八篇:管理者如何才能不亲力亲为?
- Real time streaming protocol --rtsp
- X 2 Earn必须依靠旁氏启动?Gamefi的出路在哪?(上)
- 702 horsepower breaks through 100 in only 4.5 seconds! The strongest pickup truck comes, safe and comfortable
- 绝对路径打开文件相比数据库查询哪个更快?
- Practice of microservice in solving Library Download business problems
猜你喜欢

正点原子stm32中hal库iic模拟`#define SDA_IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` //PB9 输入模式

Data center construction (II): brief introduction to data center

Server memory failure prediction can actually do this!

An error occurred in the scrapy shell

QT——LCDNumber

Outsourcing for four years, abandoned

。。。。。。

28. Implementation of file directory parsing code

最新心形拼图小程序源码+带流量主

System call capture and segmentation - RING3 layer LD_ Preload mechanism for library function hijacking
随机推荐
Caused by: scala. MatchError: None (of class scala.None$)
QT - connect USB camera
微服务化解决文库下载业务问题实践
建模杂谈系列150 SCLC工程化实验3-SRule
Pyechart离线部署
Server memory failure prediction can actually do this!
Wechat applet - Advanced chapter Lin UI component library source code analysis button component (I)
Getting started step by step using g2o to solve ICP problems - estimating the transformation relationship between two sets of 3D point sets with matching relationship
ESP8266-Arduino编程实例-GPIO输入和输出
Scrapy IP agent is not responding
如何使用数据管道实现测试现代化
Practice of microservice in solving Library Download business problems
Mlx90640 infrared thermal imager temperature sensor module development notes (6)
Metauniverse gamefi chain game system development NFT Technology
系统调用捕获和分析—Ring0层kprobe劫持系统调用
测试用例千万不能随便,记录由一个测试用例异常引起的思考
System call capture and segmentation - RING3 layer LD_ Preload mechanism for library function hijacking
Record errors encountered by individuals
正点原子stm32中hal库iic模拟`#define SDA_IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` //PB9 输入模式
Back to the top of several options (JS)