kube cluster on centos 7 master / worker
root@localhost ~]# firewall-cmd --permanent --add-port=6443/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=2379-2380/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10250/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10251/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10252/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10255/tcp
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# swapoff -a
[root@localhost ~]# vi /etc/fstab
[root@localhost ~]# kubeadm init
I1117 13:48:17.195660 17447 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.2. Latest validated version: 18.09
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# yum remove docker-*
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:19.03.2-3.el7 will be erased
---> Package docker-ce-cli.x86_64 1:19.03.2-3.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
docker-ce x86_64 3:19.03.2-3.el7 @docker-ce-stable 104 M
docker-ce-cli x86_64 1:19.03.2-3.el7 @docker-ce-stable 169 M
Transaction Summary
================================================================================
Remove 2 Packages
Installed size: 272 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 3:docker-ce-19.03.2-3.el7.x86_64 1/2
Erasing : 1:docker-ce-cli-19.03.2-3.el7.x86_64 2/2
Verifying : 3:docker-ce-19.03.2-3.el7.x86_64 1/2
Verifying : 1:docker-ce-cli-19.03.2-3.el7.x86_64 2/2
Removed:
docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-cli.x86_64 1:19.03.2-3.el7
Complete!
[root@localhost ~]# yum install docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.praction.in
* extras: mirrors.praction.in
* updates: mirrors.praction.in
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.13.1-103.git7f2769b.el7.centos will be installed
--> Processing Dependency: docker-common = 2:1.13.1-103.git7f2769b.el7.centos for package: 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: docker-client = 2:1.13.1-103.git7f2769b.el7.centos for package: 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: subscription-manager-rhsm-certificates for package: 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Running transaction check
---> Package docker-client.x86_64 2:1.13.1-103.git7f2769b.el7.centos will be installed
---> Package docker-common.x86_64 2:1.13.1-103.git7f2769b.el7.centos will be installed
--> Processing Dependency: skopeo-containers >= 1:0.1.26-2 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: oci-umount >= 2:2.3.3-3 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: oci-systemd-hook >= 1:0.1.4-9 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: oci-register-machine >= 1:0-5.13 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: container-storage-setup >= 0.9.0-1 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: atomic-registries for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
---> Package subscription-manager-rhsm-certificates.x86_64 0:1.24.13-3.el7.centos will be installed
--> Running transaction check
---> Package atomic-registries.x86_64 1:1.22.1-29.gitb507039.el7 will be installed
--> Processing Dependency: python-pytoml for package: 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64
---> Package container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 will be installed
---> Package containers-common.x86_64 1:0.1.37-3.el7.centos will be installed
---> Package oci-register-machine.x86_64 1:0-6.git2b44233.el7 will be installed
---> Package oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6 will be installed
---> Package oci-umount.x86_64 2:2.5-3.el7 will be installed
--> Running transaction check
---> Package python-pytoml.noarch 0:0.1.14-1.git7dea353.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
docker x86_64 2:1.13.1-103.git7f2769b.el7.centos extras 18 M
Installing for dependencies:
atomic-registries x86_64 1:1.22.1-29.gitb507039.el7 extras 35 k
container-storage-setup
noarch 0.11.0-2.git5eaf76c.el7 extras 35 k
containers-common x86_64 1:0.1.37-3.el7.centos extras 21 k
docker-client x86_64 2:1.13.1-103.git7f2769b.el7.centos extras 3.9 M
docker-common x86_64 2:1.13.1-103.git7f2769b.el7.centos extras 97 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-pytoml noarch 0.1.14-1.git7dea353.el7 extras 18 k
subscription-manager-rhsm-certificates
x86_64 1.24.13-3.el7.centos updates 228 k
Transaction Summary
================================================================================
Install 1 Package (+10 Dependent packages)
Total download size: 23 M
Installed size: 81 M
Is this ok [y/d/N]: y
Downloading packages:
(1/11): atomic-registries-1.22.1-29.gitb507039.el7.x86_64. | 35 kB 00:01
(2/11): container-storage-setup-0.11.0-2.git5eaf76c.el7.no | 35 kB 00:01
(3/11): docker-common-1.13.1-103.git7f2769b.el7.centos.x86 | 97 kB 00:00
(4/11): oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64.r | 34 kB 00:00
(5/11): containers-common-0.1.37-3.el7.centos.x86_64.rpm | 21 kB 00:01
(6/11): oci-umount-2.5-3.el7.x86_64.rpm | 33 kB 00:00
(7/11): oci-register-machine-0-6.git2b44233.el7.x86_64.rpm | 1.1 MB 00:01
(8/11): python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm | 18 kB 00:00
(9/11): subscription-manager-rhsm-certificates-1.24.13-3.e | 228 kB 00:00
(10/11): docker-client-1.13.1-103.git7f2769b.el7.centos.x8 | 3.9 MB 00:03
(11/11): docker-1.13.1-103.git7f2769b.el7.centos.x86_64.rp | 18 MB 00:12
--------------------------------------------------------------------------------
Total 1.7 MB/s | 23 MB 00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : subscription-manager-rhsm-certificates-1.24.13-3.el7.cen 1/11
Installing : python-pytoml-0.1.14-1.git7dea353.el7.noarch 2/11
Installing : 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 3/11
Installing : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 4/11
Installing : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 5/11
Installing : 2:oci-umount-2.5-3.el7.x86_64 6/11
Installing : 1:containers-common-0.1.37-3.el7.centos.x86_64 7/11
Installing : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 8/11
Installing : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64 9/11
Installing : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64 10/11
Installing : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64 11/11
Verifying : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64 1/11
Verifying : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64 2/11
Verifying : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 3/11
Verifying : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64 4/11
Verifying : 1:containers-common-0.1.37-3.el7.centos.x86_64 5/11
Verifying : 2:oci-umount-2.5-3.el7.x86_64 6/11
Verifying : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 7/11
Verifying : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 8/11
Verifying : python-pytoml-0.1.14-1.git7dea353.el7.noarch 9/11
Verifying : 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 10/11
Verifying : subscription-manager-rhsm-certificates-1.24.13-3.el7.cen 11/11
Installed:
docker.x86_64 2:1.13.1-103.git7f2769b.el7.centos
Dependency Installed:
atomic-registries.x86_64 1:1.22.1-29.gitb507039.el7
container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7
containers-common.x86_64 1:0.1.37-3.el7.centos
docker-client.x86_64 2:1.13.1-103.git7f2769b.el7.centos
docker-common.x86_64 2:1.13.1-103.git7f2769b.el7.centos
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-pytoml.noarch 0:0.1.14-1.git7dea353.el7
subscription-manager-rhsm-certificates.x86_64 0:1.24.13-3.el7.centos
Complete!
[root@localhost ~]# kubeadm init
I1117 13:52:15.307627 17808 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
[preflight] The system verification failed. Printing the output from the verification:
KERNEL_VERSION: 3.10.0-957.27.2.el7.x86_64
CONFIG_NAMESPACES: enabled
CONFIG_NET_NS: enabled
CONFIG_PID_NS: enabled
CONFIG_IPC_NS: enabled
CONFIG_UTS_NS: enabled
CONFIG_CGROUPS: enabled
CONFIG_CGROUP_CPUACCT: enabled
CONFIG_CGROUP_DEVICE: enabled
CONFIG_CGROUP_FREEZER: enabled
CONFIG_CGROUP_SCHED: enabled
CONFIG_CPUSETS: enabled
CONFIG_MEMCG: enabled
CONFIG_INET: enabled
CONFIG_EXT4_FS: enabled (as module)
CONFIG_PROC_FS: enabled
CONFIG_NETFILTER_XT_TARGET_REDIRECT: enabled (as module)
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled (as module)
CONFIG_OVERLAY_FS: enabled (as module)
CONFIG_AUFS_FS: not set - Required for aufs.
CONFIG_BLK_DEV_DM: enabled (as module)
OS: Linux
CGROUPS_CPU: enabled
CGROUPS_CPUACCT: enabled
CGROUPS_CPUSET: enabled
CGROUPS_DEVICES: enabled
CGROUPS_FREEZER: enabled
CGROUPS_MEMORY: enabled
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
, error: exit status 1
[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
[ERROR IsDockerSystemdCheck]: cannot execute 'docker info': exit status 1
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
[ERROR SystemVerification]: failed to get docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# kubeadm init
I1117 13:52:52.470608 17898 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[preflight] The system verification failed. Printing the output from the verification:
KERNEL_VERSION: 3.10.0-957.27.2.el7.x86_64
CONFIG_NAMESPACES: enabled
CONFIG_NET_NS: enabled
CONFIG_PID_NS: enabled
CONFIG_IPC_NS: enabled
CONFIG_UTS_NS: enabled
CONFIG_CGROUPS: enabled
CONFIG_CGROUP_CPUACCT: enabled
CONFIG_CGROUP_DEVICE: enabled
CONFIG_CGROUP_FREEZER: enabled
CONFIG_CGROUP_SCHED: enabled
CONFIG_CPUSETS: enabled
CONFIG_MEMCG: enabled
CONFIG_INET: enabled
CONFIG_EXT4_FS: enabled (as module)
CONFIG_PROC_FS: enabled
CONFIG_NETFILTER_XT_TARGET_REDIRECT: enabled (as module)
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled (as module)
CONFIG_OVERLAY_FS: enabled (as module)
CONFIG_AUFS_FS: not set - Required for aufs.
CONFIG_BLK_DEV_DM: enabled (as module)
OS: Linux
CGROUPS_CPU: enabled
CGROUPS_CPUACCT: enabled
CGROUPS_CPUSET: enabled
CGROUPS_DEVICES: enabled
CGROUPS_FREEZER: enabled
CGROUPS_MEMORY: enabled
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
, error: exit status 1
[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
[ERROR IsDockerSystemdCheck]: cannot execute 'docker info': exit status 1
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
[ERROR SystemVerification]: failed to get docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@localhost ~]# modprobe br_netfilter
[root@localhost ~]# echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
[root@localhost ~]# kubeadm init
I1117 13:53:52.908577 18161 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Activating the kubelet service
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [localhost.localdomain kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.0.106]
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [localhost.localdomain localhost] and IPs [192.168.0.106 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [localhost.localdomain localhost] and IPs [192.168.0.106 127.0.0.1 ::1]
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[kubelet-check] Initial timeout of 40s passed.
[apiclient] All control plane components are healthy after 210.515993 seconds
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.15" in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node localhost.localdomain as control-plane by adding the label "node-role.kubernetes.io/master=''"
[mark-control-plane] Marking the node localhost.localdomain as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: bwx3bd.z0g4vu63j2lndjwa
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy
Your Kubernetes control-plane has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
Then you can join any number of worker nodes by running the following on each as root:
kubeadm join 192.168.0.106:6443 --token bwx3bd.z0g4vu63j2lndjwa \
--discovery-token-ca-cert-hash sha256:37c24eda8c8422062448d0d824516edc36b5fbe9ff83138dd4862afaa6dad927
[root@localhost ~]#
success
[root@localhost ~]# firewall-cmd --permanent --add-port=2379-2380/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10250/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10251/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10252/tcp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=10255/tcp
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# swapoff -a
[root@localhost ~]# vi /etc/fstab
[root@localhost ~]# kubeadm init
I1117 13:48:17.195660 17447 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.2. Latest validated version: 18.09
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# yum remove docker-*
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:19.03.2-3.el7 will be erased
---> Package docker-ce-cli.x86_64 1:19.03.2-3.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
docker-ce x86_64 3:19.03.2-3.el7 @docker-ce-stable 104 M
docker-ce-cli x86_64 1:19.03.2-3.el7 @docker-ce-stable 169 M
Transaction Summary
================================================================================
Remove 2 Packages
Installed size: 272 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 3:docker-ce-19.03.2-3.el7.x86_64 1/2
Erasing : 1:docker-ce-cli-19.03.2-3.el7.x86_64 2/2
Verifying : 3:docker-ce-19.03.2-3.el7.x86_64 1/2
Verifying : 1:docker-ce-cli-19.03.2-3.el7.x86_64 2/2
Removed:
docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-cli.x86_64 1:19.03.2-3.el7
Complete!
[root@localhost ~]# yum install docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.praction.in
* extras: mirrors.praction.in
* updates: mirrors.praction.in
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.13.1-103.git7f2769b.el7.centos will be installed
--> Processing Dependency: docker-common = 2:1.13.1-103.git7f2769b.el7.centos for package: 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: docker-client = 2:1.13.1-103.git7f2769b.el7.centos for package: 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: subscription-manager-rhsm-certificates for package: 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Running transaction check
---> Package docker-client.x86_64 2:1.13.1-103.git7f2769b.el7.centos will be installed
---> Package docker-common.x86_64 2:1.13.1-103.git7f2769b.el7.centos will be installed
--> Processing Dependency: skopeo-containers >= 1:0.1.26-2 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: oci-umount >= 2:2.3.3-3 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: oci-systemd-hook >= 1:0.1.4-9 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: oci-register-machine >= 1:0-5.13 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: container-storage-setup >= 0.9.0-1 for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
--> Processing Dependency: atomic-registries for package: 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64
---> Package subscription-manager-rhsm-certificates.x86_64 0:1.24.13-3.el7.centos will be installed
--> Running transaction check
---> Package atomic-registries.x86_64 1:1.22.1-29.gitb507039.el7 will be installed
--> Processing Dependency: python-pytoml for package: 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64
---> Package container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7 will be installed
---> Package containers-common.x86_64 1:0.1.37-3.el7.centos will be installed
---> Package oci-register-machine.x86_64 1:0-6.git2b44233.el7 will be installed
---> Package oci-systemd-hook.x86_64 1:0.2.0-1.git05e6923.el7_6 will be installed
---> Package oci-umount.x86_64 2:2.5-3.el7 will be installed
--> Running transaction check
---> Package python-pytoml.noarch 0:0.1.14-1.git7dea353.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
docker x86_64 2:1.13.1-103.git7f2769b.el7.centos extras 18 M
Installing for dependencies:
atomic-registries x86_64 1:1.22.1-29.gitb507039.el7 extras 35 k
container-storage-setup
noarch 0.11.0-2.git5eaf76c.el7 extras 35 k
containers-common x86_64 1:0.1.37-3.el7.centos extras 21 k
docker-client x86_64 2:1.13.1-103.git7f2769b.el7.centos extras 3.9 M
docker-common x86_64 2:1.13.1-103.git7f2769b.el7.centos extras 97 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-pytoml noarch 0.1.14-1.git7dea353.el7 extras 18 k
subscription-manager-rhsm-certificates
x86_64 1.24.13-3.el7.centos updates 228 k
Transaction Summary
================================================================================
Install 1 Package (+10 Dependent packages)
Total download size: 23 M
Installed size: 81 M
Is this ok [y/d/N]: y
Downloading packages:
(1/11): atomic-registries-1.22.1-29.gitb507039.el7.x86_64. | 35 kB 00:01
(2/11): container-storage-setup-0.11.0-2.git5eaf76c.el7.no | 35 kB 00:01
(3/11): docker-common-1.13.1-103.git7f2769b.el7.centos.x86 | 97 kB 00:00
(4/11): oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64.r | 34 kB 00:00
(5/11): containers-common-0.1.37-3.el7.centos.x86_64.rpm | 21 kB 00:01
(6/11): oci-umount-2.5-3.el7.x86_64.rpm | 33 kB 00:00
(7/11): oci-register-machine-0-6.git2b44233.el7.x86_64.rpm | 1.1 MB 00:01
(8/11): python-pytoml-0.1.14-1.git7dea353.el7.noarch.rpm | 18 kB 00:00
(9/11): subscription-manager-rhsm-certificates-1.24.13-3.e | 228 kB 00:00
(10/11): docker-client-1.13.1-103.git7f2769b.el7.centos.x8 | 3.9 MB 00:03
(11/11): docker-1.13.1-103.git7f2769b.el7.centos.x86_64.rp | 18 MB 00:12
--------------------------------------------------------------------------------
Total 1.7 MB/s | 23 MB 00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : subscription-manager-rhsm-certificates-1.24.13-3.el7.cen 1/11
Installing : python-pytoml-0.1.14-1.git7dea353.el7.noarch 2/11
Installing : 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 3/11
Installing : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 4/11
Installing : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 5/11
Installing : 2:oci-umount-2.5-3.el7.x86_64 6/11
Installing : 1:containers-common-0.1.37-3.el7.centos.x86_64 7/11
Installing : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 8/11
Installing : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64 9/11
Installing : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64 10/11
Installing : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64 11/11
Verifying : 2:docker-common-1.13.1-103.git7f2769b.el7.centos.x86_64 1/11
Verifying : 2:docker-1.13.1-103.git7f2769b.el7.centos.x86_64 2/11
Verifying : 1:oci-systemd-hook-0.2.0-1.git05e6923.el7_6.x86_64 3/11
Verifying : 2:docker-client-1.13.1-103.git7f2769b.el7.centos.x86_64 4/11
Verifying : 1:containers-common-0.1.37-3.el7.centos.x86_64 5/11
Verifying : 2:oci-umount-2.5-3.el7.x86_64 6/11
Verifying : container-storage-setup-0.11.0-2.git5eaf76c.el7.noarch 7/11
Verifying : 1:oci-register-machine-0-6.git2b44233.el7.x86_64 8/11
Verifying : python-pytoml-0.1.14-1.git7dea353.el7.noarch 9/11
Verifying : 1:atomic-registries-1.22.1-29.gitb507039.el7.x86_64 10/11
Verifying : subscription-manager-rhsm-certificates-1.24.13-3.el7.cen 11/11
Installed:
docker.x86_64 2:1.13.1-103.git7f2769b.el7.centos
Dependency Installed:
atomic-registries.x86_64 1:1.22.1-29.gitb507039.el7
container-storage-setup.noarch 0:0.11.0-2.git5eaf76c.el7
containers-common.x86_64 1:0.1.37-3.el7.centos
docker-client.x86_64 2:1.13.1-103.git7f2769b.el7.centos
docker-common.x86_64 2:1.13.1-103.git7f2769b.el7.centos
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-pytoml.noarch 0:0.1.14-1.git7dea353.el7
subscription-manager-rhsm-certificates.x86_64 0:1.24.13-3.el7.centos
Complete!
[root@localhost ~]# kubeadm init
I1117 13:52:15.307627 17808 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
[preflight] The system verification failed. Printing the output from the verification:
KERNEL_VERSION: 3.10.0-957.27.2.el7.x86_64
CONFIG_NAMESPACES: enabled
CONFIG_NET_NS: enabled
CONFIG_PID_NS: enabled
CONFIG_IPC_NS: enabled
CONFIG_UTS_NS: enabled
CONFIG_CGROUPS: enabled
CONFIG_CGROUP_CPUACCT: enabled
CONFIG_CGROUP_DEVICE: enabled
CONFIG_CGROUP_FREEZER: enabled
CONFIG_CGROUP_SCHED: enabled
CONFIG_CPUSETS: enabled
CONFIG_MEMCG: enabled
CONFIG_INET: enabled
CONFIG_EXT4_FS: enabled (as module)
CONFIG_PROC_FS: enabled
CONFIG_NETFILTER_XT_TARGET_REDIRECT: enabled (as module)
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled (as module)
CONFIG_OVERLAY_FS: enabled (as module)
CONFIG_AUFS_FS: not set - Required for aufs.
CONFIG_BLK_DEV_DM: enabled (as module)
OS: Linux
CGROUPS_CPU: enabled
CGROUPS_CPUACCT: enabled
CGROUPS_CPUSET: enabled
CGROUPS_DEVICES: enabled
CGROUPS_FREEZER: enabled
CGROUPS_MEMORY: enabled
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
, error: exit status 1
[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
[ERROR IsDockerSystemdCheck]: cannot execute 'docker info': exit status 1
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
[ERROR SystemVerification]: failed to get docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# kubeadm init
I1117 13:52:52.470608 17898 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[preflight] The system verification failed. Printing the output from the verification:
KERNEL_VERSION: 3.10.0-957.27.2.el7.x86_64
CONFIG_NAMESPACES: enabled
CONFIG_NET_NS: enabled
CONFIG_PID_NS: enabled
CONFIG_IPC_NS: enabled
CONFIG_UTS_NS: enabled
CONFIG_CGROUPS: enabled
CONFIG_CGROUP_CPUACCT: enabled
CONFIG_CGROUP_DEVICE: enabled
CONFIG_CGROUP_FREEZER: enabled
CONFIG_CGROUP_SCHED: enabled
CONFIG_CPUSETS: enabled
CONFIG_MEMCG: enabled
CONFIG_INET: enabled
CONFIG_EXT4_FS: enabled (as module)
CONFIG_PROC_FS: enabled
CONFIG_NETFILTER_XT_TARGET_REDIRECT: enabled (as module)
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled (as module)
CONFIG_OVERLAY_FS: enabled (as module)
CONFIG_AUFS_FS: not set - Required for aufs.
CONFIG_BLK_DEV_DM: enabled (as module)
OS: Linux
CGROUPS_CPU: enabled
CGROUPS_CPUACCT: enabled
CGROUPS_CPUSET: enabled
CGROUPS_DEVICES: enabled
CGROUPS_FREEZER: enabled
CGROUPS_MEMORY: enabled
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
, error: exit status 1
[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
[ERROR IsDockerSystemdCheck]: cannot execute 'docker info': exit status 1
[ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1
[ERROR SystemVerification]: failed to get docker info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@localhost ~]# modprobe br_netfilter
[root@localhost ~]# echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
[root@localhost ~]# kubeadm init
I1117 13:53:52.908577 18161 version.go:248] remote version is much newer: v1.16.3; falling back to: stable-1.15
[init] Using Kubernetes version: v1.15.6
[preflight] Running pre-flight checks
[WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[WARNING Hostname]: hostname "localhost.localdomain" could not be reached
[WARNING Hostname]: hostname "localhost.localdomain": lookup localhost.localdomain on 192.168.0.1:53: no such host
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Activating the kubelet service
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [localhost.localdomain kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.0.106]
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [localhost.localdomain localhost] and IPs [192.168.0.106 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [localhost.localdomain localhost] and IPs [192.168.0.106 127.0.0.1 ::1]
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[kubelet-check] Initial timeout of 40s passed.
[apiclient] All control plane components are healthy after 210.515993 seconds
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.15" in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node localhost.localdomain as control-plane by adding the label "node-role.kubernetes.io/master=''"
[mark-control-plane] Marking the node localhost.localdomain as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: bwx3bd.z0g4vu63j2lndjwa
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy
Your Kubernetes control-plane has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
https://kubernetes.io/docs/concepts/cluster-administration/addons/
Then you can join any number of worker nodes by running the following on each as root:
kubeadm join 192.168.0.106:6443 --token bwx3bd.z0g4vu63j2lndjwa \
--discovery-token-ca-cert-hash sha256:37c24eda8c8422062448d0d824516edc36b5fbe9ff83138dd4862afaa6dad927
[root@localhost ~]#
[root@localhost ~]# mkdir -p $HOME/.kube
[root@localhost ~]# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
cp: overwrite ‘/root/.kube/config’? y
[root@localhost ~]#
[root@localhost ~]# sudo chown $(id -u):$(id -g) $HOME/.kube/config
[root@localhost ~]# kubeadm join --token bwx3bd.z0g4vu63j2lndjwa 192.168.0.106:6443
discovery.bootstrapToken: Invalid value: "": using token-based discovery without caCertHashes can be unsafe. Set unsafeSkipCAVerification as true in your kubeadm config file or pass --discovery-token-unsafe-skip-ca-verification flag to continue
[root@localhost ~]#
[root@localhost ~]# kubeadm join --token bwx3bd.z0g4vu63j2lndjwa --discovery-token-unsafe-skip-ca-verification 192.168.0.106:6443
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR DirAvailable--etc-kubernetes-manifests]: /etc/kubernetes/manifests is not empty
[ERROR FileAvailable--etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists
[ERROR Port-10250]: Port 10250 is in use
[ERROR FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain NotReady master 4h6m v1.15.3
[root@localhost ~]# export kubever=$(kubectl version | base64 | tr -d '\n')
[root@localhost ~]# kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"
serviceaccount/weave-net created
clusterrole.rbac.authorization.k8s.io/weave-net created
clusterrolebinding.rbac.authorization.k8s.io/weave-net created
role.rbac.authorization.k8s.io/weave-net created
rolebinding.rbac.authorization.k8s.io/weave-net created
daemonset.apps/weave-net created
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain NotReady master 4h7m v1.15.3
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5c98db65d4-hfp4d 0/1 Pending 0 4h6m
kube-system coredns-5c98db65d4-lbbhn 0/1 Pending 0 4h6m
kube-system etcd-localhost.localdomain 1/1 Running 0 4h6m
kube-system kube-apiserver-localhost.localdomain 1/1 Running 3 4h7m
kube-system kube-controller-manager-localhost.localdomain 1/1 Running 4 4h5m
kube-system kube-proxy-wx7wx 1/1 Running 0 4h6m
kube-system kube-scheduler-localhost.localdomain 1/1 Running 3 4h6m
kube-system weave-net-jvn9h 0/2 ContainerCreating 0 60s
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain NotReady master 4h8m v1.15.3
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain Ready master 4h20m v1.15.3
[root@localhost ~]# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5c98db65d4-hfp4d 1/1 Running 0 4h19m
kube-system coredns-5c98db65d4-lbbhn 1/1 Running 0 4h19m
kube-system etcd-localhost.localdomain 1/1 Running 0 4h19m
kube-system kube-apiserver-localhost.localdomain 1/1 Running 3 4h20m
kube-system kube-controller-manager-localhost.localdomain 1/1 Running 4 4h18m
kube-system kube-proxy-wx7wx 1/1 Running 0 4h19m
kube-system kube-scheduler-localhost.localdomain 1/1 Running 4 4h19m
kube-system weave-net-jvn9h 2/2 Running 0 14m
[root@localhost ~]#
[root@localhost ~]# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
cp: overwrite ‘/root/.kube/config’? y
[root@localhost ~]#
[root@localhost ~]# sudo chown $(id -u):$(id -g) $HOME/.kube/config
[root@localhost ~]# kubeadm join --token bwx3bd.z0g4vu63j2lndjwa 192.168.0.106:6443
discovery.bootstrapToken: Invalid value: "": using token-based discovery without caCertHashes can be unsafe. Set unsafeSkipCAVerification as true in your kubeadm config file or pass --discovery-token-unsafe-skip-ca-verification flag to continue
[root@localhost ~]#
[root@localhost ~]# kubeadm join --token bwx3bd.z0g4vu63j2lndjwa --discovery-token-unsafe-skip-ca-verification 192.168.0.106:6443
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR DirAvailable--etc-kubernetes-manifests]: /etc/kubernetes/manifests is not empty
[ERROR FileAvailable--etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists
[ERROR Port-10250]: Port 10250 is in use
[ERROR FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain NotReady master 4h6m v1.15.3
[root@localhost ~]# export kubever=$(kubectl version | base64 | tr -d '\n')
[root@localhost ~]# kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"
serviceaccount/weave-net created
clusterrole.rbac.authorization.k8s.io/weave-net created
clusterrolebinding.rbac.authorization.k8s.io/weave-net created
role.rbac.authorization.k8s.io/weave-net created
rolebinding.rbac.authorization.k8s.io/weave-net created
daemonset.apps/weave-net created
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain NotReady master 4h7m v1.15.3
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5c98db65d4-hfp4d 0/1 Pending 0 4h6m
kube-system coredns-5c98db65d4-lbbhn 0/1 Pending 0 4h6m
kube-system etcd-localhost.localdomain 1/1 Running 0 4h6m
kube-system kube-apiserver-localhost.localdomain 1/1 Running 3 4h7m
kube-system kube-controller-manager-localhost.localdomain 1/1 Running 4 4h5m
kube-system kube-proxy-wx7wx 1/1 Running 0 4h6m
kube-system kube-scheduler-localhost.localdomain 1/1 Running 3 4h6m
kube-system weave-net-jvn9h 0/2 ContainerCreating 0 60s
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain NotReady master 4h8m v1.15.3
[root@localhost ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
localhost.localdomain Ready master 4h20m v1.15.3
[root@localhost ~]# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-5c98db65d4-hfp4d 1/1 Running 0 4h19m
kube-system coredns-5c98db65d4-lbbhn 1/1 Running 0 4h19m
kube-system etcd-localhost.localdomain 1/1 Running 0 4h19m
kube-system kube-apiserver-localhost.localdomain 1/1 Running 3 4h20m
kube-system kube-controller-manager-localhost.localdomain 1/1 Running 4 4h18m
kube-system kube-proxy-wx7wx 1/1 Running 0 4h19m
kube-system kube-scheduler-localhost.localdomain 1/1 Running 4 4h19m
kube-system weave-net-jvn9h 2/2 Running 0 14m
[root@localhost ~]#
Comments
Post a Comment