摘要: 1、资源限制Pod和Container的资源请求和限制: spec.containers[].resources.limits.cpu spec.containers[].resources.limits.memory spec.containers[].resources.requests.cpu 阅读全文
posted @ 2019-11-29 15:15 xw115428 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 1、镜像拉取策略IfNotPresent:默认值,镜像在宿主机上不存在时才拉取Always:每次创建Pod 都会重新拉取一次镜像Never:Pod 永远不会主动拉取这个镜像注意:如果省略imagePullPolicy 镜像tag为 :latest 策略为always ,否则 策略为 IfNotPre 阅读全文
posted @ 2019-11-29 15:03 xw115428 阅读(941) 评论(0) 推荐(0) 编辑
摘要: 1、Infrastructure Container:基础容器维护整个Pod网络空间,启动一个容器时,k8s会自动为我们启动一个基础容器配置: [root@k8s-node02 ~]# cat /opt/kubernetes/cfg/kubelet.conf |grep "infra-contain 阅读全文
posted @ 2019-11-29 14:58 xw115428 阅读(761) 评论(0) 推荐(0) 编辑
摘要: apiVersion: v1 #创建一个新的命名空间 kind: Namespace metadata: name: test apiVersion: apps/v1 #资源版本,可使用 kubectl api-versions命令查看有哪些,只有指定具体的资源版本才有相关的资源来使用 kind: 阅读全文
posted @ 2019-11-29 14:47 xw115428 阅读(766) 评论(0) 推荐(0) 编辑
摘要: [root@k8s-master01 k8s]# yum install -y bash-completion [root@k8s-master01 k8s]# source /usr/share/bash-completion/bash_completion # source <(kubectl 阅读全文
posted @ 2019-11-29 11:15 xw115428 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 客户端使用kubectl访问由于默认使用的Http访问,在master中访问是连接的http://127.0.0.1:8080地址,客户端只能通过10.16.8.156:6443访问,需要配置https 1、生成证书 [root@k8s-master01 k8s]# pwd /root/k8s/tl 阅读全文
posted @ 2019-11-29 11:12 xw115428 阅读(534) 评论(0) 推荐(0) 编辑
摘要: 1、创建kubectl run nginx --replicas=3 --labels="app=example" --image=nginx:1.10 --port=80 --record2、查看kubectl get deploykubectl get pods --show-labelskub 阅读全文
posted @ 2019-11-29 11:09 xw115428 阅读(221) 评论(0) 推荐(1) 编辑
摘要: [root@k8s-master01-etcd01 yaml]# cat mandatory.yaml apiVersion: v1 kind: Namespace metadata: name: ingress-nginx labels: app.kubernetes.io/name: ingre 阅读全文
posted @ 2019-11-29 11:05 xw115428 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 1、下载docker-compose [root@k8s-node01 ~]# curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o 阅读全文
posted @ 2019-11-29 11:03 xw115428 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 主节点: yum install keepalived vi /etc/keepalived/keepalived.conf global_defs { notification_email { acassen@firewall.loc failover@firewall.loc sysadmin@ 阅读全文
posted @ 2019-11-29 10:59 xw115428 阅读(233) 评论(0) 推荐(0) 编辑