k8s之所有resources类型

news/2024/11/26 9:40:23/

以下组件基于1.19版本
可以使用kubectl api-resource

nameshort nameAPI groupnamespacekind
bingdstruebing
componentStatusescsfalseComponetStatus
configMapscmtrueConfigMap
endpointseptrueEndpoints
eventsevtrueEvent
limitrangeslimitstrueLimitRange
namepspacesnsfalseNamespace
nodesnofalseNode
persistentvolumeclaimspvctruePersistentVolumeClaim
persistentvolumespvfalsePersistentVolume
poddspotruePod
podtemplatestruePodTemplate
replicationcontrollersrctrueReplicationController
resourcequotasquotatrueResourceQuota
secretstrueSecret
serviceaccountssatrueServiceAccount
servicessvctrueService
mutatingwebhookconfigurationsadminssionregistration.k8s.iofalseMutatingWebHookConfiguration
validatingwebhookconfigurationsadminssionregistration.k8s.iofalseValidatingWebhookConfiguration
customresourcedefinitionsapiextensions.k8s.iofalseCustomResourceDefinition
apiservicesapiregistration.k8s.iofalseAPIService
controllerrevisionsappstrueControllerRevision
deamonsetsdsappstrueDeamonSet
deploymentsdeployappstrueDeployment
replicasetsrsappstrueReplicaSet
statefulsetsstsappstrueStatefulSet
tokenreviewsauthentication.k8s.iofalseTokenReview
localsubjectaccessreviewsauthentication.k8s.iotrueLocalSubjectAccessReview
selsubjectaccessreviewsauthentication.k8s.iofalseSelfSubjectAccessReview
subjectaccessreviewsauthentication.k8s.iofalseSubjectAccessReview
horizontalpodauscalershpa.autoscalingtrueHorizontalPodAutoscaler
cronjobscjbatchtrueCronjob
jobsbatchtrueJob
certificatessigningrequestscsrcertificates.k8s.iotrueCertificateSigningRequest
leasecoordination.k8s.iotrueLease
endpointslicesdiscovery.k8s.iotrueEndpointSlice
eventsevevents.k8s.iotrueEvent
flowschemasflowcontrol.apiserver.k8s.iofalseFlowSchema
prioritylevelconfigurationsflowcontrol.apiserver.k8s.iofalsePriorityLevelConfiguration
ingressclassesnetworking.k8s.iofalseIngressClass
ingressesingnetworking.k8s.iotrueIngress
networkpoliciesnetpolnetworking.k8s.iotrueNetworkPolicy
runtimeclassesnode.k8s.iofalseRuntimeClass
poddisruptionbugetspdbpolicytruePodDisruptionBudget
podsecuritypoliciespsppolicyfalsePodSecurityPolicy
clusterrolebindingsrbac.authorization.k8s.iofalseClusterRoleBinding
clusterrolesrbac.authorization.k8s.iofalseClusterRole
rolebindingsrbac.authorization.k8s.iotrueRoleBinding
rolesrbac.authorization.k8s.iotrueRole
priorityclassespcscheduling.k8s.iofalsePriorityClass
csidriversstorage.k8s.iofalseCSIDriver
csinodesstorage.k8s.iofalseCSINode
storageclassesscstorage.k8s.iofalseStoragetClass
volumeattachmentstorage.k8s.iofalseVolumeAttachment

我们可以看下一个刚刚安装的集群包含了哪些组件

