In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to install Kubernetes () minikube. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
KubernetesKubernetes is an open source Docker container orchestration system, Kubernetes referred to as K8S. Scheduling computing cluster nodes, dynamically managing the above jobs by using the concepts of [labels] and [pods], grouping applications by logical units K8S for deployment of container applications, extending and managing K8S provides a series of functions such as container orchestration, resource scheduling, self-scaling, deployment management, service discovery and so on. Kubernetes goal is to make deployment containerized and easy and efficient official website: characteristics of http://www.kubernetes.ioKubernetes
Self-healing:
Restart failed containers in case of node failure, replace and redeploy to ensure the predicted number of copies; kill containers that fail health checks, and do not process client requests until they are ready to ensure that online services are not interrupted.
Elastic expansion:
Use command, UI or automatic rapid expansion and reduction of application instances based on CPU usage to ensure high availability at peak concurrency of application business; recover resources at low peak time and run services at minimum cost
Automatic deployment and rollback:
K8S uses rolling update applications to update one Pod at a time instead of deleting all Pod at the same time. If there are problems in the update process, the changes will be rolled back to ensure that the upgrade will not affect the business.
Service discovery and load balancing:
K8S provides a unified access entry for multiple containers (internal IP address and UI DNS address), and all containers associated with load balancer, so that users do not have to consider the container IP problem.
Confidentiality and configuration management:
Manage confidential data and application configuration. There is no need to expose sensitive data in the mirror to improve the security of sensitive data. And some commonly used configurations can be stored in K8S to facilitate the use of applications.
Storage choreography:
Mounting external storage systems, whether from local storage, public clouds (such as AWS), or network storage (NFS, GlusterFS) are used as part of cluster resources, greatly improving storage flexibility
Batch processing:
Provide one-time tasks, scheduled tasks; meet the scenarios of batch data processing and analysis.
Architecture and components of Kubernetes Cluster
Master component
Kube-apiserver:
Kubernetes API, the unified entrance to the cluster and the coordinator of each component, provides interface services through RESTful API. All object resource additions, deletions, modifications, and monitoring operations are handed over to APIServer and then submitted to Etcd for storage.
Kube-controller-manager:
Handle the regular background tasks in the cluster, each resource corresponds to a controller, and ControllerManager is responsible for managing these controllers.
Kube-scheduler:
Select a Node node for the newly created Pod according to the scheduling algorithm, which can be deployed arbitrarily, on the same node or on different nodes
Etcd:
Distributed key storage system, which is used to store cluster state data, such as Pod, Server and other object information.
Node component
Kubelet:
Kubelet is the Agent of MAster on the Node node, which manages the lifecycle of native running containers, such as creating containers, mounting data volumes on Pod, downloading secret, getting container and node status, and so on. Kubelet converts Pod into a set of containers.
Kube-proxy:
Implement Pod network agent on Noed node, maintain network planning and layer 4 complex = load balancing
Docker or rocket:
Container engine, running container
Core concepts of Kubernetes
Pod:
Minimum deployment unit
A collection of containers
A container shared network namespace in Pod
Pod is short-lived
Controllers:
ReplicaSet: ensure the expected number of Pod copies
Deployment: stateless application deployment
StatefulSet: stateful application deployment
DaemonSet: make sure all Node are running the same Pod
Job: one-time task
Cronjob: scheduled task
Higher-level objects, deploying and managing Pod
Service:
Prevent Pod from losing contact
Define a set of access policies for Pod
Label: tag, attached to a resource, used to associate objects. Query and filter
Namespaces: namespace to logically isolate objects
Annotations: comment
Flannel Container Cluster Network deployment
Minikube
Minikube is a tool that allows you to quickly run a single point of kubernetes locally, only for users trying K8s or daily development
Experimental environment master 192.168.13.131 install etcd kubernetes flannelnode 192.168.13.132 install flannel kubernetes I configure etcd [root@promote ~] # yum install etcd kubernetes flannel-y # # installation component [root@promote ~] # vim / etc/etcd/etcd.conf # # configure etcd configuration file 3 ETCD_DATA_DIR= "/ var/lib/etcd/default.etcd" # data directory 6 ETCD_LISTEN_CLIENT _ URLS= "http://0.0.0.0:2379" # # snooping on any network and port 9 ETCD_NAME=" default "# # default name 21 ETCD_ADVERTISE_CLIENT_URLS=" http://localhost:2379" # # Cluster access address paragraph 2 Configure apiserver [root@promote ~] # vim / etc/kubernetes/apiserver # # configure apiserver profile 8 KUBE_API_ADDRESS= "--address=0.0.0.0" # # modify api address 11 KUBE_API_PORT= "--port=8080" # # api listener port number 14 KUBELET_PORT= "- kubelet-port=10250" # # Kubelet port number 17 KUBE_ETCD_SERVERS= "--etcd-servers= http://127.0.0.1:2379" # # etcd service address 20 KUBE_SERVICE_ADDRESSES= "- service-cluster-ip-range=10.254.0.0/16" # # Service address pool 23 KUBE_ADMISSION_CONTROL= "- admission-control=NamespaceLifecycle NamespaceExis ts,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota "# # Controller Mode 26 KUBE_API_ARGS="# # api Parameter 3" Configure flannel network on master [root@promote ~] # vim / etc/sysconfig/flanneld FLANNEL_ETCD_ENDPOINTS= "http://192.168.13.131:2379" # # modify etcd address to local address FLANNEL_ETCD_PREFIX=" / atomic.io/network "# # Network specification file 4, start all services [root@promote ~] # for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler on master Do systemctl restart $SERVICES; systemctl enable $SERVICES; systemctl status $SERVICES Done## starts four etcd kube-apiserver kube-controller-manager kube-scheduler services, sets boot and check status 5, and sets etcd network [root@promote ~] # etcdctl-C / / 192.168.13.131master 2379 set / atomic.io/network/config'{"Network": "10.1.0.0Compact 16"}'[root@promote ~] # systemctl stop firewalld.service # # close the firewall [root@promote ~] # setenforce 0 6 Configure the kubernetes configuration file [root@promote ~] # yum install flannel kubernetes-y [root@promote ~] # vim / etc/kubernetes/config 13 KUBE_LOGTOSTDERR= "--logtostderr=true" # # error log 16 KUBE_LOG_LEVEL= "- vSecret0" # # level 19 KUBE_ALLOW_PRIV= "--allow-privileged=false" # # permission 22 KUBE_MASTER= "--master= http://192.168.13.131:8080" # # specify the master address 23 in the master server configuration file [root@promote ~] # yum install flannel kubernetes-y [master ~] KUBE_ETCD_SERVERS= "--etcd_server= http://192.168.13.131:2379" # # specify etcd address 7 In the node configuration kubelet configuration file [root@promote ~] # vim / etc/kubernetes/kubeletKUBELET_ADDRESS= "--address=0.0.0.0" # # all addresses KUBELET_PORT= "- port=10250" # # Port number KUBELET_HOSTNAME= "- hostname-override=192.168.13.132" # # Local Host address KUBELET_API_SERVER= "- api-servers= http://192.168.13.131:8080" # # apiserver address KUBELET_POD_INFRA_CONTAINER= "--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest" # # pod container KUBELET_ARGS= "" # # Parameter 8 In the node configuration flannel network configuration file [root@promote ~] # vim / etc/sysconfig/flanneld FLANNEL_ETCD_ENDPOINTS= "http://192.168.13.131:2379" # # specify the etcd service address 9, enable all services in node [root@promote ~] # systemctl stop firewalld.service # # close the firewall [root@promote ~] # setenforce 0 [root@promote ~] # for SERVICES in flanneld kube-proxy kubelet docker Do systemctl restart $SERVICES; systemctl enable $SERVICES; systemctl status $SERVICES; done## enable flanneld kube-proxy kubelet docker service 10, check the node node [root@promote ~] # kubectl get nodesNAME STATUS AGE192.168.13.132 Ready 1m on the master server and share here on how to install Kubernetes () minikube. I hope the above content can help you and learn more. 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.