摘要: 通过观察 pod 的 cpu、内存使用率或自定义 metrics 指标进行自动的扩容或缩容 pod 的数量。 通常用于 Deployment,不适用于无法扩/缩容的对象,如 DaemonSet 控制管理器每隔30s(可以通过–horizontal-pod-autoscaler-sync-period 阅读全文
posted @ 2023-10-13 16:18 yifanSJ 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 三、StatefulSet(针对部署的有状态应用) 有状态很依赖本地文件、网络资源等。不像无状态应用想扩容就扩容。 一)功能 1、创建 kubectl create -f web.yaml # 查看 service 和 statefulset => sts kubectl get service n 阅读全文
posted @ 2023-10-13 14:42 yifanSJ 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 实际案例:分布式日志收集: 一、配置文件 apiVersion: apps/v1 kind: DaemonSet # 创建 DaemonSet 格式的资源对象 metadata: name: fluentd spec: template: metadata: labels: app: logging 阅读全文
posted @ 2023-10-13 14:42 yifanSJ 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 二、Deployment(针对部署的无状态应用) 一)功能 1、创建 # 创建一个 deployment kubectl create deploy nginx-deploy --image=nginx:1.7.9 # 或执行 kubectl create -f xxx.yaml --record 阅读全文
posted @ 2023-10-13 14:41 yifanSJ 阅读(41) 评论(0) 推荐(0) 编辑