~# kubectl get all -A
NAMESPACE              NAME                                             READY   STATUS    RESTARTS   AGE
kube-system            pod/calico-kube-controllers-8b5ff5d58-szbwh      1/1     Running   3          51d
kube-system            pod/calico-node-m2cfp                            1/1     Running   1          51d
kube-system            pod/calico-node-pwgkr                            1/1     Running   1          51d
kube-system            pod/calico-node-xbxnq                            1/1     Running   2          51d
kube-system            pod/coredns-85967d65-k2pnp                       1/1     Running   1          51d
kube-system            pod/coredns-85967d65-zkj27                       1/1     Running   1          51d
kube-system            pod/dns-autoscaler-5b7b5c9b6f-8w4vh              1/1     Running   1          51d
kube-system            pod/kube-apiserver-node1                         1/1     Running   1          51d
kube-system            pod/kube-apiserver-node2                         1/1     Running   1          51d
kube-system            pod/kube-controller-manager-node1                1/1     Running   46         51d
kube-system            pod/kube-controller-manager-node2                1/1     Running   51         51d
kube-system            pod/kube-proxy-4vv6x                             1/1     Running   1          51d
kube-system            pod/kube-proxy-dc8zm                             1/1     Running   1          51d
kube-system            pod/kube-proxy-g256z                             1/1     Running   2          51d
kube-system            pod/kube-scheduler-node1                         1/1     Running   44         51d
kube-system            pod/kube-scheduler-node2                         1/1     Running   48         51d
kube-system            pod/nginx-proxy-node3                            1/1     Running   2          51d
kube-system            pod/nodelocaldns-9469d                           1/1     Running   1          51d
kube-system            pod/nodelocaldns-kz8f2                           1/1     Running   1          51d
kube-system            pod/nodelocaldns-ld4n4                           1/1     Running   2          51d
kubernetes-dashboard   pod/dashboard-metrics-scraper-7b59f7d4df-bm742   1/1     Running   1          49d
kubernetes-dashboard   pod/kubernetes-dashboard-997f4979d-xmbfn         1/1     Running   1          49dNAMESPACE              NAME                                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE
default                service/kubernetes                  ClusterIP   10.233.0.1      <none>        443/TCP                  51d
kube-system            service/coredns                     ClusterIP   10.233.0.3      <none>        53/UDP,53/TCP,9153/TCP   51d
kubernetes-dashboard   service/dashboard-metrics-scraper   ClusterIP   10.233.54.163   <none>        8000/TCP                 49d
kubernetes-dashboard   service/kubernetes-dashboard        NodePort    10.233.36.214   <none>        443:31241/TCP            49dNAMESPACE     NAME                          DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR            AGE
kube-system   daemonset.apps/calico-node    3         3         3       3            3           <none>                   51d
kube-system   daemonset.apps/kube-proxy     3         3         3       3            3           kubernetes.io/os=linux   51d
kube-system   daemonset.apps/nodelocaldns   3         3         3       3            3           <none>                   51dNAMESPACE              NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
kube-system            deployment.apps/calico-kube-controllers     1/1     1            1           51d
kube-system            deployment.apps/coredns                     2/2     2            2           51d
kube-system            deployment.apps/dns-autoscaler              1/1     1            1           51d
kubernetes-dashboard   deployment.apps/dashboard-metrics-scraper   1/1     1            1           49d
kubernetes-dashboard   deployment.apps/kubernetes-dashboard        1/1     1            1           49dNAMESPACE              NAME                                                   DESIRED   CURRENT   READY   AGE
kube-system            replicaset.apps/calico-kube-controllers-8b5ff5d58      1         1         1       51d
kube-system            replicaset.apps/coredns-85967d65                       2         2         2       51d
kube-system            replicaset.apps/dns-autoscaler-5b7b5c9b6f              1         1         1       51d
kubernetes-dashboard   replicaset.apps/dashboard-metrics-scraper-7b59f7d4df   1         1         1       49d
kubernetes-dashboard   replicaset.apps/kubernetes-dashboard-74d688b6bc        0         0         0       49d
kubernetes-dashboard   replicaset.apps/kubernetes-dashboard-997f4979d         1         1         1       49d

我们发现上面有好几个组件曾经restart过,我们可以查看下详情看看什么原因呗重启了,我们使用以下命令查看上一次错误原因

kubectl descirbe pod/kube-scheduler-node1
State:          RunningStarted:      Tue, 06 Apr 2021 02:49:36 +0800Last State:     TerminatedReason:       ErrorExit Code:    255Started:      Tue, 06 Apr 2021 02:04:10 +0800Finished:     Tue, 06 Apr 2021 02:49:35 +0800

我们发现除了 Error没其它有用信息了,没关系我们可以查看上一次镜像日志使用-p参数,执行以下命令查看上一次容器日志

