一、查看当前kubernetes支持的版本资源类型
Print the supported API versions on the server, in the form of “group/version”
[root@k8s-5-138 ~]# kubectl api-versionsadmissionregistration.k8s.io/v1admissionregistration.k8s.io/v1beta1apiextensions.k8s.io/v1apiextensions.k8s.io/v1beta1apiregistration.k8s.io/v1apiregistration.k8s.io/v1beta1apps/v1authentication.k8s.io/v1authentication.k8s.io/v1beta1authorization.k8s.io/v1authorization.k8s.io/v1beta1autoscaling/v1autoscaling/v2beta1autoscaling/v2beta2batch/v1batch/v1beta1certificates.k8s.io/v1beta1coordination.k8s.io/v1coordination.k8s.io/v1beta1discovery.k8s.io/v1beta1events.k8s.io/v1beta1extensions/v1beta1networking.k8s.io/v1networking.k8s.io/v1beta1node.k8s.io/v1beta1policy/v1beta1rbac.authorization.k8s.io/v1rbac.authorization.k8s.io/v1beta1scheduling.k8s.io/v1scheduling.k8s.io/v1beta1storage.k8s.io/v1storage.k8s.io/v1beta1v1
二、查看当前kubernetes支持的资源类型
api-resources Print the supported API resources on the server
[root@k8s-5-138 pod_template]# kubectl api-resourcesNAME SHORTNAMES APIGROUP NAMESPACED KINDbindings true Bindingcomponentstatuses cs false ComponentStatusconfigmaps cm true ConfigMapendpoints ep true Endpointsevents ev true Eventlimitranges limits true LimitRangenamespaces ns false Namespacenodes no false Nodepersistentvolumeclaims pvc true PersistentVolumeClaimpersistentvolumes pv false PersistentVolumepods po true Podpodtemplates true PodTemplatereplicationcontrollers rc true ReplicationControllerresourcequotas quota true ResourceQuotasecrets true Secretserviceaccounts sa true ServiceAccountservices svc true Servicemutatingwebhookconfigurations admissionregistration.k8s.io false MutatingWebhookConfigurationvalidatingwebhookconfigurations admissionregistration.k8s.io false ValidatingWebhookConfigurationcustomresourcedefinitions crd,crds apiextensions.k8s.io false CustomResourceDefinitionapiservices apiregistration.k8s.io false APIServicecontrollerrevisions apps true ControllerRevisiondaemonsets ds apps true DaemonSetdeployments deploy apps true Deploymentreplicasets rs apps true ReplicaSetstatefulsets sts apps true StatefulSettokenreviews authentication.k8s.io false TokenReviewlocalsubjectaccessreviews authorization.k8s.io true LocalSubjectAccessReviewselfsubjectaccessreviews authorization.k8s.io false SelfSubjectAccessReviewselfsubjectrulesreviews authorization.k8s.io false SelfSubjectRulesReviewsubjectaccessreviews authorization.k8s.io false SubjectAccessReviewhorizontalpodautoscalers hpa autoscaling true HorizontalPodAutoscalercronjobs cj batch true CronJobjobs batch true Jobcertificatesigningrequests csr certificates.k8s.io false CertificateSigningRequestleases coordination.k8s.io true Leaseendpointslices discovery.k8s.io true EndpointSliceevents ev events.k8s.io true Eventingresses ing extensions true Ingressingressclasses networking.k8s.io false IngressClassingresses ing networking.k8s.io true Ingressnetworkpolicies netpol networking.k8s.io true NetworkPolicyruntimeclasses node.k8s.io false RuntimeClasspoddisruptionbudgets pdb policy true PodDisruptionBudgetpodsecuritypolicies psp policy false PodSecurityPolicyclusterrolebindings rbac.authorization.k8s.io false ClusterRoleBindingclusterroles rbac.authorization.k8s.io false ClusterRolerolebindings rbac.authorization.k8s.io true RoleBindingroles rbac.authorization.k8s.io true Rolepriorityclasses pc scheduling.k8s.io false PriorityClasscsidrivers storage.k8s.io false CSIDrivercsinodes storage.k8s.io false CSINodestorageclasses sc storage.k8s.io false StorageClassvolumeattachments storage.k8s.io false VolumeAttachment
三、资源类型的解释
[root@k8s-5-138 pod_template]# kubectl explain deploymentKIND: DeploymentVERSION: apps/v1DESCRIPTION:Deployment enables declarative updates for Pods and ReplicaSets.FIELDS:apiVersion <string>APIVersion defines the versioned schema of this representation of anobject. Servers should convert recognized schemas to the latest internalvalue, and may reject unrecognized values. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourceskind <string>Kind is a string value representing the REST resource this objectrepresents. Servers may infer this from the endpoint the client submitsrequests to. Cannot be updated. In CamelCase. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kindsmetadata <Object>Standard object metadata.spec <Object>Specification of the desired behavior of the Deployment.status <Object>Most recently observed status of the Deployment.[root@k8s-5-138 pod_template]# kubectl explain ConfigMapKIND: ConfigMapVERSION: v1DESCRIPTION:ConfigMap holds configuration data for pods to consume.FIELDS:apiVersion <string>APIVersion defines the versioned schema of this representation of anobject. Servers should convert recognized schemas to the latest internalvalue, and may reject unrecognized values. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resourcesbinaryData <map[string]string>BinaryData contains the binary data. Each key must consist of alphanumericcharacters, '-', '_' or '.'. BinaryData can contain byte sequences that arenot in the UTF-8 range. The keys stored in BinaryData must not overlap withthe ones in the Data field, this is enforced during validation process.Using this field will require 1.10+ apiserver and kubelet.data <map[string]string>Data contains the configuration data. Each key must consist of alphanumericcharacters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must usethe BinaryData field. The keys stored in Data must not overlap with thekeys in the BinaryData field, this is enforced during validation process.immutable <boolean>Immutable, if set to true, ensures that data stored in the ConfigMap cannotbe updated (only object metadata can be modified). If not set to true, thefield can be modified at any time. Defaulted to nil. This is an alpha fieldenabled by ImmutableEphemeralVolumes feature gate.kind <string>Kind is a string value representing the REST resource this objectrepresents. Servers may infer this from the endpoint the client submitsrequests to. Cannot be updated. In CamelCase. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kindsmetadata <Object>Standard object's metadata. More info:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
