Kubectl--get command

Source: Internet
Author: User
kubectl–get Command First, command format
Kubectl Get Resource Name
ii. List of resourceAll Certificatesigningrequests (aka ' CSR ') clusterrolebindings Clusterrol componentstatuses (aka ' CS ') Configmaps (aka ' C ') M ') controllerrevisions cronjobs customresourcedefinition (aka ' CRD ') daemonsets (aka ' DS ') deployments (aka ' Deploy ') end Points (aka ' EP ') (aka ' EV ') horizontalpodautoscalers (aka ' hpa ') ingresses (aka ' ing ') jobs limitranges (aka ' Limi TS ') Namespaces (aka ' NS ') networkpolicies (aka ' Netpol ') nodes (aka ' No ') persistentvolumeclaims (aka ' PVC ') persistentvo Lumes (aka ' PV ') poddisruptionbudgets (aka ' pdb ') Podpreset pods (aka ' po ') podsecuritypolicies (aka ' PSP ') podtemplates R Eplicasets (aka ' RS ') replicationcontrollers (aka ' RC ') Resourcequotas (aka ' quota ') rolebindings roles, Secrets SERVICEACC Ounts (aka ' sa ') Services (aka ' Svc ') statefulsets (aka ' sts ') storageclasses (aka ' SC ') third, optional parameters

View in a different format

-O Wide/yaml/json

Look at the pods of the specified label, support ' = ', ' = = ', '!= ' operator

-L Key=value

View the specified namespaces

-N namespace Four, example

# View Master status
kubectl get componentstatuses

# View all namespaces
Kubectl get namespace

# List all pods
Kubectl Get Pods

# Displays more Pods list information (for example, pod IP and node)
Kubectl get pods-o wide

# list RC Kubectl get with Name Web
Replicationcontroller Web

# Gets the information of the pod named Web-pod-13je7 and outputs the
kubectl get-o JSON pod web-pod-13je7 in JSON format

# Find pod based on pod file and output
kubectl get-f Pod.yaml-o JSON # in JSON format

the status of Pod containers
kubectl get-o template pod/k Ube-dns-795f5f6f9c-ldxxs--template {{. Status.phase}}

# simultaneously gets all RC and service
kubectl get rc,services

# Gets all rc,svc,pod
kubectl get rc/web service/frontend pods/web-pod-13je7

# gets all resource Kubectl get
All

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.