随笔分类 -  kubernetes

摘要:一、环境介绍 [root@k8s-m ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain l 阅读全文
posted @ 2019-01-11 14:29 巽逸 阅读(2272) 评论(0) 推荐(0)
摘要:一、安装glusterfs https://www.cnblogs.com/zhangb8042/p/7801181.html 环境介绍; centos 7 [root@k8s-m ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain 阅读全文
posted @ 2019-01-10 14:19 巽逸 阅读(744) 评论(0) 推荐(0)
摘要:一、下载Alertmanager https://prometheus.io/download/ wget https://github.com/prometheus/alertmanager/releases/download/v0.16.0-alpha.0/alertmanager-0.16.0 阅读全文
posted @ 2019-01-02 16:49 巽逸 阅读(4649) 评论(0) 推荐(1)
摘要:helm类似yum helm下载的是配置清单文件 核心术语: Chart:一个helm程序包; Repository:Charts仓库,https/http服务器; Release:特定的Chart部署于目标集群上的一个实例;Chart -> Config -> Release程序架构: helm: 阅读全文
posted @ 2019-01-01 19:04 巽逸 阅读(655) 评论(0) 推荐(0)
摘要:资源指标:metrucs-server 自定义指标:prometheus, k8s-prometheus-adapter(转换prometheus数据的格式) 新一代架构: 核心指标流水线:由kubelet、metrics-server以及由API server提供的api组成;CPU累积使用率、内 阅读全文
posted @ 2019-01-01 15:51 巽逸 阅读(909) 评论(0) 推荐(0)
摘要:HPA自动收缩 autoscale 自动调整一个 Deployment, ReplicaSet, 或者 ReplicationController 的副本数量 #创建一个replicaset测试 [root@k8s-m ~]# cat my-replicaset.yaml apiVersion: apps/v1 kind: ReplicaSet metadata: nam... 阅读全文
posted @ 2019-01-01 15:49 巽逸 阅读(504) 评论(1) 推荐(0)
摘要:HeapSter InfluxDB(持久存储) Grafana 展示InfluxDB的数据(类似kibana) #安装InfluxDB #github https://github.com/kubernetes-retired/heapster #下载文件 wget https://raw.githubusercontent.com/kubernetes-retired/heapster/... 阅读全文
posted @ 2019-01-01 09:37 巽逸 阅读(1544) 评论(0) 推荐(0)
摘要:1、k8s支持内存和cpu的限制 requests:容器运行需求,最低保障limits:限制,硬限制(资源上限) CPU: 1颗逻辑CPU(1核CPU=4个逻辑CPU) 1物理核=1000个微核(millicores) 1000m=1CPU 内存: 2、Qos类别 Qos类别: 1、Gurantee 阅读全文
posted @ 2019-01-01 09:35 巽逸 阅读(4495) 评论(0) 推荐(1)
摘要:一、k8s调度流程 1、(预选)先排除完全不符合pod运行要求的节点2、(优先)根据一系列算法,算出node的得分,最高没有相同的,就直接选择3、上一步有相同的话,就随机选一个 二、调度方式 1、node(运行在那些node上)2、pod选择(当需要运行在某个pod在一个节点上(pod亲和性),或不 阅读全文
posted @ 2018-12-31 20:51 巽逸 阅读(3050) 评论(0) 推荐(0)
摘要:一、介绍 Service Account概念的引入是基于这样的使用场景:运行在pod里的进程需要调用Kubernetes API以及非Kubernetes API的其它服务。Service Account它并不是给kubernetes集群的用户使用的,而是给pod里面的进程使用的,它为pod提供必要 阅读全文
posted @ 2018-12-30 15:06 巽逸 阅读(1704) 评论(0) 推荐(0)
摘要:#dashboard的github地址 https://github.com/kubernetes/dashboard #下载 wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recomme 阅读全文
posted @ 2018-12-29 10:00 巽逸 阅读(1779) 评论(0) 推荐(0)
摘要:HTTPS #浏览器访问 阅读全文
posted @ 2018-12-20 15:02 巽逸 阅读(2840) 评论(0) 推荐(0)
摘要:StatefulSet: 1、稳点且唯一的网络标识符 2、稳点且持久的存储 3、有序、平滑的部署和扩展 4、有序、平滑的删除和终止 5、有序的滚动更新 三个组件组成:headless(无头服务) service、StatefuSet、voluneClaimTemplate(存储卷申请模板) ##需要 阅读全文
posted @ 2018-09-08 13:11 巽逸 阅读(241) 评论(0) 推荐(0)
摘要:emptyDir: 默认的本地存储会随着pod删除而删除、只适合临时目录或缓存使用,没有任何持久性。 mydir实例 mkdir /volumes cd /volumes kubectl apply -f pod-volume-pod.yaml hostPath(不能跨节点) NFS() PV 例子 阅读全文
posted @ 2018-09-05 08:06 巽逸 阅读(242) 评论(0) 推荐(0)
摘要:pod状态介绍 1、pending(挂起) 例如没有适合的节点运行pod 2、running (运行) 3、fAILED (失败) 4、Succeeded(成功) 5、Unknown (例如kubelet挂了) 创建Pod经历阶段 apiservice -> etcd -> statefulset( 阅读全文
posted @ 2018-09-02 08:37 巽逸 阅读(10834) 评论(0) 推荐(2)
摘要:一、环境 关闭防火墙和selinux 禁用swap 服务器配置,至少2核2G 所有节点 #所有节点 echo net.bridge.bridge-nf-call-iptables = 1 >>/etc/sysctl.conf echo net.ipv4.ip_forward=1 >>/etc/sys 阅读全文
posted @ 2018-09-02 07:55 巽逸 阅读(1932) 评论(0) 推荐(0)
摘要:kubectl get pod [pod名] -o yaml nginx-6f858d4d45-sgwdf 1/1 Running 0 3h[root@k8s-m ~]# kubectl get pod nginx-6f858d4d45-sgwdf -o yamlapiVersion: v1kind 阅读全文
posted @ 2018-09-01 21:19 巽逸 阅读(410) 评论(0) 推荐(0)