반응형
Notice
Recent Posts
Recent Comments

06-26 03:32
관리 메뉴

SaevOps

[k8s] 명령어 자동 완성 / 별칭 / 약어 정리 본문

클라우드/Kubernetes

[k8s] 명령어 자동 완성 / 별칭 / 약어 정리

세브웁스 2023. 2. 16. 12:01
반응형

쿠버네티스 쉽고 빠르게 설정하기

# 자동 완성 패키지 설치
$ yum install bash-completion -y

# bash 디렉토리에 출력값 넣기
$ kubectl completion bash > /etc/bash_completion.d/kubectl

# 별칭 설정
$ echo 'alias k=kubectl' >> ~/.bashrc
$ echo 'complete -F __start_kubectl k' >> ~/.bashrc

# 리로딩
$ su -
- 자동 완성 패키지 설치
- bash 디렉토리에 출력값 넣기
- 별칭 설정(kubectl 대신 k로)

$ kubectl [tab] 결과

[root@bastion-host-svr ~]# kubectl
alpha          (Commands for features in alpha)
annotate       (Update the annotations on a resource)
api-resources  (Print the supported API resources on the server)
api-versions   (Print the supported API versions on the server, in the form of "group/version")
apply          (Apply a configuration to a resource by file name or stdin)
attach         (Attach to a running container)
auth           (Inspect authorization)
autoscale      (Auto-scale a deployment, replica set, stateful set, or replication controller)
certificate    (Modify certificate resources.)
cluster-info   (Display cluster information)
completion     (Output shell completion code for the specified shell (bash, zsh, fish, or powershell))
config         (Modify kubeconfig files)
cordon         (Mark node as unschedulable)
cp             (Copy files and directories to and from containers)
create         (Create a resource from a file or from stdin)
debug          (Create debugging sessions for troubleshooting workloads and nodes)
delete         (Delete resources by file names, stdin, resources and names, or by resources and label selector)
describe       (Show details of a specific resource or group of resources)
diff           (Diff the live version against a would-be applied version)
drain          (Drain node in preparation for maintenance)
edit           (Edit a resource on the server)
events         (List events)
exec           (Execute a command in a container)
explain        (Get documentation for a resource)
expose         (Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service)
get            (Display one or many resources)
help           (Help about any command)
kustomize      (Build a kustomization target from a directory or URL.)
label          (Update the labels on a resource)
logs           (Print the logs for a container in a pod)
options        (Print the list of flags inherited by all commands)
patch          (Update fields of a resource)
plugin         (Provides utilities for interacting with plugins)
port-forward   (Forward one or more local ports to a pod)
proxy          (Run a proxy to the Kubernetes API server)
replace        (Replace a resource by file name or stdin)
rollout        (Manage the rollout of a resource)
run            (Run a particular image on the cluster)
scale          (Set a new size for a deployment, replica set, or replication controller)
set            (Set specific features on objects)
taint          (Update the taints on one or more nodes)
top            (Display resource (CPU/memory) usage)
uncordon       (Mark node as schedulable)
version        (Print the client and server version information)
wait           (Experimental: Wait for a specific condition on one or many resources)

쿠버네티스 약어 정리

구분 이름 약어 오브젝트 이름(Kind)
자주 쓰는 명령어 nodes no Node
namespaces ns Namespace
deployments deploy Deployment
pods po Pod
services svc Service
구분 이름 약어 오브젝트 이름(Kind)
종종 쓰는 명령어 replicasets rs Replica Set
ingress ing Ingress
configmaps cm Config Map
horizontalpodautoscalers hpa Horizontal Pod Autoscaler
daemonsets ds Daemon Set
persistentvolumeclaims pvc Persistent Volume Claim
persistentvolumes pv Persistent Volume
statefulsets sts Stateful Set
구분 이름 약어 오브젝트 이름(Kind)
참고 명령어 replicationcontrollers rc Replication Controller
resourcequotas quota Resource Quota
serviceaccounts sa Service Account
cronjobs cj Cron Job
events ev Event
storageclasses sc Storage Classe
endpoints ep Endpoint
limitranges limits Limit Ranges

 

반응형
Comments