06 2021 档案

摘要:查看节点名称:kubectl get nodes 为节点添加标签:kubectl label nodes node2 nodeenv=test 定向调度:1、根据NodeName调度2、根据Label调度 nodename调度栗子:spec: containers: - name: nginx im 阅读全文
posted @ 2021-06-21 00:07 丑矬穷屌 阅读(64) 评论(0) 推荐(0)
摘要:钩子:post start:容器启动后钩子(容器启动后执行的操作,失败重启容器)pre stop:容器终止前钩子(容器删除时执行的操作,失败阻塞容器删除) exec命令方式栗子:lifecycle: (在容器行里面,与容器名称行对齐) postStart: exec: command: - cat 阅读全文
posted @ 2021-06-20 23:14 丑矬穷屌 阅读(83) 评论(0) 推荐(0)
摘要:kubectl运行需要配置文件的,默认只在master的$HOME/.kube。若需要在node节点上运行,需要将配置文件复制到node上。也就是要在master上进行:scp -r HOME/.kube node1:HOME/ 命令式对象配置:直接使用命令去操作kubernetes资源创建name 阅读全文
posted @ 2021-06-14 17:08 丑矬穷屌 阅读(138) 评论(0) 推荐(0)
摘要:apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: name: psp.flannel.unprivileged annotations: seccomp.security.alpha.kubernetes.io/allowedP 阅读全文
posted @ 2021-06-11 00:46 丑矬穷屌 阅读(424) 评论(0) 推荐(0)
摘要:apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: name: psp.flannel.unprivileged annotations: seccomp.security.alpha.kubernetes.io/allowedP 阅读全文
posted @ 2021-06-11 00:34 丑矬穷屌 阅读(426) 评论(0) 推荐(0)
摘要:系统环境 #master、node节点都执行 #1、检查系统版本(7.5以上)cat /etc/redhat-release #2、主机名解析vim /etc/hosts 192.168.109.100 master192.168.109.101 node1192.168.109.102 node2 阅读全文
posted @ 2021-06-11 00:32 丑矬穷屌 阅读(115) 评论(0) 推荐(0)
摘要:Go开发包:https://golang.google.cn/VSCode编辑器:https://code.visualstudio.com #在vscode内安装插件go,chinese插件 vscode 提示安装各种插件,install all 失败cmd运行go env -w GO111MOD 阅读全文
posted @ 2021-06-06 07:45 丑矬穷屌 阅读(56) 评论(0) 推荐(0)
摘要:docker compose将多个容器整合起来,一个项目需要web,redis,mysql服务services:单个容器项目project:容器整合后的整体 1、下载安装#官方的速度较慢sudo curl -L "https://github.com/docker/compose/releases/ 阅读全文
posted @ 2021-06-04 16:23 丑矬穷屌 阅读(108) 评论(0) 推荐(0)
摘要:docker network ls #查看docker网络docker network inspect balaba #检查指定网络#自定义网络中,各容器之间互相ping,可以不写ip地址(用容器名代替),当容器重启等原因导致ip变更时,很好用docker network create --driv 阅读全文
posted @ 2021-06-01 01:14 丑矬穷屌 阅读(185) 评论(0) 推荐(0)