标签:基于linux7的k8s部署 k8s Kubernetes Kubernetes集群
基于linux7的k8s部署(一)#系统环境
lsb_release -a
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core
说明:如提示:-bash: lsb_release: command not found,请yum install -y redhat-lsb
#查看selinux状态
getenforce
Disabled
#docker 版本
docker --version
Docker version 17.09.0-ce, build afdb6d4
Master 节点 | Node 节点 |
---|---|
etcd-master | kube-flannel |
kube-apiserver | kube-proxy |
kube-controller-manager | other apps |
kube-proxy | -------- |
kube-scheduler | -------- |
kube-dns | -------- |
kube-flannel | -------- |
pause-amd64 | -------- |
#下载:
kubernetes-server-linux-amd64.tar.gz
kubernetes-src.tar.gz
kubernetes.tar.gz
#解压缩
tar zxf kubernetes-server-linux-amd64.tar.gz
cd /data/k8s/kubernetes/server/bin
#创建镜像
docker load -i kube-apiserver.tar
docker load -i kube-controller-manager.tar
docker load -i kube-scheduler.tar
docker load -i kube-proxy.tar
#本次演示 kubernetes 所依赖的各个镜像列表如下:
Image Name | Version | Des ( * 必需) |
---|---|---|
k8s.gcr.io/kube-apiserver | v1.10.0 | * |
k8s.gcr.io/kube-controller-manager | v1.10.0 | * |
k8s.gcr.io/kube-scheduler | v1.10.0 | * |
k8s.gcr.io/kube-proxy | v1.10.0 | * |
k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64 | 1.14.8 | * |
k8s.gcr.io/k8s-dns-sidecar-amd64 | 1.14.8 | * |
k8s.gcr.io/k8s-dns-kube-dns-amd64 | 1.14.8 | * |
k8s.gcr.io/pause-amd64 | 3.1 | * |
quay.io/coreos/flannel | v0.9.1 | * |
quay.io/calico/node | v2.6.2 | |
quay.io/calico/cni | v1.11.0 | |
k8s.gcr.io/etcd-amd64 | 3.1.12 |
#cp文件
cp /data/k8s/kubernetes/server/bin/kubeadm /usr/bin/
cp /data/k8s/kubernetes/server/bin/kubectl /usr/bin/
cp /data/k8s/kubernetes/server/bin/kubelet /usr/bin/
#cp kubelet.service文件
mkdir kubernetes-src
tar zxf kubernetes-src.tar.gz -C ./kubernetes-src/
cd /data/k8s/kubernetes-src/build/rpms
cp ./kubelet.service /etc/systemd/system/
chmod 755 /etc/systemd/system/kubelet.service
#修改kubelet.service文件
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=http://kubernetes.io/docs/
[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10
[Install]
WantedBy=multi-user.target
#开启kubelet服务
systemctl start kubelet.service
systemctl status kubelet.service
标签:基于linux7的k8s部署 k8s Kubernetes Kubernetes集群
原文地址:http://blog.51cto.com/wutengfei/2110752