In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces you how to install minikube,kubectl and achieve Kubernetes cluster deployment, the content is very detailed, interested friends can refer to, hope to be helpful to you.
(1) install kubectl
Curl-LO https://storage.googleapis.com/kubernetes-release/release/$(curl-s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
$(curl-s https://storage.googleapis.com/kubernetes-release/release/stable.txt) currently obtains: v1.9.4
Chmod + x kubectl & & mv kubectl / usr/local/bin/kubectl
Installation is complete, you can check whether it is successful or not through kubectl version.
(2) install minikube
Curl-Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.0/minikube-linux-amd64
This is the way to install copy directly from github, and again, you can check whether the installation is successful or not through minikube version.
(3) configuration information (I have not specifically studied whether this is necessary)
Export MINIKUBE_WANTUPDATENOTIFICATION=false
& & export MINIKUBE_WANTREPORTERRORPROMPT=false
& & export MINIKUBE_HOME=$HOME
& & export CHANGE_MINIKUBE_NONE_USER=true
& & mkdir $HOME/.kube | | true
& & touch $HOME/.kube/config
& & export KUBECONFIG=$HOME/.kube/config
(4) due to the need to download gcr.io/google-containers/... The image under, where you need a proxy, is implemented through socks5+proxychains. I bought a foreign server in advance.
Apt-get install proxychains
Vim / etc/proxychains.conf finds the last line and modifies the address and port
Socks5 127.0.0.1 1080
Of course, my environment is because there is a special server as a local connection proxy, the port number is 1080, all requests are first to a local server, and then through a foreign server to access the Internet.
Note: docker daemon does not read the system agent by default, so you need to set it manually.
Here is divided into Ubuntu1404 version: vim / etc/default/docker add export ALL_PROXY= "socks5://127.0.0.1:1080"
Then pass / etc/init.d/docker restart
In Ubuntu1604 version: mkdir / etc/systemd/system/docker.service.d/
[Service] Environment= "ALL_PROXY=socks5://127.0.0.1:1080"
Then refresh the configuration systemctl daemon-reload
Restart the docker service systemctl restart docker
Systemctl show-- perporty=Environment docker to check whether the configuration is in effect
Proxychains is very simple to use, at present: whether the proxychains curl www.google.com test is successful or not
Support: proxychains docker pull gcr.io/google-containers/...
Proxychains apt-get update/ apt-get install-y kubelet kubeadm kubectl
Proxychains kubeadm init
Proxychains minikube start-vm-driver=virtualbox
At present, I can succeed in using it this way.
(5) need virtualbox support, here is a bit like, the virtual machine also needs to be installed in the virtual machine, (a bit confused?! It is said that cpu is required to support hardware virtualization such as VT-X, but the ubuntu/centos I am running is the system of the VMware virtual machine or the virtualbox virtual machine. And it has been running on a command line system at first.
Of course, minikube start-- vm-driver=virtualbox can be run at this time, but I have been stuck in an error.
This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory.
The official website says that virtualbox needs to be installed, so find the following steps to install:
(a) add the software source to the / etc/apt/source.list file first
Deb http://download.virtualbox.org/virtualbox/debian $(lsb_release-cs) contrib
(B) add the software source key of virtualbox5.2. Of course, this is my version, as in other versions.
Wget-Q https://www.virtualbox.org/download/oracle_vbox.asc-O-| sudo apt-key add-
(C) apt-get update & & apt-get install virtualbox-5.2
After the installation is successful, try proxychains minikube start-vm-driver=virtualbox again
Still reported the wrong report. It is said on the Internet that you need to enter the Inter virtual.. set up from F2 to bios when the system starts. The menu was changed to enabled, but I found that it was not in my VMware, so I took the time to install virtualbox software and add ubuntu system, but I still couldn't find a similar bios setting. Doesn't my computer's cpu support it?
Just as I was about to give up, when I opened a Ubuntu1404 desktop system in VMware, I thought of giving it a try, and sure enough, it was in the settings of the virtual machine: the preferred mode of the virtualization engine is still automatic but the following option is enabled: virtual machine Intel VT-x/EPT or AMD-V/RVI (V).
Finally, the Kubernetes cluster is started through proxychains minikube start-- vm-driver=virtualbox.
(6) Test and study according to the official website through minikube command.
Of course (5) it takes a long time to start. Because you probably know that you need to download a lot of images under gcr.io.
Here, on the command line of Ubuntu14, run virtualbox, and you can call up the interface directly. You can see the following figure
It turns out that the minikube start command automatically generates a virtual machine for vb, and the entire kubernetes-related components, docker images are generated in this Linux system called minikube, so it is so slow.
Therefore, you begin to manipulate cluster from the command line.
Kubectl get nodes gets the node node. There is only one single node.
Kubectl get pod-o wide-- all-namespaces view all running containers
Kubectl describe podName-n kube-system views the details of the execution process called podName in the kube-system space, which can be used to locate the problem.
Minikube status View local kubernetes cluster status
Minikube ip check ip for example: the ip here is 192.168.99.100
Minikube dashboard-- url check dashboard url for example: get http://192.168.99.100: 31512 here
Minikube ssh logs in to virtualbox's system and can view the image of gcr.io downloaded by docker images, as well as docker ps
Minikube get-k8s-versions gets the list of kubernetes versions
Minikube start-kubernetes-version v1.7.3 starts the cluster with a version of kubernetes
Eval $(minikube docker-env) through this command, you can run docker directly in the virtual machine where minikube is located to view the image and the running container, so that you do not need minikube ssh to view docker information.
Minikube service serviceName-url can view the access url of service
Note: when starting up, you need to add proxychains minikube start-- vm-driver=virtualbox so that you can download the image in gcr.io.
The following figure, test command, and dashboard page:
According to minikube dashboard-- url, the dashboard address is: http://192.168.99.100:30000.
On how to install minikube,kubectl and the implementation of Kubernetes cluster deployment is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.