In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to install Kubernetes cluster in CentOS7, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
CentOS7 (mini) install Kubernetes cluster (kubeadm mode) install CentOS
Install net-tools
[root@localhost ~] # yum install-y net-tools
Close firewalld
[root@localhost ~] # systemctl stop firewalld & & systemctl disable firewalldRemoved symlink / etc/systemd/system/multi-user.target.wants/firewalld.service.Removed symlink / etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@localhost ~] # setenforce 0 [root@localhost ~] # sed-I's to install Docker
Today, Docker is divided into two versions: Docker-CE and Docker-EE. CE is the community version, that is, the free version, and EE is the enterprise version, that is, the commercial version. We chose to use CE version.
Install the yum source kit
[root@localhost ~] # yum install-y yum-utils device-mapper-persistent-data lvm2
Download docker-ce 's official yum source configuration file
[root@localhost ~] # yum-config-manager-- add-repo https://download.docker.com/linux/centos/docker-ce.repo
Disable docker-c-edge source with edge is not developed version, unstable, download stable version
Yum-config-manager-disable docker-ce-edge
Update the local YUM source cache
Yum makecache fast
Install the corresponding version of Docker-ce
Yum-y install docker-ce
Run hello world
[root@localhost ~] # systemctl start docker [root@localhost ~] # docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world9a0669468bf7: Pull completeDigest: sha256:0e06ef5e1945a718b02a8c319e15bae44f47039005530bc617a5d071190ed3fcStatus: Downloaded newer image for hello-world:latestHello from docking this message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $docker run-it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/For more examples and ideas, visit: https://docs.docker.com/engine/userguide/ install kubelet and kubeadm packages
Using the kubeadm init command to initialize the download Docker image of the cluster to all hosts will download the necessary dependent images of kubeadm and install etcd,kube-dns,kube-proxy at the same time. Due to our GFW firewall problem, we cannot directly access the images, so we first download the images in the following list by other methods, then import them into the system, and then use kubeadm init to initialize the cluster.
Use the DaoCloud accelerator (you can skip this step)
[root@localhost ~] # curl-sSL https://get.daocloud.io/daotools/set_mirror.sh | sh-s http://0d236e3f.m.daocloud.iodocker version > = 1.12 {"registry-mirrors": ["http://0d236e3f.m.daocloud.io"]}Success.You need to restart docker to take effect: sudo systemctl restart docker [root@localhost ~] # systemctl restart docker
Download the image and generate a pair of images via Dockerfile to dockerhub, or you can clone my
Images= (kube-controller-manager-amd64 etcd-amd64 k8s-dns-sidecar-amd64 kube-proxy-amd64 kube-apiserver-amd64 kube-scheduler-amd64 pause-amd64 k8s-dns-dnsmasq-nanny-amd64 k8s-dns-kube-dns-amd64) for imageName in ${images [@]}; do docker pull champly/$imageName docker tag champly/$imageName gcr.io/google_containers/$imageName docker rmi champly/$imageNamedone
Modified version
Docker tag gcr.io/google_containers/etcd-amd64 gcr.io/google_containers/etcd-amd64:3.0.17 & &\ docker rmi gcr.io/google_containers/etcd-amd64 & &\ docker tag gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64 gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.5 & &\ docker rmi gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64 & &\ Docker tag gcr.io/google_containers/k8s-dns-kube-dns-amd64 gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.5 & &\ docker rmi gcr.io/google_containers/k8s-dns-kube-dns-amd64 & &\ docker tag gcr.io/google_containers/k8s-dns-sidecar-amd64 gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.2 & &\ docker rmi gcr.io/google_containers / k8s-dns-sidecar-amd64 & &\ docker tag gcr.io/google_containers/kube-apiserver-amd64 gcr.io/google_containers/kube-apiserver-amd64:v1.7.5 & &\ docker rmi gcr.io/google_containers/kube-apiserver-amd64 & &\ docker tag gcr.io/google_containers/kube-controller-manager-amd64 gcr.io/google_containers/kube-controller-manager-amd64:v1.7.5 &\ docker rmi gcr.io/google_containers / kube-controller-manager-amd64 & &\ docker tag gcr.io/google_containers/kube-proxy-amd64 gcr.io/google_containers/kube-proxy-amd64:v1.6.0 & &\ docker rmi gcr.io/google_containers/kube-proxy-amd64 & &\ docker tag gcr.io/google_containers/kube-scheduler-amd64 gcr.io/google_containers/kube-scheduler-amd64:v1.7.5 &\ docker rmi gcr.io/google_containers/kube-scheduler -amd64 & &\ docker tag gcr.io/google_containers/pause-amd64 gcr.io/google_containers/pause-amd64:3.0 & &\ docker rmi gcr.io/google_containers/pause-amd64
Add Ali source
[root@localhost ~] # cat > > / etc/yum.repos.d/kubernetes.repo
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.