In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces Ubuntu 18.04 LTS how to install Kubernetes 1.11, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.
Here comes the combination of Ubuntu 18.04 + Kuberntes 1.11.2 + Istio 1.0.
For complete installation instructions, refer to:
Https://linuxconfig.org/how-to-install-kubernetes-on-ubuntu-18-04-bionic-beaver-linux
Other details of the installation are resolved:
Https://my.oschina.net/u/2306127/blog/1628082
Container GPU support is required. Refer to:
Http://Kubernetes installs GPU support plug-ins
Service Grid Istio installation, refer to:
Quick installation of Istio 1.0to the Kubernetes cluster
Script resources related to installation tools:
Https://github.com/openthings/kubernetes-tools
Install Docker# preparation software source sudo apt install docker.iosudo systemctl enable docker
Install Docker-CE
Add key:
Https_proxy=192.168.199.249:30999 wget https://download.docker.com/linux/ubuntu/gpg-O docker.keysudo apt-key add docker.key
Add source
Sudo echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic edge" > / etc/apt/sources.list.d/docker.listsudo apt updatesudo apt install docker-ce
Make sure that the cgroup driver used by kubelet is consistent with Docker. Or update the Docker using the following method:
Cat / etc/docker/daemon.json {"exec-opts": ["native.cgroupdriver=systemd"]} EOF
Then restart the Docker service and run:
Sudo systemctl daemon-reloadsudo systemctl restart dockerKuberntes 1.11.2 installation
Follow these steps:
Curl-s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key addsudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" # install basic support software sudo apt install kubeadm kubectl kubelet# turn off disk exchange sudo swapoff-a # clear firewall settings sudo iptables-F# set domain name sudo hostnamectl set-hostname kubernetes-master# initialization environment, note that this version number must be specified (otherwise it will hang). # specifies that CoreDNS is used as the name service. If you don't specify-- feature-gates CoreDNS=true, the default kubedns service is used. Sudo kubeadm init-- kubernetes-version=v1.11.2-- pod-network-cidr=10.244.0.0/16-- feature-gates CoreDNS=true# specifies the IP address Version 1.12.2: # sudo kubeadm init-- kubernetes-version=v1.12.2-- apiserver-advertise-address=10.1.1.201-- pod-network-cidr=10.244.0.0/16-- feature-gates CoreDNS=true# creates a user profile mkdir-p $HOME/.kubekubernetes-master:~$ sudo cp-I / etc/kubernetes/admin.conf $HOME/.kube/configkubernetes-master:~$ sudo chown $(id-u): $(id-g) $HOME/.kube/config# Security Install the network kubectl apply-f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml# and enable the master computer to view the result kubectl get pods-- all-namespaces as the working node kubectl taint nodes-- all node-role.kubernetes.io/master-#
!!! However, there are two problems:
At present, kubernetes does not have a compiled version of Ubuntu18.04, which uses 16.04 xenial binaries.
The key of the above cloud.google will make an error, use the following method to get:
Sudo apt-key adv-keyserver hkp://keyserver.ubuntu.com:80-recv-keys 6A030B21BA07F4FB
Then perform the sudo apt update and the installation steps that follow.
!!! There is a pending hang problem when installing the flannel network (the podCidr parameter is missing, even if it is specified when kubeadm is running): # View the log: kubectl get pods-- namespace kube-systemkubectl-- the kube-flannel-ds-bvxd2 above namespace kube-system logs kube-flannel-ds-bvxd2# is the pod name of flannel. Enter according to the name returned by get pods. # Edit / etc/kubernetes/manifests/kube-controller-manager.yaml in the command section, add:-- allocate-node-cidrs=true- cluster-cidr=10.244.0.0/16 and then system restart kubelet.
Detailed reference for the solution to the problem: https://github.com/coreos/flannel/issues/728
Install Helm and Dashboard
Reference:
Kubernetes Dashboard panel service installation, https://my.oschina.net/u/2306127/blog/1606599
Dashboard installation authorization login details reference, https://my.oschina.net/u/2306127/blog/1630861
Helm package Management Service installation, https://my.oschina.net/u/2306127/blog/1619818
Notice that you use sudo https_proxy=127.0.0.1:9999 helm init-- service-account tiller to add repo (you need to access gcr, but proxy makes it impossible to access the local cluster port), and then run helm init-- service-account tiller again (add helm tiller pod to the cluster).
Pull the container image in advance
At present, the latest version of kubernetes is 1.11.2, which can be pulled from the mirror library I made:
Echo "" echo "= =" echo "Pull Kubernetes 1.11.1 Images from aliyuncs.com." echo "= =" echo "" MY_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openthings## pull image docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-apiserver-amd64:v1.11.2docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-controller-manager-amd64:v1.11.2docker pull ${MY_REGISTRY} / k8sMuygcrr- Io-kube-scheduler-amd64:v1.11.2docker pull ${MY_REGISTRY} / k8s-gcr-io-kube-proxy-amd64:v1.11.2docker pull ${MY_REGISTRY} / k8s-gcr-io-etcd-amd64:3.2.18docker pull ${MY_REGISTRY} / k8s-gcr-io-pause-amd64:3.1docker pull ${MY_REGISTRY} / k8s-gcr-io-coredns:1.1.3## add Tagdocker tag ${MY_REGISTRY} / k8s-gcr -io-kube-apiserver-amd64:v1.11.2 k8s.gcr.io/kube-apiserver-amd64:v1.11.2docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-scheduler-amd64:v1.11.2 k8s.gcr.io/kube-scheduler-amd64:v1.11.2docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-controller-manager-amd64:v1.11.2 k8s.gcr.io/kube-controller-manager-amd64:v1.11.2docker tag ${MY_REGISTRY} / k8s-gcr-io-kube-proxy-amd64:v1.11.2 k8s.gcr.io/kube-proxy-amd64:v1.11.2docker tag ${MY_REGISTRY} / k8s-gcr-io-etcd-amd64:3.2.18 k8s.gcr.io/etcd-amd64:3.2.18docker tag ${MY_REGISTRY} / k8s-gcr-io-pause-amd64:3.1 k8s.gcr.io/pause-amd64:3.1docker tag ${MY_REGISTRY} / k8s-gcr-io-coredns:1.1.3 k8s.gcr.io/coredns:1.1.3echo "" echo "= =" echo "Pull Kubernetes 1.11.2 Images FINISHED." echo "into registry.cn-hangzhou.aliyuncs.com/openthings "echo" by openthings@ https://my.oschina.net/u/2306127."echo "=" echo ""
Save the above as a script file and run it.
Then run kubeadm init to initialize the cluster.
Then install Istio 1.0
Quick installation of Istio 1.0to the Kubernetes cluster
Kubenetes service does not start problem
After restarting the system, if you find that the kubelet service is not up, first check:
Nano / etc/fstab# comment out the swap line inside.
Finally, add the KUBELET_CGROUP_ARGS and KUBELET_EXTRA_ARGS parameters to the / etc/systemd/system/kubelet.service.d/10-kubeadm.conf file, and note that you should also add the startup parameters as follows:
Environment= "KUBELET_CGROUP_ARGS=--cgroup-driver=systemd" Environment= "KUBELET_EXTRA_ARGS=--fail-swap-on=false" ExecStart=ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_AUTHZ_ARGS $KUBELET_CADVISOR_ARGS $KUBELET_CERTIFICATE_ARGS $KUBELET_CGROUP_ARGS $KUBELET_EXTRA_ARGS! Then restart the kubelet service and run: systemctl daemon-reloadsystemctl restart kubelet thanks you for reading this article carefully. I hope the article "Ubuntu 18.04 LTS how to install Kubernetes 1.11" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.