03 2019 档案

摘要:任意一台服务器远程访问集群,需要有以下命令生成的config配置文件 kubectl config set-cluster kubernetes \ #####这个ip地址要写lb的节点ip,lb作为集群的唯一入口 --server=https://192.168.1.60:6443 \ --embed-certs=true \ --certificate-authority=ca... 阅读全文
posted @ 2019-03-25 18:37 kkblog 阅读(279) 评论(0) 推荐(0)
摘要:yum install keepalived nginx -y yum install keepalived nginx -t ======================================================== ======================================================== nginx配置文件 加上这一段: ... 阅读全文
posted @ 2019-03-25 18:36 kkblog 阅读(415) 评论(0) 推荐(0)
摘要:#部署node节点 1,将kubelet-bootstrap用户绑定到系统集群角色中(颁发证书的最小权限) kubectl create clusterrolebinding kubelet-bootstrap --clusterrole=system:node-bootstrapper --user=kubelet-bootstrap 2,master节点执行 root@k8s-master... 阅读全文
posted @ 2019-03-20 21:46 kkblog 阅读(1579) 评论(0) 推荐(0)
摘要:# 创建 TLS Bootstrapping Token#BOOTSTRAP_TOKEN=$(head -c 16 /dev/urandom | od -An -t x | tr -d ' ')BOOTSTRAP_TOKEN=0fb61c46f8991b718eb38d27b605b008 cat 阅读全文
posted @ 2019-03-19 17:20 kkblog 阅读(1391) 评论(0) 推荐(0)
摘要:#master执行将内网通信地址写入etcd中,确保flannel能与etcd通信 #添加 /opt/etcd/bin/etcdctl --ca-file=/opt/etcd/ssl/ca.pem --cert-file=/opt/etcd/ssl/server.pem --key-file=/opt/etcd/ssl/server-key.pem --endpoints="https://19... 阅读全文
posted @ 2019-03-18 21:37 kkblog 阅读(649) 评论(0) 推荐(0)
摘要:etcd集群部署 1,创建etcd可执行文件,配置文件,证书文件存放目录 mkdir /opt/etcd/{bin,cfg,ssl} -p 2,创建包文件存放目录 mkdir /soft -p 3,解压etcd包。并将可执行文件移动到/opt/etcd/bin tar zxvf etcd-v3.2.12-linux-amd64.tar.gz mv etcd-v3.2.12-linux-amd... 阅读全文
posted @ 2019-03-18 17:54 kkblog 阅读(4362) 评论(0) 推荐(0)
摘要:etcd集群master节点安装 1,自签名SSL证书 ##安装工具cfssl $ cat cfssl.sh curl -L https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -o /usr/local/bin/cfssl curl -L https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 -o /usr/l... 阅读全文
posted @ 2019-03-18 17:21 kkblog 阅读(1781) 评论(0) 推荐(0)
摘要:docker run 阅读全文
posted @ 2019-03-15 16:58 kkblog 阅读(263) 评论(0) 推荐(0)
摘要:docker file 基本指令 指令 描述 FROM 构建新镜像是基于哪个镜像 MAINTAINER 镜像维护者姓名或邮箱地址 RUN 构建镜像时运行的Shell命令 COPY 拷贝文件或目录到镜像中 ENV 设置环境变量 USER 为RUN、CMD和ENTRYPOINT执行命令指定运行用户 EX 阅读全文
posted @ 2019-03-15 16:23 kkblog 阅读(239) 评论(0) 推荐(0)
摘要:• bridge –net=bridge 默认网络,Docker启动后创建一个docker0网桥,默认创建的容器也是添加到这个网桥中。 • host –net=host 容器不会获得一个独立的network namespace,而是与宿主机共用一个。这就意味着容器不会有自己的网卡信息,而是使用宿主 机的。容器除了网络,其他都是隔离的。 • none –net=... 阅读全文
posted @ 2019-03-14 17:48 kkblog 阅读(510) 评论(0) 推荐(0)
摘要:将数据从宿主机到容器的三种方式: 1,volumes:docker管理宿主机文件系统的一部分(/var/lib/docker/volumes)保存数据的最佳方式 2,bind mounts 将宿主机上的任意位置的文件或者目录挂在到容器 (--mount type=bind,src=源目录,dst=目标目录) 3,tmpfs:挂载存储在主机系统的内存中,而不会写入主机的文件系统。如果不希望将... 阅读全文
posted @ 2019-03-13 17:01 kkblog 阅读(2418) 评论(0) 推荐(0)
摘要:-i, –interactive 交互式 -t, –tty 分配一个伪终端 -d, –detach 运行容器到后台 -e, –env 设置环境变量 -p, –publish list 发布容器端口到主机 -P, –publish-all 发布容器所有EXPOSE的端口到宿主机随机端口 –name string 指定容器名称 -h, –hostname 设置容器主机名 ***–ip string ... 阅读全文
posted @ 2019-03-12 16:53 kkblog 阅读(2660) 评论(0) 推荐(0)
摘要:docekr 常用命令 1:ls 列出容器 $ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE jdk 8 fec5236a803b 48 seconds ag... 阅读全文
posted @ 2019-03-12 16:07 kkblog 阅读(517) 评论(0) 推荐(0)
摘要:# cat user_create.sh echo -n "创建用户输入C,删除用户输入D!" read name function monitor() { if [ "$name" == "C" ] || [ "$name" == "c" ];then function_create elif [ "$name" == "D" ] || [ "$name" == "d" ]; ... 阅读全文
posted @ 2019-03-08 17:39 kkblog 阅读(383) 评论(0) 推荐(0)
摘要:echo -n "创建用户输入C,删除用户输入D!" read name function monitor() { if [ "$name" == "C" ] || [ "$name" == "c" ];then function_create elif [ "$name" == "D" ] || [ "$name" == "d" ]; then function_rm ... 阅读全文
posted @ 2019-03-07 18:36 kkblog 阅读(271) 评论(0) 推荐(0)