kubectl logs pod/kube-scheduler-node1 -n kube-system -p |grep error

如果显示行信息不够可以增加 grep -C10 参数查看前后10行
输出如下

:~# kubectl logs pod/kube-scheduler-node1 -n kube-system -p |grep error
E0405 18:44:55.781090       1 leaderelection.go:325] error retrieving resource lock kube-system/kube-scheduler: Get "https://x.x.x.x:6443/apis/coordination.k8s.io/v1/namespaces/kube-system/leases/kube-scheduler?timeout=10s": net/http: request canceled (Client.Timeout exceeded while awaiting headers)

查询了下原因stackoverflow找到答案如下


http://www.ppmy.cn/news/174854.html

相关文章

【K8S】K8S 1.18.2安装dashboard(基于kubernetes-dashboard 2.0.0版本)

写在前面 K8S集群部署成功了&#xff0c;如何对集群进行可视化管理呢&#xff1f;别着急&#xff0c;接下来&#xff0c;我们一起搭建kubernetes-dashboard来解决这个问题。 有关K8S集群的安装可以参考《【K8S】基于单Master节点安装K8S集群》 有关Metrics-Service的安装可以参…

RL策略梯度方法之(八): Distributed Distributional DDPG (D4PG)

本专栏按照 https://lilianweng.github.io/lil-log/2018/04/08/policy-gradient-algorithms.html 顺序进行总结 。 文章目录 原理解析主要 trick与 DDPG的异同 算法实现总体流程代码实现 D 4 P G \color{red}D4PG D4PG &#xff1a;[ paper | code ] 原理解析 主要 trick D4P…

K8S使用ceph-csi持久化存储之cephfs部署验证快照

一、集群和组件版本 K8S集群&#xff1a;1.19.4 Ceph集群&#xff1a;ceph version 15.2.13 (c44bc49e7a57a87d84dfff2a077a2058aa2172e2) octopus (stable) Ceph-CSI&#xff1a;release-v3.3 (csi版本要对应不然创建pvc要报错) Linue kernel&#xff1a;5.13.12-1.el7.elrep…

k8s 初体验

1.使用kubeadm工具快速安装Kubernetes集群 准备工作 关掉selinux vi /etc/selinux/config disabled 关掉firewalld,iptables systemctl disable firewalld systemctl stop firewalld systemctl disable iptables systemctl stop iptables 编辑生成kubernetes的yum源 [roo…

Kubernetes - 从Docker 镜像到K8s Pod操作示例

上一篇有写到怎样将一个普通的springboot的jar包&#xff0c;制作成docker镜像&#xff0c;并push到镜像仓库&#xff0c; Docker - 创建并运行一个docker&#xff08;springboot&#xff09;容器 启动这个docker容器&#xff0c;并对外提供服务等等&#xff1b; 这里我们…

离线强化学习(Offline RL)系列2: (环境篇)D4RL数据集简介、安装及错误解决

【更新日志】 Update: 2022年3月14日&#xff0c;增加D4RL安装过程报错问题。. 强化学习快速发展的主要原因在于有一个良好的模拟环境&#xff0c;最终得到一个最优的policy, 然而现实问题就是在实际落地应用中没有有效的环境&#xff0c;为了解决实验环境问题&#xff0c;本文…

CISSP-D4-通讯与网络安全

CISSP-D1-安全与风险管理 CISSP-D2-资产安全 CISSP-D3-安全架构与工程 CISSP-D5-身份与访问控制 D4&#xff1a;通讯与网络安全 一、网络模型安全概述&#xff1a; D4-1&#xff5e;2 二、网络组建和设备安全&#xff1a; D4-3&#xff5e;5 三、网络连接安全&#xff1a; …

Kubernetes基础:查看状态、管理服务

转载自https://www.cnblogs.com/cocowool/p/k8s_describe_node_pod_and_service.html 目标 了解Kubernetes Pod了解Kubernetes Node学习如何调试部署问题了解如何通过Service暴露应用 Kubernetes Pods 在Kubernetes中创建一个Deployment 部署就会在Node上创建一个Pod&#x…