CentOS7安装k8s记录
参考指导:CentOS7安装k8shttps://www.cnblogs.com/spll/p/10033316.htmlhttps://www.cnblogs.com/xkops/p/6169034.html安装环境:VMware Workstation ProCentOS7,已经安装好并可以上网。规划:master:192.168.188.140 CentOS64_04Node:192.168
本文为CentOS7下安装k8s的记录,参考指导:
CentOS7安装k8s
https://www.cnblogs.com/spll/p/10033316.html
https://www.cnblogs.com/xkops/p/6169034.html
安装环境:
VMware Workstation Pro
CentOS7,已经安装好并可以上网。
规划:
master:192.168.188.140 CentOS64_04
Node:192.168.188.141 CentOS7_05
------------------------------master安装:------------------------------
1、所有机器上执行以下命令,准备安装环境:(注意是所有机器,主机master,从机node都要安装)
1.1、安装epel-release源
yum -y install epel-release
[root@localhost ~]# yum -y install epel-release
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成
依赖关系解决
=============================================================================================================================================================================================
Package 架构 版本 源 大小
=============================================================================================================================================================================================
正在安装:
epel-release noarch 7-11 extras 15 k
事务概要
=============================================================================================================================================================================================
安装 1 软件包
总下载量:15 k
安装大小:24 k
Downloading packages:
epel-release-7-11.noarch.rpm | 15 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : epel-release-7-11.noarch 1/1
验证中 : epel-release-7-11.noarch 1/1
已安装:
epel-release.noarch 0:7-11
完毕!
[root@localhost ~]#
1.2、所有机器关闭防火墙
systemctl stop firewalld
systemctl disable firewalldsetenforce 0#查看防火墙状态
firewall-cmd --state
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalldsetenforce 0#查看防火墙状态
Failed to execute operation: No such file or directory
[root@localhost ~]# systemctl disable firewalldsetenforce 0
Failed to execute operation: No such file or directory
[root@localhost ~]# firewall-cmd --state
not running
[root@localhost ~]#
2、现在开始master主机上192.168.26.227安装kubernetes Master
2.1、使用yum安装etcd、kubernetes-master
yum -y install etcd kubernetes-master
[root@localhost ~]# yum -y install etcd kubernetes-master
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 9.1 kB 00:00:00
* base: mirrors.aliyun.com
* epel: hk.mirrors.thegigabit.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
epel | 4.7 kB 00:00:00
(1/3): epel/x86_64/group_gz | 95 kB 00:00:00
(2/3): epel/x86_64/updateinfo | 1.0 MB 00:00:01
(3/3): epel/x86_64/primary_db | 6.9 MB 00:00:05
正在解决依赖关系
--> 正在检查事务
---> 软件包 etcd.x86_64.0.3.3.11-2.el7.centos 将被 安装
---> 软件包 kubernetes-master.x86_64.0.1.5.2-0.7.git269f928.el7 将被 安装
--> 正在处理依赖关系 kubernetes-client = 1.5.2-0.7.git269f928.el7,它被软件包 kubernetes-master-1.5.2-0.7.git269f928.el7.x86_64 需要
--> 正在检查事务
---> 软件包 kubernetes-client.x86_64.0.1.5.2-0.7.git269f928.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
=============================================================================================================================================================================================
Package 架构 版本 源 大小
=============================================================================================================================================================================================
正在安装:
etcd x86_64 3.3.11-2.el7.centos extras 10 M
kubernetes-master x86_64 1.5.2-0.7.git269f928.el7 extras 25 M
为依赖而安装:
kubernetes-client x86_64 1.5.2-0.7.git269f928.el7 extras 14 M
事务概要
=============================================================================================================================================================================================
安装 2 软件包 (+1 依赖软件包)
总下载量:49 M
安装大小:269 M
Downloading packages:
(1/3): etcd-3.3.11-2.el7.centos.x86_64.rpm | 10 MB 00:00:00
(2/3): kubernetes-client-1.5.2-0.7.git269f928.el7.x86_64.rpm | 14 MB 00:00:01
(3/3): kubernetes-master-1.5.2-0.7.git269f928.el7.x86_64.rpm | 25 MB 00:00:01
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 25 MB/s | 49 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : kubernetes-client-1.5.2-0.7.git269f928.el7.x86_64 1/3
正在安装 : kubernetes-master-1.5.2-0.7.git269f928.el7.x86_64 2/3
正在安装 : etcd-3.3.11-2.el7.centos.x86_64 3/3
验证中 : kubernetes-client-1.5.2-0.7.git269f928.el7.x86_64 1/3
验证中 : kubernetes-master-1.5.2-0.7.git269f928.el7.x86_64 2/3
验证中 : etcd-3.3.11-2.el7.centos.x86_64 3/3
已安装:
etcd.x86_64 0:3.3.11-2.el7.centos kubernetes-master.x86_64 0:1.5.2-0.7.git269f928.el7
作为依赖被安装:
kubernetes-client.x86_64 0:1.5.2-0.7.git269f928.el7
完毕!
[root@localhost ~]#
2.2、编辑:vi /etc/etcd/etcd.conf文件,修改结果如下:
[root@localhost kubernetes]# vi /etc/etcd/etcd.conf
#[Member]
#ETCD_CORS=""
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
#ETCD_WAL_DIR=""
#ETCD_LISTEN_PEER_URLS="http://localhost:2380"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
#ETCD_MAX_SNAPSHOTS="5"
#ETCD_MAX_WALS="5"
ETCD_NAME="default"
#ETCD_SNAPSHOT_COUNT="100000"
#ETCD_HEARTBEAT_INTERVAL="100"
#ETCD_ELECTION_TIMEOUT="1000"
#ETCD_QUOTA_BACKEND_BYTES="0"
#ETCD_MAX_REQUEST_BYTES="1572864"
#ETCD_GRPC_KEEPALIVE_MIN_TIME="5s"
#ETCD_GRPC_KEEPALIVE_INTERVAL="2h0m0s"
#ETCD_GRPC_KEEPALIVE_TIMEOUT="20s"
#
#[Clustering]
#ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379"
#ETCD_DISCOVERY=""
#ETCD_DISCOVERY_FALLBACK="proxy"
#ETCD_DISCOVERY_PROXY=""
#ETCD_DISCOVERY_SRV=""
#ETCD_INITIAL_CLUSTER="default=http://localhost:2380"
#ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
#ETCD_INITIAL_CLUSTER_STATE="new"
#ETCD_STRICT_RECONFIG_CHECK="true"
#ETCD_ENABLE_V2="true"
#
#[Proxy]
#ETCD_PROXY="off"
#ETCD_PROXY_FAILURE_WAIT="5000"
#ETCD_PROXY_REFRESH_INTERVAL="30000"
#ETCD_PROXY_DIAL_TIMEOUT="1000"
#ETCD_PROXY_WRITE_TIMEOUT="5000"
#ETCD_PROXY_READ_TIMEOUT="0"
#
#[Security]
#ETCD_CERT_FILE=""
#ETCD_KEY_FILE=""
#ETCD_CLIENT_CERT_AUTH="false"
"/etc/etcd/etcd.conf" 69L, 1684C written
2.3、配置:vi /etc/kubernetes/apiserver文件,配置结果如下:
注意先备份原文件,在编辑,以免改错,以下vi操作均是先备份在vi。
以下为修改后的内容:
[root@localhost kubernetes]# vi apiserver
###
# kubernetes system config
#
# The following values are used to configure the kube-apiserver
#
# The address on the local server to listen to.
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"
# The port on the local server to listen on.
KUBE_API_PORT="--port=8080"
# Port minions listen on
KUBELET_PORT="--kubelet-port=10250"
# Comma separated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd-servers=http://127.0.0.1:2379"
# Address range to use for services
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# default admission control policies
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ResourceQuota"
# Add your own!
KUBE_API_ARGS=""
2.4、启动etcd、kube-apiserver、kube-controller-manager、kube-scheduler等服务,并设置开机启动。
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES ; done
[root@localhost kubernetes]# for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES ; done
Created symlink from /etc/systemd/system/multi-user.target.wants/etcd.service to /usr/lib/systemd/system/etcd.service.
● etcd.service - Etcd Server
Loaded: loaded (/usr/lib/systemd/system/etcd.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-01-05 00:22:55 CST; 130ms ago
Main PID: 2848 (etcd)
CGroup: /system.slice/etcd.service
└─2848 /usr/bin/etcd --name=default --data-dir=/var/lib/etcd/default.etcd --listen-client-urls=http://0.0.0.0:2379
1月 05 00:22:55 localhost.localdomain etcd[2848]: 8e9e05c52164694d received MsgVoteResp from 8e9e05c52164694d at term 2
1月 05 00:22:55 localhost.localdomain etcd[2848]: 8e9e05c52164694d became leader at term 2
1月 05 00:22:55 localhost.localdomain etcd[2848]: raft.node: 8e9e05c52164694d elected leader 8e9e05c52164694d at term 2
1月 05 00:22:55 localhost.localdomain etcd[2848]: setting up the initial cluster version to 3.3
1月 05 00:22:55 localhost.localdomain etcd[2848]: set the initial cluster version to 3.3
1月 05 00:22:55 localhost.localdomain etcd[2848]: enabled capabilities for version 3.3
1月 05 00:22:55 localhost.localdomain etcd[2848]: published {Name:default ClientURLs:[http://192.168.188.140:2379]} to cluster cdf818194e3a8c32
1月 05 00:22:55 localhost.localdomain etcd[2848]: ready to serve client requests
1月 05 00:22:55 localhost.localdomain etcd[2848]: serving insecure client requests on [::]:2379, this is strongly discouraged!
1月 05 00:22:55 localhost.localdomain systemd[1]: Started Etcd Server.
Created symlink from /etc/systemd/system/multi-user.target.wants/kube-apiserver.service to /usr/lib/systemd/system/kube-apiserver.service.
● kube-apiserver.service - Kubernetes API Server
Loaded: loaded (/usr/lib/systemd/system/kube-apiserver.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-01-05 00:22:55 CST; 127ms ago
Docs: https://github.com/GoogleCloudPlatform/kubernetes
Main PID: 2902 (kube-apiserver)
CGroup: /system.slice/kube-apiserver.service
└─2902 /usr/bin/kube-apiserver --logtostderr=true --v=0 --etcd-servers=http://127.0.0.1:2379 --insecure-bind-address=0.0.0.0 --port=8080 --kubelet-port=10250 --allow-privilege...
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.905192 2902 storage_rbac.go:131] Created clusterrole.rbac.authorization.k8s.io/view
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.908934 2902 storage_rbac.go:131] Created clusterrole.rbac.authorization.k8s.io/system:node
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.912496 2902 storage_rbac.go:131] Created clusterrole.rbac.authorization.k8s.io/system:node-proxier
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.915238 2902 storage_rbac.go:131] Created clusterrole.rbac.authorization.k8s.io/system:controller:...controller
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.918195 2902 storage_rbac.go:151] Created clusterrolebinding.rbac.authorization.k8s.io/cluster-admin
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.919759 2902 storage_rbac.go:151] Created clusterrolebinding.rbac.authorization.k8s.io/system:discovery
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.920995 2902 storage_rbac.go:151] Created clusterrolebinding.rbac.authorization.k8s.io/system:basic-user
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.922223 2902 storage_rbac.go:151] Created clusterrolebinding.rbac.authorization.k8s.io/system:node
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.923428 2902 storage_rbac.go:151] Created clusterrolebinding.rbac.authorization.k8s.io/system:node-proxier
1月 05 00:22:55 localhost.localdomain kube-apiserver[2902]: I0105 00:22:55.924820 2902 storage_rbac.go:151] Created clusterrolebinding.rbac.authorization.k8s.io/system:cont...controller
Hint: Some lines were ellipsized, use -l to show in full.
Created symlink from /etc/systemd/system/multi-user.target.wants/kube-controller-manager.service to /usr/lib/systemd/system/kube-controller-manager.service.
● kube-controller-manager.service - Kubernetes Controller Manager
Loaded: loaded (/usr/lib/systemd/system/kube-controller-manager.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-01-05 00:22:55 CST; 201ms ago
Docs: https://github.com/GoogleCloudPlatform/kubernetes
Main PID: 2953 (kube-controller)
CGroup: /system.slice/kube-controller-manager.service
└─2953 /usr/bin/kube-controller-manager --logtostderr=true --v=0 --master=http://127.0.0.1:8080
1月 05 00:22:55 localhost.localdomain systemd[1]: Started Kubernetes Controller Manager.
Created symlink from /etc/systemd/system/multi-user.target.wants/kube-scheduler.service to /usr/lib/systemd/system/kube-scheduler.service.
● kube-scheduler.service - Kubernetes Scheduler Plugin
Loaded: loaded (/usr/lib/systemd/system/kube-scheduler.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-01-05 00:22:56 CST; 206ms ago
Docs: https://github.com/GoogleCloudPlatform/kubernetes
Main PID: 3004 (kube-scheduler)
CGroup: /system.slice/kube-scheduler.service
└─3004 /usr/bin/kube-scheduler --logtostderr=true --v=0 --master=http://127.0.0.1:8080
1月 05 00:22:56 localhost.localdomain systemd[1]: Started Kubernetes Scheduler Plugin.
2.5、在etcd中定义flannel网络
etcdctl mk /atomic.io/network/config '{"Network":"172.17.0.0/16"}'
[root@localhost kubernetes]# etcdctl mk /atomic.io/network/config '{"Network":"172.17.0.0/16"}'
{"Network":"172.17.0.0/16"}
------------------------------node节点安装:------------------------------
[root@localhost ~]# yum -y install epel-release
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): base/7/x86_64/group_gz | 153 kB 00:00:00
(2/4): extras/7/x86_64/primary_db | 222 kB 00:00:00
(3/4): updates/7/x86_64/primary_db | 4.7 MB 00:00:03
(4/4): base/7/x86_64/primary_db | 6.1 MB 00:00:04
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成
依赖关系解决
=============================================================================================================================================================================================
Package 架构 版本 源 大小
=============================================================================================================================================================================================
正在安装:
epel-release noarch 7-11 extras 15 k
事务概要
=============================================================================================================================================================================================
安装 1 软件包
总下载量:15 k
安装大小:24 k
Downloading packages:
警告:/var/cache/yum/x86_64/7/extras/packages/epel-release-7-11.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
epel-release-7-11.noarch.rpm 的公钥尚未安装
epel-release-7-11.noarch.rpm | 15 kB 00:00:00
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
软件包 : centos-release-7-9.2009.0.el7.centos.x86_64 (@anaconda)
来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : epel-release-7-11.noarch 1/1
验证中 : epel-release-7-11.noarch 1/1
已安装:
epel-release.noarch 0:7-11
完毕!
[root@localhost ~]#
[root@localhost ~]# systemctl stop firewalld
systemctl disable firewalldsetenforce 0#查看防火墙状态firewall-cmd --state
[root@localhost ~]# systemctl disable firewalldsetenforce 0#查看防火墙状态firewall-cmd --state
systemctl: option '--state' requires an argument
[root@localhost ~]#
[root@localhost ~]# firewall-cmd --state
not running
3、接下来node的配置安装
3.1、在node机上192.168.26.228安装kubernetes Node和flannel组件应用
yum -y install flannel kubernetes-node
[root@localhost ~]# yum -y install flannel kubernetes-node
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 9.1 kB 00:00:00
* base: mirror.bit.edu.cn
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
epel | 4.7 kB 00:00:00
(1/3): epel/x86_64/group_gz | 95 kB 00:00:00
(2/3): epel/x86_64/primary_db | 6.9 MB 00:00:01
(3/3): epel/x86_64/updateinfo | 1.0 MB 00:00:21
正在解决依赖关系
--> 正在检查事务
---> 软件包 flannel.x86_64.0.0.7.1-4.el7 将被 安装
---> 软件包 kubernetes-node.x86_64.0.1.5.2-0.7.git269f928.el7 将被 安装
--> 正在处理依赖关系 kubernetes-client = 1.5.2-0.7.git269f928.el7,它被软件包 kubernetes-node-1.5.2-0.7.git269f928.el7.x86_64 需要
--> 正在处理依赖关系 socat,它被软件包 kubernetes-node-1.5.2-0.7.git269f928.el7.x86_64 需要
--> 正在处理依赖关系 docker,它被软件包 kubernetes-node-1.5.2-0.7.git269f928.el7.x86_64 需要
--> 正在处理依赖关系 conntrack-tools,它被软件包 kubernetes-node-1.5.2-0.7.git269f928.el7.x86_64 需要
--> 正在检查事务
---> 软件包 conntrack-tools.x86_64.0.1.4.4-7.el7 将被 安装
--> 正在处理依赖关系 libnetfilter_cttimeout.so.1(LIBNETFILTER_CTTIMEOUT_1.1)(64bit),它被软件包 conntrack-tools-1.4.4-7.el7.x86_64 需要
--> 正在处理依赖关系 libnetfilter_cttimeout.so.1(LIBNETFILTER_CTTIMEOUT_1.0)(64bit),它被软件包 conntrack-tools-1.4.4-7.el7.x86_64 需要
--> 正在处理依赖关系 libnetfilter_cthelper.so.0(LIBNETFILTER_CTHELPER_1.0)(64bit),它被软件包 conntrack-tools-1.4.4-7.el7.x86_64 需要
--> 正在处理依赖关系 libnetfilter_queue.so.1()(64bit),它被软件包 conntrack-tools-1.4.4-7.el7.x86_64 需要
--> 正在处理依赖关系 libnetfilter_cttimeout.so.1()(64bit),它被软件包 conntrack-tools-1.4.4-7.el7.x86_64 需要
--> 正在处理依赖关系 libnetfilter_cthelper.so.0()(64bit),它被软件包 conntrack-tools-1.4.4-7.el7.x86_64 需要
---> 软件包 docker.x86_64.2.1.13.1-203.git0be3e21.el7.centos 将被 安装
--> 正在处理依赖关系 docker-common = 2:1.13.1-203.git0be3e21.el7.centos,它被软件包 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 docker-client = 2:1.13.1-203.git0be3e21.el7.centos,它被软件包 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 subscription-manager-rhsm-certificates,它被软件包 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
---> 软件包 kubernetes-client.x86_64.0.1.5.2-0.7.git269f928.el7 将被 安装
---> 软件包 socat.x86_64.0.1.7.3.2-2.el7 将被 安装
--> 正在检查事务
---> 软件包 docker-client.x86_64.2.1.13.1-203.git0be3e21.el7.centos 将被 安装
---> 软件包 docker-common.x86_64.2.1.13.1-203.git0be3e21.el7.centos 将被 安装
--> 正在处理依赖关系 skopeo-containers >= 1:0.1.26-2,它被软件包 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 oci-umount >= 2:2.3.3-3,它被软件包 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 oci-systemd-hook >= 1:0.1.4-9,它被软件包 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 oci-register-machine >= 1:0-5.13,它被软件包 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 container-storage-setup >= 0.9.0-1,它被软件包 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 container-selinux >= 2:2.51-1,它被软件包 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
--> 正在处理依赖关系 atomic-registries,它被软件包 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 需要
---> 软件包 libnetfilter_cthelper.x86_64.0.1.0.0-11.el7 将被 安装
---> 软件包 libnetfilter_cttimeout.x86_64.0.1.0.0-7.el7 将被 安装
---> 软件包 libnetfilter_queue.x86_64.0.1.0.2-2.el7_2 将被 安装
---> 软件包 subscription-manager-rhsm-certificates.x86_64.0.1.24.45-1.el7.centos 将被 安装
--> 正在检查事务
---> 软件包 atomic-registries.x86_64.1.1.22.1-33.gitb507039.el7_8 将被 安装
--> 正在处理依赖关系 python-pytoml,它被软件包 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 需要
---> 软件包 container-selinux.noarch.2.2.119.2-1.911c772.el7_8 将被 安装
---> 软件包 container-storage-setup.noarch.0.0.11.0-2.git5eaf76c.el7 将被 安装
---> 软件包 containers-common.x86_64.1.0.1.40-11.el7_8 将被 安装
--> 正在处理依赖关系 subscription-manager,它被软件包 1:containers-common-0.1.40-11.el7_8.x86_64 需要
--> 正在处理依赖关系 slirp4netns,它被软件包 1:containers-common-0.1.40-11.el7_8.x86_64 需要
--> 正在处理依赖关系 fuse-overlayfs,它被软件包 1:containers-common-0.1.40-11.el7_8.x86_64 需要
---> 软件包 oci-register-machine.x86_64.1.0-6.git2b44233.el7 将被 安装
---> 软件包 oci-systemd-hook.x86_64.1.0.2.0-1.git05e6923.el7_6 将被 安装
---> 软件包 oci-umount.x86_64.2.2.5-3.el7 将被 安装
--> 正在检查事务
---> 软件包 fuse-overlayfs.x86_64.0.0.7.2-6.el7_8 将被 安装
--> 正在处理依赖关系 libfuse3.so.3(FUSE_3.2)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在处理依赖关系 libfuse3.so.3(FUSE_3.0)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
--> 正在处理依赖关系 libfuse3.so.3()(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
---> 软件包 python-pytoml.noarch.0.0.1.14-1.git7dea353.el7 将被 安装
---> 软件包 slirp4netns.x86_64.0.0.4.3-4.el7_8 将被 安装
---> 软件包 subscription-manager.x86_64.0.1.24.45-1.el7.centos 将被 安装
--> 正在处理依赖关系 subscription-manager-rhsm = 1.24.45,它被软件包 subscription-manager-1.24.45-1.el7.centos.x86_64 需要
--> 正在处理依赖关系 python-dmidecode >= 3.12.2-2,它被软件包 subscription-manager-1.24.45-1.el7.centos.x86_64 需要
--> 正在处理依赖关系 python-syspurpose,它被软件包 subscription-manager-1.24.45-1.el7.centos.x86_64 需要
--> 正在处理依赖关系 python-dateutil,它被软件包 subscription-manager-1.24.45-1.el7.centos.x86_64 需要
--> 正在检查事务
---> 软件包 fuse3-libs.x86_64.0.3.6.1-4.el7 将被 安装
---> 软件包 python-dateutil.noarch.0.1.5-7.el7 将被 安装
---> 软件包 python-dmidecode.x86_64.0.3.12.2-4.el7 将被 安装
---> 软件包 python-syspurpose.x86_64.0.1.24.45-1.el7.centos 将被 安装
---> 软件包 subscription-manager-rhsm.x86_64.0.1.24.45-1.el7.centos 将被 安装
--> 解决依赖关系完成
依赖关系解决
=============================================================================================================================================================================================
Package 架构 版本 源 大小
=============================================================================================================================================================================================
正在安装:
flannel x86_64 0.7.1-4.el7 extras 7.5 M
kubernetes-node x86_64 1.5.2-0.7.git269f928.el7 extras 14 M
为依赖而安装:
atomic-registries x86_64 1:1.22.1-33.gitb507039.el7_8 extras 36 k
conntrack-tools x86_64 1.4.4-7.el7 base 187 k
container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k
container-storage-setup noarch 0.11.0-2.git5eaf76c.el7 extras 35 k
containers-common x86_64 1:0.1.40-11.el7_8 extras 43 k
docker x86_64 2:1.13.1-203.git0be3e21.el7.centos extras 18 M
docker-client x86_64 2:1.13.1-203.git0be3e21.el7.centos extras 3.9 M
docker-common x86_64 2:1.13.1-203.git0be3e21.el7.centos extras 100 k
fuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 k
fuse3-libs x86_64 3.6.1-4.el7 extras 82 k
kubernetes-client x86_64 1.5.2-0.7.git269f928.el7 extras 14 M
libnetfilter_cthelper x86_64 1.0.0-11.el7 base 18 k
libnetfilter_cttimeout x86_64 1.0.0-7.el7 base 18 k
libnetfilter_queue x86_64 1.0.2-2.el7_2 base 23 k
oci-register-machine x86_64 1:0-6.git2b44233.el7 extras 1.1 M
oci-systemd-hook x86_64 1:0.2.0-1.git05e6923.el7_6 extras 34 k
oci-umount x86_64 2:2.5-3.el7 extras 33 k
python-dateutil noarch 1.5-7.el7 base 85 k
python-dmidecode x86_64 3.12.2-4.el7 base 83 k
python-pytoml noarch 0.1.14-1.git7dea353.el7 extras 18 k
python-syspurpose x86_64 1.24.45-1.el7.centos updates 274 k
slirp4netns x86_64 0.4.3-4.el7_8 extras 81 k
socat x86_64 1.7.3.2-2.el7 base 290 k
subscription-manager x86_64 1.24.45-1.el7.centos updates 1.1 M
subscription-manager-rhsm x86_64 1.24.45-1.el7.centos updates 332 k
subscription-manager-rhsm-certificates x86_64 1.24.45-1.el7.centos updates 236 k
事务概要
=============================================================================================================================================================================================
安装 2 软件包 (+26 依赖软件包)
总下载量:62 M
安装大小:286 M
Downloading packages:
(1/28): atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64.rpm | 36 kB 00:00:00
(2/28): container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch.rpm | 35 kB 00:00:00
(3/28): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:00
(4/28): conntrack-tools-1.4.4-7.el7.x86_64.rpm | 187 kB 00:00:00
(5/28): containers-common-0.1.40-11.el7_8.x86_64.rpm | 43 kB 00:00:00
(6/28): docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64.rpm | 100 kB 00:00:00
(7/28): docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64.rpm | 3.9 MB 00:00:00
(8/28): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00:00
(9/28): kubernetes-client-1.5.2-0.7.git269f928.el7.x86_64.rpm | 14 MB 00:00:00
(10/28): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00:00
(11/28): libnetfilter_cthelper-1.0.0-11.el7.x86_64.rpm | 18 kB 00:00:00
(12/28): libnetfilter_queue-1.0.2-2.el7_2.x86_64.rpm | 23 kB 00:00:00
(13/28): oci-register-machine-0-6.git2b44233.el7.x86_64.rpm | 1.1 MB 00:00:00
(14/28): libnetfilter_cttimeout-1.0.0-7.el7.x86_64.rpm | 18 kB 00:00:00
(15/28): oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64.rpm | 34 kB 00:00:00
(16/28): oci-umount-2.5-3.el7.x86_64.rpm | 33 kB 00:00:00
(17/28): flannel-0.7.1-4.el7.x86_64.rpm | 7.5 MB 00:00:01
(18/28): python-dmidecode-3.12.2-4.el7.x86_64.rpm | 83 kB 00:00:00
(19/28): python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm | 18 kB 00:00:00
(20/28): kubernetes-node-1.5.2-0.7.git269f928.el7.x86_64.rpm | 14 MB 00:00:01
(21/28): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:00:00
(22/28): subscription-manager-1.24.45-1.el7.centos.x86_64.rpm | 1.1 MB 00:00:00
(23/28): python-dateutil-1.5-7.el7.noarch.rpm | 85 kB 00:00:00
(24/28): subscription-manager-rhsm-1.24.45-1.el7.centos.x86_64.rpm | 332 kB 00:00:00
(25/28): subscription-manager-rhsm-certificates-1.24.45-1.el7.centos.x86_64.rpm | 236 kB 00:00:00
(26/28): python-syspurpose-1.24.45-1.el7.centos.x86_64.rpm | 274 kB 00:00:00
(27/28): socat-1.7.3.2-2.el7.x86_64.rpm | 290 kB 00:00:00
(28/28): docker-1.13.1-203.git0be3e21.el7.centos.x86_64.rpm | 18 MB 00:00:13
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 4.4 MB/s | 62 MB 00:00:14
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : subscription-manager-rhsm-certificates-1.24.45-1.el7.centos.x86_64 1/28
正在安装 : python-dateutil-1.5-7.el7.noarch 2/28
正在安装 : subscription-manager-rhsm-1.24.45-1.el7.centos.x86_64 3/28
正在安装 : socat-1.7.3.2-2.el7.x86_64 4/28
正在安装 : python-dmidecode-3.12.2-4.el7.x86_64 5/28
正在安装 : libnetfilter_cthelper-1.0.0-11.el7.x86_64 6/28
正在安装 : slirp4netns-0.4.3-4.el7_8.x86_64 7/28
正在安装 : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 8/28
正在安装 : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 9/28
正在安装 : fuse3-libs-3.6.1-4.el7.x86_64 10/28
正在安装 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 11/28
正在安装 : python-syspurpose-1.24.45-1.el7.centos.x86_64 12/28
正在安装 : subscription-manager-1.24.45-1.el7.centos.x86_64 13/28
正在安装 : 1:containers-common-0.1.40-11.el7_8.x86_64 14/28
正在安装 : libnetfilter_cttimeout-1.0.0-7.el7.x86_64 15/28
正在安装 : python-pytoml-0.1.14-1.git7dea353.el7.noarch 16/28
正在安装 : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 17/28
正在安装 : 2:oci-umount-2.5-3.el7.x86_64 18/28
正在安装 : kubernetes-client-1.5.2-0.7.git269f928.el7.x86_64 19/28
正在安装 : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 20/28
正在安装 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 21/28
正在安装 : 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 22/28
正在安装 : 2:docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64 23/28
正在安装 : 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64 24/28
正在安装 : libnetfilter_queue-1.0.2-2.el7_2.x86_64 25/28
正在安装 : conntrack-tools-1.4.4-7.el7.x86_64 26/28
正在安装 : kubernetes-node-1.5.2-0.7.git269f928.el7.x86_64 27/28
正在安装 : flannel-0.7.1-4.el7.x86_64 28/28
验证中 : 1:atomic-registries-1.22.1-33.gitb507039.el7_8.x86_64 1/28
验证中 : libnetfilter_queue-1.0.2-2.el7_2.x86_64 2/28
验证中 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 3/28
验证中 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 4/28
验证中 : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 5/28
验证中 : 1:containers-common-0.1.40-11.el7_8.x86_64 6/28
验证中 : subscription-manager-rhsm-1.24.45-1.el7.centos.x86_64 7/28
验证中 : 2:docker-common-1.13.1-203.git0be3e21.el7.centos.x86_64 8/28
验证中 : 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64 9/28
验证中 : conntrack-tools-1.4.4-7.el7.x86_64 10/28
验证中 : python-dateutil-1.5-7.el7.noarch 11/28
验证中 : 2:docker-client-1.13.1-203.git0be3e21.el7.centos.x86_64 12/28
验证中 : kubernetes-client-1.5.2-0.7.git269f928.el7.x86_64 13/28
验证中 : 2:oci-umount-2.5-3.el7.x86_64 14/28
验证中 : python-pytoml-0.1.14-1.git7dea353.el7.noarch 15/28
验证中 : libnetfilter_cttimeout-1.0.0-7.el7.x86_64 16/28
验证中 : python-syspurpose-1.24.45-1.el7.centos.x86_64 17/28
验证中 : fuse3-libs-3.6.1-4.el7.x86_64 18/28
验证中 : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 19/28
验证中 : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 20/28
验证中 : subscription-manager-rhsm-certificates-1.24.45-1.el7.centos.x86_64 21/28
验证中 : slirp4netns-0.4.3-4.el7_8.x86_64 22/28
验证中 : libnetfilter_cthelper-1.0.0-11.el7.x86_64 23/28
验证中 : python-dmidecode-3.12.2-4.el7.x86_64 24/28
验证中 : subscription-manager-1.24.45-1.el7.centos.x86_64 25/28
验证中 : flannel-0.7.1-4.el7.x86_64 26/28
验证中 : kubernetes-node-1.5.2-0.7.git269f928.el7.x86_64 27/28
验证中 : socat-1.7.3.2-2.el7.x86_64 28/28
已安装:
flannel.x86_64 0:0.7.1-4.el7 kubernetes-node.x86_64 0:1.5.2-0.7.git269f928.el7
作为依赖被安装:
atomic-registries.x86_64 1:1.22.1-33.gitb507039.el7_8 conntrack-tools.x86_64 0:1.4.4-7.el7 container-selinux.noarch 2:2.119.2-1.911c772.el7_8
container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 containers-common.x86_64 1:0.1.40-11.el7_8 docker.x86_64 2:1.13.1-203.git0be3e21.el7.centos
docker-client.x86_64 2:1.13.1-203.git0be3e21.el7.centos docker-common.x86_64 2:1.13.1-203.git0be3e21.el7.centos fuse-overlayfs.x86_64 0:0.7.2-6.el7_8
fuse3-libs.x86_64 0:3.6.1-4.el7 kubernetes-client.x86_64 0:1.5.2-0.7.git269f928.el7 libnetfilter_cthelper.x86_64 0:1.0.0-11.el7
libnetfilter_cttimeout.x86_64 0:1.0.0-7.el7 libnetfilter_queue.x86_64 0:1.0.2-2.el7_2 oci-register-machine.x86_64 1:0-6.git2b44233.el7
oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6 oci-umount.x86_64 2:2.5-3.el7 python-dateutil.noarch 0:1.5-7.el7
python-dmidecode.x86_64 0:3.12.2-4.el7 python-pytoml.noarch 0:0.1.14-1.git7dea353.el7 python-syspurpose.x86_64 0:1.24.45-1.el7.centos
slirp4netns.x86_64 0:0.4.3-4.el7_8 socat.x86_64 0:1.7.3.2-2.el7 subscription-manager.x86_64 0:1.24.45-1.el7.centos
subscription-manager-rhsm.x86_64 0:1.24.45-1.el7.centos subscription-manager-rhsm-certificates.x86_64 0:1.24.45-1.el7.centos
完毕!
[root@localhost ~]#
3.2、为flannel网络指定etcd服务,修改/etc/sysconfig/flanneld文件,配置结果如下图:
注意先备份原文件,在编辑,以免改错,以下vi操作均是先备份在vi。
以下为修改后的内容:FLANNEL_ETCD_ENDPOINTS="http://192.168.188.140:2379" --为Master的IP
vi /etc/sysconfig/flanneld
[root@localhost sysconfig]# vi flanneld
# Flanneld configuration options
# etcd url location. Point this to the server where etcd runs
FLANNEL_ETCD_ENDPOINTS="http://192.168.188.140:2379"
# etcd config key. This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_PREFIX="/atomic.io/network"
# Any additional options that you want to pass
#FLANNEL_OPTIONS=""
3.3、修改:vi /etc/kubernetes/config文件,配置结果如下图:
注意先备份原文件,在编辑,以免改错,以下vi操作均是先备份在vi。
以下为修改后的内容:KUBE_MASTER="--master=http://192.168.188.140:8080" --为Master的IP
[root@localhost kubernetes]# vi config
###
# kubernetes system config
#
# The following values are used to configure various aspects of all
# kubernetes services, including
#
# kube-apiserver.service
# kube-controller-manager.service
# kube-scheduler.service
# kubelet.service
# kube-proxy.service
# logging to stderr means we get it in the systemd journal
KUBE_LOGTOSTDERR="--logtostderr=true"
# journal message level, 0 is debug
KUBE_LOG_LEVEL="--v=0"
# Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow-privileged=false"
# How the controller-manager, scheduler, and proxy find the apiserver
KUBE_MASTER="--master=http://192.168.188.140:8080"
3.4、修改node机的kubelet配置文件/etc/kubernetes/kubelet
注意先备份原文件,在编辑,以免改错,以下vi操作均是先备份在vi。
以下为修改后的内容:
KUBELET_HOSTNAME="--hostname-override=192.168.188.141" --为本Node节点的IP
[root@localhost kubernetes]# vi kubelet
###
# kubernetes kubelet (minion) config
# The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
KUBELET_ADDRESS="--address=0.0.0.0"
# The port for the info server to serve on
# KUBELET_PORT="--port=10250"
# You may leave this blank to use the actual hostname
KUBELET_HOSTNAME="--hostname-override=192.168.188.141"
# location of the api-server
KUBELET_API_SERVER="--api-servers=http://192.168.188.140:8080"
# pod infrastructure container
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest"
# Add your own!
KUBELET_ARGS=""
~
~
3.5、node节点机上启动kube-proxy,kubelet,docker,flanneld等服务,并设置开机启动。
for SERVICES in kube-proxy kubelet docker flanneld;do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES; done
[root@localhost kubernetes]# for SERVICES in kube-proxy kubelet docker flanneld;do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES; done
Created symlink from /etc/systemd/system/multi-user.target.wants/kube-proxy.service to /usr/lib/systemd/system/kube-proxy.service.
● kube-proxy.service - Kubernetes Kube-Proxy Server
Loaded: loaded (/usr/lib/systemd/system/kube-proxy.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-01-05 00:34:58 CST; 138ms ago
Docs: https://github.com/GoogleCloudPlatform/kubernetes
Main PID: 9704 (kube-proxy)
CGroup: /system.slice/kube-proxy.service
└─9704 /usr/bin/kube-proxy --logtostderr=true --v=0 --master=http://192.168.188.140:8080
1月 05 00:34:58 localhost.localdomain systemd[1]: Started Kubernetes Kube-Proxy Server.
Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
● kubelet.service - Kubernetes Kubelet Server
Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-01-05 00:35:00 CST; 149ms ago
Docs: https://github.com/GoogleCloudPlatform/kubernetes
Main PID: 9963 (kubelet)
CGroup: /system.slice/kubelet.service
└─9963 /usr/bin/kubelet --logtostderr=true --v=0 --api-servers=http://192.168.188.140:8080 --address=0.0.0.0 --hostname-override=192.168.188.141 --allow-privileged=false --pod...
1月 05 00:35:00 localhost.localdomain systemd[1]: Started Kubernetes Kubelet Server.
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/docker.service.d
└─flannel.conf
Active: active (running) since 二 2021-01-05 00:35:02 CST; 140ms ago
Docs: http://docs.docker.com
Main PID: 10075 (dockerd-current)
CGroup: /system.slice/docker.service
├─10075 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userl...
└─10083 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/l...
1月 05 00:35:01 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:01.682586875+08:00" level=info msg="libcontainerd: new containerd process, pid: 10083"
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.770410934+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.771208972+08:00" level=info msg="Loading containers: start."
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.782846850+08:00" level=info msg="Firewalld running: false"
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.893439647+08:00" level=info msg="Default bridge (docker0) is assigned with an IP addres...P address"
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.918210612+08:00" level=info msg="Loading containers: done."
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.939041188+08:00" level=info msg="Daemon has completed initialization"
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.939084442+08:00" level=info msg="Docker daemon" commit="0be3e21/1.13.1" graphdriver=ove...ion=1.13.1
1月 05 00:35:02 localhost.localdomain dockerd-current[10075]: time="2021-01-05T00:35:02.942743123+08:00" level=info msg="API listen on /var/run/docker.sock"
1月 05 00:35:02 localhost.localdomain systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
Created symlink from /etc/systemd/system/multi-user.target.wants/flanneld.service to /usr/lib/systemd/system/flanneld.service.
Created symlink from /etc/systemd/system/docker.service.wants/flanneld.service to /usr/lib/systemd/system/flanneld.service.
● flanneld.service - Flanneld overlay address etcd agent
Loaded: loaded (/usr/lib/systemd/system/flanneld.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2021-01-05 00:35:03 CST; 153ms ago
Main PID: 10261 (flanneld)
CGroup: /system.slice/flanneld.service
└─10261 /usr/bin/flanneld -etcd-endpoints=http://192.168.188.140:2379 -etcd-prefix=/atomic.io/network
1月 05 00:35:03 localhost.localdomain systemd[1]: Starting Flanneld overlay address etcd agent...
1月 05 00:35:03 localhost.localdomain flanneld-start[10261]: I0105 00:35:03.141961 10261 main.go:132] Installing signal handlers
1月 05 00:35:03 localhost.localdomain flanneld-start[10261]: I0105 00:35:03.143438 10261 manager.go:136] Determining IP address of default interface
1月 05 00:35:03 localhost.localdomain flanneld-start[10261]: I0105 00:35:03.144660 10261 manager.go:149] Using interface with name ens33 and address 192.168.188.141
1月 05 00:35:03 localhost.localdomain flanneld-start[10261]: I0105 00:35:03.144675 10261 manager.go:166] Defaulting external address to interface address (192.168.188.141)
1月 05 00:35:03 localhost.localdomain flanneld-start[10261]: I0105 00:35:03.191641 10261 local_manager.go:179] Picking subnet in range 172.17.1.0 ... 172.17.255.0
1月 05 00:35:03 localhost.localdomain flanneld-start[10261]: I0105 00:35:03.194181 10261 manager.go:250] Lease acquired: 172.17.21.0/24
1月 05 00:35:03 localhost.localdomain flanneld-start[10261]: I0105 00:35:03.194804 10261 network.go:98] Watching for new subnet leases
1月 05 00:35:03 localhost.localdomain systemd[1]: Started Flanneld overlay address etcd agent.
[root@localhost kubernetes]#
------------------------------以上所有master主机,node节点机上的配置完成,接下来看看k8s集群是否搭建起来了:------------------------------
在master主机上192.168.26.227执行如下命令,查看运行的node节点机器:
kubectl get nodes
[root@localhost kubernetes]# kubectl get nodes
NAME STATUS AGE
192.168.188.141 Ready 46s
[root@localhost kubernetes]# kubectl get nodes -owide
NAME STATUS AGE EXTERNAL-IP
192.168.188.141 Ready 55s <none>
[root@localhost kubernetes]# kubectl get namespace
NAME STATUS AGE
default Active 14m
更多推荐
所有评论(0)