Kubernetes编程——查询集群提供哪些API资源
查询集群提供哪些API资源
[root@JumperServer:~] # kubectl api-resources NAME SHORTNAMES APIVERSION NAMESPACED KIND bindings v1 true Binding componentstatuses cs v1 false ComponentStatus configmaps cm v1 true ConfigMap endpoints ep v1 true Endpoints events ev v1 true Event limitranges limits v1 true LimitRange namespaces ns v1 false Namespace nodes no v1 false Node persistentvolumeclaims pvc v1 true PersistentVolumeClaim persistentvolumes pv v1 false PersistentVolume pods po v1 true Pod podtemplates v1 true PodTemplate replicationcontrollers rc v1 true ReplicationController resourcequotas quota v1 true ResourceQuota secrets v1 true Secret serviceaccounts sa v1 true ServiceAccount services svc v1 true Service initializerconfigurations admissionregistration.k8s.io/v1alpha1 false InitializerConfiguration mutatingwebhookconfigurations admissionregistration.k8s.io/v1beta1 false MutatingWebhookConfiguration validatingwebhookconfigurations admissionregistration.k8s.io/v1beta1 false ValidatingWebhookConfiguration customresourcedefinitions crd,crds apiextensions.k8s.io/v1beta1 false CustomResourceDefinition apiservices apiregistration.k8s.io/v1 false APIService controllerrevisions apps/v1 true ControllerRevision daemonsets ds apps/v1 true DaemonSet deployments deploy apps/v1 true Deployment replicasets rs apps/v1 true ReplicaSet statefulsets sts apps/v1 true StatefulSet tokenreviews authentication.k8s.io/v1 false TokenReview localsubjectaccessreviews authorization.k8s.io/v1 true LocalSubjectAccessReview selfsubjectaccessreviews authorization.k8s.io/v1 false SelfSubjectAccessReview selfsubjectrulesreviews authorization.k8s.io/v1 false SelfSubjectRulesReview subjectaccessreviews authorization.k8s.io/v1 false SubjectAccessReview horizontalpodautoscalers hpa autoscaling/v1 true HorizontalPodAutoscaler cronjobs cj batch/v1beta1 true CronJob jobs batch/v1 true Job certificatesigningrequests csr certificates.k8s.io/v1beta1 false CertificateSigningRequest flavors clever.caicloud.io/v1alpha2 false Flavor mlneurons clever.caicloud.io/v1alpha2 true MLNeuron mlneurontaskowners clever.caicloud.io/v1alpha2 true MLNeuronTaskOwner projects clever.caicloud.io/v1alpha2 true Project configclaims config.caicloud.io/v1alpha1 true ConfigClaim configreferences config.caicloud.io/v1alpha1 true ConfigReference leases coordination.k8s.io/v1beta1 true Lease bgpconfigurations crd.projectcalico.org/v1 false BGPConfiguration clusterinformations crd.projectcalico.org/v1 false ClusterInformation felixconfigurations crd.projectcalico.org/v1 false FelixConfiguration globalnetworkpolicies crd.projectcalico.org/v1 false GlobalNetworkPolicy globalnetworksets crd.projectcalico.org/v1 false GlobalNetworkSet hostendpoints crd.projectcalico.org/v1 false HostEndpoint ippools crd.projectcalico.org/v1 false IPPool networkpolicies crd.projectcalico.org/v1 true NetworkPolicy datasets dataset.caicloud.io/v1alpha2 false Dataset events ev events.k8s.io/v1beta1 true Event daemonsets ds extensions/v1beta1 true DaemonSet deployments deploy extensions/v1beta1 true Deployment ingresses ing extensions/v1beta1 true Ingress networkpolicies netpol extensions/v1beta1 true NetworkPolicy podsecuritypolicies psp extensions/v1beta1 false PodSecurityPolicy replicasets rs extensions/v1beta1 true ReplicaSet network-attachment-definitions net-attach-def k8s.cni.cncf.io/v1 true NetworkAttachmentDefinition mpijobs kubeflow.org/v1alpha1 true MPIJob pytorchjobs kubeflow.org/v1beta2 true PyTorchJob tfjobs kubeflow.org/v1beta2 true TFJob loadbalancers lb loadbalance.caicloud.io/v1alpha2 true LoadBalancer nodes metrics.k8s.io/v1beta1 false NodeMetrics pods metrics.k8s.io/v1beta1 true PodMetrics springclouds microservice.caicloud.io/v1alpha1 true Springcloud networkpolicies networking.caicloud.io/v1alpha1 true NetworkPolicy networkpolicies netpol networking.k8s.io/v1 true NetworkPolicy applicationdrafts orchestration.caicloud.io/v1alpha1 true ApplicationDraft applications orchestration.caicloud.io/v1alpha1 true Application poddisruptionbudgets pdb policy/v1beta1 true PodDisruptionBudget podsecuritypolicies psp policy/v1beta1 false PodSecurityPolicy shieldpolicies qegis.k8s.io/v1alpha1 true ShieldPolicy clusterrolebindings rbac.authorization.k8s.io/v1 false ClusterRoleBinding clusterroles rbac.authorization.k8s.io/v1 false ClusterRole rolebindings rbac.authorization.k8s.io/v1 true RoleBinding roles rbac.authorization.k8s.io/v1 true Role releasehistories release.caicloud.io/v1alpha1 true ReleaseHistory releases release.caicloud.io/v1alpha1 true Release clusters resource.caicloud.io/v1beta1 false Cluster configs resource.caicloud.io/v1beta1 false Config extendedresources er resource.caicloud.io/v1beta1 false ExtendedResource infranetworks inet resource.caicloud.io/v1beta1 false InfraNetwork machineautoscalinggroups masg resource.caicloud.io/v1beta1 false MachineAutoScalingGroup machines resource.caicloud.io/v1beta1 false Machine networks net resource.caicloud.io/v1beta1 false Network nodelocalstorages resource.caicloud.io/v1beta1 false NodeLocalStorage requirementgaps rg resource.caicloud.io/v1beta1 false RequirementGap resourceclasses rcl resource.caicloud.io/v1beta1 false ResourceClass snapshots resource.caicloud.io/v1beta1 true Snapshot tags resource.caicloud.io/v1beta1 false Tag workloadnetworks wlnet resource.caicloud.io/v1beta1 true WorkloadNetwork priorityclasses pc scheduling.k8s.io/v1beta1 false PriorityClass scheduledsparkapplications scheduledsparkapp sparkoperator.k8s.io/v1beta1 true ScheduledSparkApplication sparkapplications sparkapp sparkoperator.k8s.io/v1beta1 true SparkApplication storageclasses sc storage.k8s.io/v1 false StorageClass volumeattachments storage.k8s.io/v1beta1 false VolumeAttachment clusterquotas tenant.caicloud.io/v1alpha1 false ClusterQuota partitions tenant.caicloud.io/v1alpha1 false Partition tenants tenant.caicloud.io/v1alpha1 false Tenant error: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: received empty response for: custom.metrics.k8s.io/v1beta1 [root@JumperServer:~] #