In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install and deploy docker kubernetes dashboard. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Environment description:
1)。 Architecture:
Note: the server environment of this experiment adopts centos 7. All services are installed using yum install.
192.168.3.7 master
192.168.3.16 node
2)。 Software packages used:
Master: docker kubernetes-master etcd flannel
Nodes: docker kubernetes-node flannel
3)。 Software version:
Docker: 1.10.3
Kubernetes*: 1.2.0
Etcd: 2.3.7
4)。 Package description:
Docker: protagonist, needless to say
Kubernetes-master: kubernetes server
Kubernetes-node: kubernetes client
Etcd: storage of key values discovered by the server
Flannel: enables network interconnection between docker containers on multiple servers
two。 Environment initialization:
You've done docker, so I won't teach you what to do in initialization.
Back up the existing yum source file, make an Ali cloud yum source, epel source.
Address: http://mirrors.aliyun.com
3. Install and configure docker:
Note: docker adopts net mode. Make sure the device-mapper package is installed, otherwise docker cannot be started.
1)。 Install # yum install docker-Y2). Configure # cat / etc/sysconfig/docker | egrep-v "^ # | ^ $" OPTIONS=''DOCKER_CERT_PATH=/etc/docker
4. Configure master
1)。 Install the package. # yum install kubernetes-master etcd flannel-y2). Configure etcd.# cat / etc/etcd/etcd.conf | egrep-v "^ # | ^ $" ETCD_NAME=defaultETCD_DATA_DIR= "/ var/lib/etcd/default.etcd" ETCD_LISTEN_CLIENT_URLS= "http://0.0.0.0:2379" # # listen address port ETCD_ADVERTISE_CLIENT_URLS=" http://192.168.3.7:2379" # # etcd cluster configuration; multiple etcd servers, add url directly after it
# # starting etcd Service
# systemctl start etcd
3)。 Configure kubernetes.
There are several files in the / etc/kubernetes directory:
Apiserver: kubernetes api profile
Config: kubernetes main configuration file
Controller-manager: kubernetes cluster management profile
Scheduler: kubernetes scheduler profile
# cd / etc/kubernetesKUBE_API_ADDRESS= "--insecure-bind-address=0.0.0.0" # # address bound when kube starts "--etcd-servers= http://192.168.3.7:2379" # # kube calls urlKUBE_SERVICE_ADDRESSES= of etcd"-- service-cluster-ip-range=172.17.0.0/16 "# this address is the address field KUBE_ADMISSION_CONTROL= of docker container"-- admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny ResourceQuota "KUBE_API_ARGS=" pay attention to the configuration of the KUBE_ADMISSION_CONTROL line: remove the ServiceAccount item, or no authentication error will be reported later. # cat config | egrep-v "^ # | ^ $" KUBE_LOGTOSTDERR= "- logtostderr=true" KUBE_LOG_LEVEL= "--vault 0" KUBE_ALLOW_PRIV= "--allow-privileged=false" KUBE_MASTER= "--master= http://192.168.3.7:8080" # # kube master api url
The two files of controller-manager scheduler can be configured by default.
5. Configure nodes
1)。 Install the software package.
# yum install kubernetes-node flannel-y
2)。 Configure kubernetes node
After the package is installed, the following files appear in the / etc/kubernetes directory:
Config: kubernetes main configuration file
Kubelet: kubelet node profile
Proxy: kubernetes proxy profile
# cd / etc/kubernetes# cat config | egrep-v "^ # | ^ $" KUBE_LOGTOSTDERR= "- logtostderr=true" KUBE_LOG_LEVEL= "--vici0" KUBE_ALLOW_PRIV= "- allow-privileged=false" KUBE_MASTER= "--master= http://192.168.3.7:8080" # # kube master api url# cat kubelet | egrep-v" ^ # | ^ $"KUBELET_ADDRESS="-address=0.0.0.0 "# # kubelet bound address KUBELET_PORT="-- port=10250 "after startup # # kubelet Port KUBELET_HOSTNAME= "- hostname-override=192.168.3.16" # # hostname of kubelet Execute the name KUBELET_API_SERVER= "--api-servers= http://192.168.3.7:8080" # # kube master api urlKUBELET_POD_INFRA_CONTAINER="-- pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest "KUBELET_ARGS=" displayed by kubectl get nodes in master
Proxy configuration can be done by default.
6. Network configuration:
Both master and node have installed flannel
Master configuration:
# cat / etc/sysconfig/flanneld | egrep-v "^ # | ^ $" FLANNEL_ETCD= "http://192.168.3.7:2379"FLANNEL_ETCD_KEY="/kube/network"# etcdctl mk / kube/network/config'{" Network ":" 172.17.0.0 kube/network/config 16 "}'# Note that the ip here is the same as the ip address shown above.
Node configuration:
# cat / etc/sysconfig/flanneld | egrep-v "^ # | ^ $" FLANNEL_ETCD= "http://192.168.3.7:2379"FLANNEL_ETCD_KEY="/kube/network"
7. Start the service.
1)。 Start the docker service.
# systemctl start docker
# ps aux | grep docker # # confirm whether the service starts normally. If it doesn't start, please move to / var/log/message to see the problem.
2)。 Start the etcd service
# systemctl start etcd
3)。 Start the flanneld service on master and node
# systemctl start flanneld
If you check ip, the network interface device of flannel0 will appear. The address is the same as the docker0 address. If it is inconsistent, please confirm whether the above services are started normally.
4)。 Start the K8s service running on master.
Startup sequence: kube-apiserver ranks first.
# systemctl start kube-apiserver
# systemctl start kube-controller-manager
# systemctl start kube-scheduler
Please make sure that all the above services are started normally.
5)。 Start the K8s service running on node.
# systemctl start kube-proxy
# systemctl start kubelet
Please make sure that all the above services are started normally.
6)。 Visit http://kube-apiserver:port
Http://192.168.3.7:8080 view all request url
Http://192.168.3.7:8080/healthz/ping to check health status
8. Enable k8s dashboard:
1)。 Verify the service on master. # kubectl get nodes # # get the K8s client. Name STATUS AGE192.168.3.16 Ready 6h# kubectl get namespace # # get all the namespaces NAME STATUS AGEdefault Active 17h2 of K8s. Create a new namespace# cd / usr/local/src/docker# cat kube-namespace.yaml of kube-system {"kind": "Namespace", "apiVersion": "v1", "metadata": {"name": "kube-system"} # kubectl create-f kube-namespace.yamlnamespace "kube-system" created# kubectl get namespace# # on master to get all namespaces NAME STATUS AGEdefault Active 17hkube-system Active 17h of K8s
3)。 Create a new kube-dashboard.yaml on master
Wget http://docs.minunix.com/docker/kubernetes-dashboard.yaml-O / usr/local/src/docker/kube-dashboard.yaml
Please modify the apiserver-host in the file to your own kebu-apiserver
Create a pod:
# kubectl create-f kube-dashboard.yaml
Deployment "kubernetes-dashboard" created
You have exposed your service on an external port on all nodes in your
Cluster. If you want to expose this service to the external internet, you may
Need to set up firewall rules for the service port (s) (tcp:31576) to serve traffic.
See http://releases.k8s.io/release-1.2/docs/user-guide/services-firewalls.md for more details.
Service "kubernetes-dashboard" created
Verify:
# kubectl get pods-namespace=kube-system
NAME READY STATUS RESTARTS AGE
Kubernetes-dashboard-3138400848-grtfm 1/1 ContainerCreating 0 27s
View the detailed process of the container:
# kubectl describe pods kubernetes-dashboard-3138400848-grtfm-namespace=kube-system
When there are multiple node, you can use this command to see which node the container is assigned to, the ip address assigned after startup, and so on.
If you see "State: Running" in the result, go to node to see the container running status, which should also be the status of up.
4)。 Can be accessed through http://kube-apiserver:port/ui at this time
Http://192.168.3.7:8080/ui
Start using docker to your heart's content!
9. Pay attention to the problems encountered:
1)。 Pay attention to the startup sequence of the service, especially master, and start apiserver first while ensuring that etcd starts.
2)。 Note the format indentation of yaml files.
3)。 If you find that the status of the newly created pod is depening, there may be several reasons: first, the client is configured with the service of listen 127.0.0.1, and master cannot establish a connection with it; second, the environment initialization is not done well; third, move to node and use docker logs to view logs
4)。 The containers images address in the kubernetes-dashboard.yaml file is currently public and will be closed on September 30.
5)。 If you have a foreign vps, you can create a docker registry; on the server, first create the k8s dashboard of google under pull, then push to your own registry, and modify the image in yaml.
Thank you for reading! This is the end of this article on "how to install and deploy docker kubernetes dashboard". I hope the above content can be of some help to you, so that 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
After downloading and installing the GHOST software
© 2024 shulou.com SLNews company. All rights reserved.