本文是 kubernets集群实验的部署操作。
以下是操作过程:
安装docker
[root@localhost master]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
docker-ce-stable | 3.5 kB 00:00:00
kubernetes | 1.4 kB 00:00:00
(1/3): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00
(2/3): docker-ce-stable/x86_64/primary_db | 41 kB 00:00:00
(3/3): kubernetes/primary | 66 kB 00:00:00
kubernetes 484/484
No packages marked for update
[root@localhost master]#
[root@localhost master]# yum install -y docker-ce-18.06.1.ce-3.el7
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
...........................................................................................
Complete!
[root@localhost master]# systemctl enable docker && systemctl start docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost master]#
[root@localhost master]# docker --version
Docker version 18.06.1-ce, build e68fc7a
[root@localhost master]#
[root@localhost master]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-862.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.779GiB
Name: kubernetes-master
ID: 5AUK:3LA6:CX2R:3GIU:HHEN:LJQ6:LKEA:QIJY:KJIC:VCIL:AESJ:YBH7
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
[root@localhost master]#
[root@localhost work0]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
docker-ce-stable | 3.5 kB 00:00:00
kubernetes | 1.4 kB 00:00:00
(1/3): docker-ce-stable/x86_64/primary_db | 41 kB 00:00:00
(2/3): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00
(3/3): kubernetes/primary | 66 kB 00:00:00
kubernetes 484/484
No packages marked for update
[root@localhost work0]#
[root@localhost work0]# yum install -y docker-ce-18.06.1.ce-3.el7
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
.......................................................................................
Complete!
[root@localhost work0]# systemctl enable docker && systemctl start docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost work0]# docker --version
Docker version 18.06.1-ce, build e68fc7a
[root@localhost work0]#
[root@localhost work0]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-862.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.779GiB
Name: kubernetes-node00
ID: PSXR:XYKM:ONZ3:PLNS:G5LW:WIHH:YT47:RTSG:2L4Z:QHC4:5KSE:6GBX
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
[root@localhost work0]#
[root@localhost work1]# yum -y update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
docker-ce-stable | 3.5 kB 00:00:00
kubernetes | 1.4 kB 00:00:00
(1/3): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00
(2/3): docker-ce-stable/x86_64/primary_db | 41 kB 00:00:00
(3/3): kubernetes/primary | 66 kB 00:00:00
kubernetes 484/484
No packages marked for update
[root@localhost work1]#
[root@localhost work1]# yum install -y docker-ce-18.06.1.ce-3.el7
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
...........................................................................................
Complete!
[root@localhost work1]# systemctl enable docker && systemctl start docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost work1]# docker --version
Docker version 18.06.1-ce, build e68fc7a
[root@localhost work1]#
[root@localhost work1]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-862.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.779GiB
Name: kubernetes-node01
ID: KAVQ:EEUQ:NXGC:Y6UJ:5GQ6:56ZU:5BJZ:PKDX:L7R5:PECV:4KMR:PXD4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
[root@localhost work1]#
###########################################################
安装kubeadm,kubelet和kubectl
[root@localhost master]# yum install -y kubelet-1.15.0 kubeadm-1.15.0 kubectl-1.15.0
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
...............................................................................
Complete!
[root@localhost master]# systemctl enable kubelet
Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
[root@localhost master]#
[root@localhost master]# cat >> /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://dlbpv56y.mirror.aliyuncs.com"]
}
EOF
[root@localhost master]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://dlbpv56y.mirror.aliyuncs.com"]
}
[root@localhost master]#
[root@localhost work0]# yum install -y kubelet-1.15.0 kubeadm-1.15.0 kubectl-1.15.0
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
...................................................................................
Complete!
[root@localhost work0]# systemctl enable kubelet
Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
[root@localhost work0]# cat >> /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://dlbpv56y.mirror.aliyuncs.com"]
}
EOF
[root@localhost work0]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://dlbpv56y.mirror.aliyuncs.com"]
}
[root@localhost work0]#
[root@localhost work1]# yum install -y kubelet-1.15.0 kubeadm-1.15.0 kubectl-1.15.0
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
........................................................................................
Complete!
[root@localhost work1]# systemctl enable kubelet
Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
[root@localhost work1]# cat >> /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://dlbpv56y.mirror.aliyuncs.com"]
}
EOF
[root@localhost work1]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://dlbpv56y.mirror.aliyuncs.com"]
}
[root@localhost work1]#
孟伯,20200411
交流联系:微信 1807479153 ,QQ 1807479153