当前位置: 首页 > news >正文

【模块一】kubernetes容器编排进阶实战之资源管理核心概念

kubernetes 资源管理核心概念

k8s的设计理念—分层架构

 

CRI-container runtime interface-容器运行接口
CNI-container network interface-容器网络接口
CSI-container storage interface-容器存储接口 

k8s的设计理念—API设计原则

 

https://www.kubernetes.org.cn/kubernetes%e8%ae%be%e8%ae%a1%e7%90%86%e5%bf%b5所有API应该是声明式的。
API对象是彼此互补而且可组合的。
高层API以操作意图为基础设计。
低层API根据高层API的控制需要设计。
尽量避免简单封装,不要有在外部API无法显式知道的内部隐藏的机制。API操作复杂度与对象数量成正比。
API对象状态不能依赖于网络连接状态。
尽量避免让操作机制依赖于全局状态,因为在分布式系统中要保证全局状态的同步是非常困难的。

kubernetes API简介

 

内置API: 部署好kubernetes集群后自带的 API接口.

自定义资源:CRD(Custom Resource Definition),部署kubernetes之后通过安装其 它组件等方式扩展出来的API。

kubernetes 内置API及资源对象简介

 

# curl --cacert /etc/kubernetes/ssl/ca.pem -H "Authorization: Bearer TOKEN" https://127.0.0.1:6443[root@k8s-master1 2.dashboard-v2.7.0]#kubectl get secrets -A |grep admin
kubernetes-dashboard   dashboard-admin-user   kubernetes.io/service-account-token   3      4m27s
kuboard                kuboard-admin-token    kubernetes.io/service-account-token   3      8d
#获取token
[root@k8s-master1 2.dashboard-v2.7.0]#kubectl describe secrets  -n kubernetes-dashboard dashboard-admin-user curl --cacert /etc/kubernetes/ssl/ca.pem -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InFDU2NVUThyQ3RPREkySExNdTN0dktnRWpkbnhYcXp5b091NmE2TEZTRlEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkYXNoYm9hcmQtYWRtaW4tdXNlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJhZG1pbi11c2VyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiM2UwYmY2MmQtMDk3YS00MmU4LWE5NjItZTNmMTAxMGFlM2NjIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmVybmV0ZXMtZGFzaGJvYXJkOmFkbWluLXVzZXIifQ.LVc_o1AebQHNGveuCQMSsQXNWwDXEyzg-HyLZccLm7IFENETN7PqnR1l6PC0WszWo0ekVfwwqkIpWl0sXLqcgqTGqv-FzIGHS7okwpskdReQOBfzPPPo73O_CLdWMLgo9iISVB-WK7YbMZzrCwZ8aosHTXjI4_5XhlZtbI2UZu0Fiuwxkq5DMwkYQ-_x1vFV_zwyN8u01MdUkpsRo_8CA-b72dAOVmABEO3PxSHVoekVvVkvXLf7rZsMJdiqn1qGFAQL3-xTlivg2bfBPTeHkx7YExn12sre4omRFWkMEGl6Yv9OGenRQgakTImJWjSZhmJgm6bX9XED3LT0kJ9rLA " https://10.0.0.188:6443[root@k8s-master1 2.dashboard-v2.7.0]#curl --cacert /etc/kubernetes/ssl/ca.pem -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InFDU2NVUThyQ3RPREkySExNdTN0dktnRWpkbnhYcXp5b091NmE2TEZTRlEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkYXNoYm9hcmQtYWRtaW4tdXNlciIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJhZG1pbi11c2VyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiM2UwYmY2MmQtMDk3YS00MmU4LWE5NjItZTNmMTAxMGFlM2NjIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmVybmV0ZXMtZGFzaGJvYXJkOmFkbWluLXVzZXIifQ.LVc_o1AebQHNGveuCQMSsQXNWwDXEyzg-HyLZccLm7IFENETN7PqnR1l6PC0WszWo0ekVfwwqkIpWl0sXLqcgqTGqv-FzIGHS7okwpskdReQOBfzPPPo73O_CLdWMLgo9iISVB-WK7YbMZzrCwZ8aosHTXjI4_5XhlZtbI2UZu0Fiuwxkq5DMwkYQ-_x1vFV_zwyN8u01MdUkpsRo_8CA-b72dAOVmABEO3PxSHVoekVvVkvXLf7rZsMJdiqn1qGFAQL3-xTlivg2bfBPTeHkx7YExn12sre4omRFWkMEGl6Yv9OGenRQgakTImJWjSZhmJgm6bX9XED3LT0kJ9rLA " https://10.0.0.188:6443
{"paths": ["/.well-known/openid-configuration","/api","/api/v1","/apis","/apis/","/apis/admissionregistration.k8s.io","/apis/admissionregistration.k8s.io/v1","/apis/apiextensions.k8s.io","/apis/apiextensions.k8s.io/v1","/apis/apiregistration.k8s.io","/apis/apiregistration.k8s.io/v1","/apis/apps","/apis/apps/v1","/apis/authentication.k8s.io","/apis/authentication.k8s.io/v1","/apis/authorization.k8s.io","/apis/authorization.k8s.io/v1","/apis/autoscaling","/apis/autoscaling/v1","/apis/autoscaling/v2","/apis/batch","/apis/batch/v1","/apis/certificates.k8s.io","/apis/certificates.k8s.io/v1","/apis/coordination.k8s.io","/apis/coordination.k8s.io/v1","/apis/discovery.k8s.io","/apis/discovery.k8s.io/v1","/apis/events.k8s.io","/apis/events.k8s.io/v1","/apis/flowcontrol.apiserver.k8s.io","/apis/flowcontrol.apiserver.k8s.io/v1beta2","/apis/flowcontrol.apiserver.k8s.io/v1beta3","/apis/networking.k8s.io","/apis/networking.k8s.io/v1","/apis/node.k8s.io","/apis/node.k8s.io/v1","/apis/policy","/apis/policy/v1","/apis/rbac.authorization.k8s.io","/apis/rbac.authorization.k8s.io/v1","/apis/scheduling.k8s.io","/apis/scheduling.k8s.io/v1","/apis/storage.k8s.io","/apis/storage.k8s.io/v1","/apis/storage.k8s.io/v1beta1","/healthz","/healthz/autoregister-completion","/healthz/etcd","/healthz/log","/healthz/ping","/healthz/poststarthook/aggregator-reload-proxy-client-cert","/healthz/poststarthook/apiservice-openapi-controller","/healthz/poststarthook/apiservice-openapiv3-controller","/healthz/poststarthook/apiservice-registration-controller","/healthz/poststarthook/apiservice-status-available-controller","/healthz/poststarthook/bootstrap-controller","/healthz/poststarthook/crd-informer-synced","/healthz/poststarthook/generic-apiserver-start-informers","/healthz/poststarthook/kube-apiserver-autoregistration","/healthz/poststarthook/priority-and-fairness-config-consumer","/healthz/poststarthook/priority-and-fairness-config-producer","/healthz/poststarthook/priority-and-fairness-filter","/healthz/poststarthook/rbac/bootstrap-roles","/healthz/poststarthook/scheduling/bootstrap-system-priority-classes","/healthz/poststarthook/start-apiextensions-controllers","/healthz/poststarthook/start-apiextensions-informers","/healthz/poststarthook/start-cluster-authentication-info-controller","/healthz/poststarthook/start-kube-aggregator-informers","/healthz/poststarthook/start-kube-apiserver-admission-initializer","/healthz/poststarthook/start-kube-apiserver-identity-lease-controller","/healthz/poststarthook/start-kube-apiserver-identity-lease-garbage-collector","/healthz/poststarthook/start-legacy-token-tracking-controller","/healthz/poststarthook/storage-object-count-tracker-hook","/livez","/livez/autoregister-completion","/livez/etcd","/livez/log","/livez/ping","/livez/poststarthook/aggregator-reload-proxy-client-cert","/livez/poststarthook/apiservice-openapi-controller","/livez/poststarthook/apiservice-openapiv3-controller","/livez/poststarthook/apiservice-registration-controller","/livez/poststarthook/apiservice-status-available-controller","/livez/poststarthook/bootstrap-controller","/livez/poststarthook/crd-informer-synced","/livez/poststarthook/generic-apiserver-start-informers","/livez/poststarthook/kube-apiserver-autoregistration","/livez/poststarthook/priority-and-fairness-config-consumer","/livez/poststarthook/priority-and-fairness-config-producer","/livez/poststarthook/priority-and-fairness-filter","/livez/poststarthook/rbac/bootstrap-roles","/livez/poststarthook/scheduling/bootstrap-system-priority-classes","/livez/poststarthook/start-apiextensions-controllers","/livez/poststarthook/start-apiextensions-informers","/livez/poststarthook/start-cluster-authentication-info-controller","/livez/poststarthook/start-kube-aggregator-informers","/livez/poststarthook/start-kube-apiserver-admission-initializer","/livez/poststarthook/start-kube-apiserver-identity-lease-controller","/livez/poststarthook/start-kube-apiserver-identity-lease-garbage-collector","/livez/poststarthook/start-legacy-token-tracking-controller","/livez/poststarthook/storage-object-count-tracker-hook","/logs","/metrics","/openapi/v2","/openapi/v3","/openapi/v3/","/openid/v1/jwks","/readyz","/readyz/autoregister-completion","/readyz/etcd","/readyz/etcd-readiness","/readyz/informer-sync","/readyz/log","/readyz/ping","/readyz/poststarthook/aggregator-reload-proxy-client-cert","/readyz/poststarthook/apiservice-openapi-controller","/readyz/poststarthook/apiservice-openapiv3-controller","/readyz/poststarthook/apiservice-registration-controller","/readyz/poststarthook/apiservice-status-available-controller","/readyz/poststarthook/bootstrap-controller","/readyz/poststarthook/crd-informer-synced","/readyz/poststarthook/generic-apiserver-start-informers","/readyz/poststarthook/kube-apiserver-autoregistration","/readyz/poststarthook/priority-and-fairness-config-consumer","/readyz/poststarthook/priority-and-fairness-config-producer","/readyz/poststarthook/priority-and-fairness-filter","/readyz/poststarthook/rbac/bootstrap-roles","/readyz/poststarthook/scheduling/bootstrap-system-priority-classes","/readyz/poststarthook/start-apiextensions-controllers","/readyz/poststarthook/start-apiextensions-informers","/readyz/poststarthook/start-cluster-authentication-info-controller","/readyz/poststarthook/start-kube-aggregator-informers","/readyz/poststarthook/start-kube-apiserver-admission-initializer","/readyz/poststarthook/start-kube-apiserver-identity-lease-controller","/readyz/poststarthook/start-kube-apiserver-identity-lease-garbage-collector","/readyz/poststarthook/start-legacy-token-tracking-controller","/readyz/poststarthook/storage-object-count-tracker-hook","/readyz/shutdown","/version"][root@k8s-master1 ~]#curl --cacert /etc/kubernetes/ssl/ca.pem -H "Authorization: Bearer <YOUR_ACTUAL_TOKEN> " https://10.0.0.188:6443/api/v1/nodes/10.0.0.123[root@k8s-master1 ~]#curl --cacert /etc/kubernetes/ssl/ca.pem -H "Authorization: Bearer <YOUR_ACTUAL_TOKEN> " https://10.0.0.188:6443/metrics

kubernetes内置资源对象简介

kubernetes 资源对象操作命令

 

 

 

 

http://www.lryc.cn/news/485592.html

相关文章:

  • 用Python设置PowerPoint幻灯片背景
  • Restful API接⼝简介及为什么要进⾏接⼝压测
  • [pyspark] pyspark中如何修改列名字
  • 掌握 Spring Boot 的最佳方法 – 学习路线图
  • element-ui】使用el_upload上传文件无法动态修改action
  • 如何查看电脑支持的最大内存
  • 24 年第十届数维杯国际数模竞赛赛题浅析
  • Dubbo 3.x源码(25)—Dubbo服务引用源码(8)notify订阅服务通知更新
  • 排序算法 -计数排序
  • Java学习,基本数据类型
  • 单片机GPIO中断+定时器 软件串口通信
  • elementui el-table中给表头 el-table-column 加一个鼠标移入提示说明
  • NVR小程序接入平台/设备EasyNVR多个NVR同时管理设备接入:海康NVR 3.0提示不在线如何处理?
  • datawhale11月组队学习 模型压缩技术2:PyTorch模型剪枝教程
  • SOL链上Meme生态的崛起与未来#Dapp开发#链游#交易所#公链搭建
  • 部署Apache Doris
  • ElasticSearch-全文检索(一)基本介绍
  • paramiko 库实现的暴力破解 SSH 密码
  • Python 操作 Elasticsearch 全指南:从连接到数据查询与处理
  • Jarvis March算法详解及Python实现(附设计模式案例)
  • AIGC中的文本风格迁移:基于深度学习的实现
  • 丹摩征文活动 |【前端开发】HTML+CSS+JavaScript前端三剑客的基础知识体系了解
  • 响应“一机两用”政策 落实政务外网安全
  • 通过JS删除当前域名中的全部COOKIE教程
  • Flutter:Widget生命周期
  • Flutter:Dio下载文件到本地
  • [⑧5G NR]: PBCH payload生成
  • 查看解决端口占用,以及docker解决端口占用的原理
  • 力扣-Hot100-链表其一【算法学习day.34】
  • centos7 升级openssl 与升级openssh 安装卸载 telnet-server