CN113342457A - Kubernetes scheduling method based on registration and discovery of Eureka service - Google Patents

Kubernetes scheduling method based on registration and discovery of Eureka service Download PDF

Info

Publication number
CN113342457A
CN113342457A CN202010137141.3A CN202010137141A CN113342457A CN 113342457 A CN113342457 A CN 113342457A CN 202010137141 A CN202010137141 A CN 202010137141A CN 113342457 A CN113342457 A CN 113342457A
Authority
CN
China
Prior art keywords
service
eureka
pod
mirror image
domain name
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010137141.3A
Other languages
Chinese (zh)
Inventor
张家旺
李小飞
张建学
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Star Map Co ltd
Original Assignee
Zhongke Star Map Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Star Map Co ltd filed Critical Zhongke Star Map Co ltd
Priority to CN202010137141.3A priority Critical patent/CN113342457A/en
Publication of CN113342457A publication Critical patent/CN113342457A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

Embodiments of the present disclosure provide kubernets scheduling methods, apparatuses, and computer-readable storage media for Eureka service registration and discovery. The method comprises the following steps: calling a mirror image of the service constructed based on the Eureka from a mirror image warehouse; deploying the mirror image of the service to Pod of the Kubernets cluster node; configuring, by a gateway management service, a domain name for the service; and loading the access request to the domain name into the corresponding Pod. In this way, the functions of pluggable (pluggable), Portable (Portable) Service (Program), Data (Data), and Service dependency (Service) can be realized.

Description

Kubernetes scheduling method based on registration and discovery of Eureka service
Technical Field
Embodiments of the present disclosure relate generally to the field of data processing, and more particularly, to a Kubernetes scheduling method based on Eureka service registration and discovery.
Background
Eureka is a service discovery framework developed by Netflix, which is itself a REST-based service. The Eureka comprises two components of the Eureka Server and the Eureka Client, the Eureka Server provides service registration service, the Eureka Client can register information to the Eureka Server, and then the information such as node position information and state of the registered service instance can be acquired by the Eureka Server among the Eureka clients.
Spring cloud is a commonly used micro-service architecture in the prior art. I.e., an ordered set of a series of frames. The development convenience of the Spring Boot is utilized to skillfully simplify the development of infrastructure of a distributed system, such as service discovery registration, configuration center, message bus, load balancing, breaker and data monitoring, and the like, and the Spring Boot can be used for one-key starting and deployment in a development style. .
Docker is an open source application container engine, so that developers can pack their applications and dependency packages into a portable image, and then distribute the image to any popular Linux or Windows machine, and also realize virtualization. Many existing services run on various servers in a Docker image mode, and rely on kubernets to program the service images.
Kubernets, an open source application for managing containerization on multiple hosts in a cloud platform. Kubernets, which aims to make it simple and efficient to deploy containerized applications (powerfull), provides a mechanism for application deployment, planning, updating, and maintenance.
Currently, with the increase of system complexity and the increasing requirement on system scalability, the traditional development architecture obviously cannot meet the development requirement. Therefore, it has become a necessary trend for developers to choose micro service architecture (SpringCloud) for application development.
However, in the actual operation process of the developer to develop the application by using the micro service architecture, the technical personnel find the following defects:
spring cloud-Eureka service registers and discovers scheduling difficulties. That is, the services developed and deployed by using the SpringCloud framework are generally tightly coupled, the service developer defines the storage resources used by the service and the service resources that the service depends on through various ways, and the deployment process needs to know the definition and organization structure of the developer on the storage resources and the service resources. The deployment process is difficult, it is difficult to achieve multiple rapid deployments of services (due to the complexity of the service deployment process), and to achieve multiple uses of one deployment in the true sense. The deployment and maintenance process of the service also has very high requirements on implementation and maintenance personnel, and is not beneficial to service operation.
Disclosure of Invention
According to an embodiment of the present disclosure, a Kubernetes scheduling scheme based on Eureka service registration and discovery is provided.
In a first aspect of the disclosure, a Kubernetes scheduling method based on Eureka service registration and discovery is provided. The method comprises the following steps:
calling a mirror image of the service constructed based on the Eureka from a mirror image warehouse;
deploying the mirror image of the service to Pod of the Kubernets cluster node;
configuring, by a gateway management service, a domain name for the service;
and loading the access request to the domain name into the corresponding Pod.
Further, the mirror image warehouse is a Harbor private mirror image warehouse.
Further, the mirroring of the service comprises:
docker images of the master and worker services.
Further, when constructing a service based on Eureka, service registration is performed using an IP address.
Further, the deploying the mirror image of the service to the Pod of the node in the Kubernets cluster includes:
and deploying the mirror image of the service to the Pod in the Kubernets cluster by adopting a Headless deployment mode.
Further, the configuring, by the gateway management service, the domain name of the service includes:
the apicVersion of a Kubernetes deployment file in the gateway management service configuration selects ambassador/v1, and the resource type selects Mapping.
Further, the loading the access request for the domain name into the corresponding Pod includes:
and loading the access request for the domain name into the corresponding Pod in a load balancing mode.
Further, the load balancing mode comprises a polling access mode.
In a second aspect of the disclosure, an electronic device is provided. The electronic device includes: a memory having a computer program stored thereon and a processor implementing the method as described above when executing the program.
In a third aspect of the present disclosure, a computer readable storage medium is provided, having stored thereon a computer program, which when executed by a processor, implements a method as in accordance with the first aspect of the present disclosure.
According to the Kubernetes scheduling method based on registration and discovery of the Eureka service, provided by the embodiment of the application, a mirror image of the service constructed based on the Eureka is called from a mirror image warehouse; deploying the mirror image of the service to Pod of the Kubernets cluster node; configuring, by a gateway management service, a domain name for the service; and loading the access request to the domain name into the corresponding Pod, thereby realizing the functions of pluggable (pluggable), Portable (Portable) Service (Program), Data (Data) and Service dependence (Service).
It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements, and wherein:
FIG. 1 is a flow diagram of one embodiment of a Kubernetes scheduling method based on Eureka service registration and discovery according to the present application;
FIG. 2 is a schematic diagram of registration of service images with each other in a Kubernetes scheduling method based on registration and discovery of Eureka services according to the present application;
fig. 3 is a schematic structural diagram of a computer system used for implementing the terminal device or the server according to the embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Noun resolution:
Pod-Kubernetes' basic unit. It may consist of one or more containers that are within the same physical host and share the same resources. All containers deployed within a Pod can see other containers through localhost. Each Pod has a unique IP address in the cluster.
Service-a group of Pods working together. By default, Service is disclosed within the cluster, but may also be exposed on an external IP address outside the cluster.
It should be noted that the spring cloud framework is used in the examples of the present application.
As an embodiment of the present application, fig. 1 shows a flow 100 of a kubernets scheduling method based on Eureka service registration and discovery, comprising the following steps:
and S110, calling the mirror image of the service constructed based on the Eureka from the mirror image warehouse.
Wherein the mirroring of the service is constructed by:
and respectively creating Docker images aiming at the services required to be used. And executing a Maven command to compile the project into an executable JAR, and creating a Docker file required for constructing a Docker mirror image. That is, the Maven compiled JAR is copied inside the mirror.
And storing the Docker mirror image into a Harbor private mirror image warehouse.
Preferably, when the mirror image is constructed by the Eureka Server, the service registration is performed by using the IP address without using the Hostname (host name) which is a default registration mode of the Eureka, so that the problem that the service cannot be registered due to the change of the Hostname after the service is issued by kubernets is solved.
Preferably, the service images are registered with each other, as shown in fig. 2. If mutual registration is not performed, when a plurality of services exist, a node of one of the services goes down, which may lead to the breakdown of the whole service cluster. When the services are mutually registered, when one of the service nodes goes down, the normal service logic cannot be influenced.
In this step, the Docker image stored in the Harbor private image repository is called up by kubernets.
And S120, deploying the mirror image of the service to the Pod of the Kubernets cluster node.
An Eureka deployment file is created for deploying Eureka in Kubernetes. In this embodiment, stateful set) + header service is adopted to deploy Eureka. Namely, the mirror image of the service is deployed to the Pod of the Kubernets cluster node through a stateful set plus Headless service mode. Because the Eureka Pod names deployed by the stateful set manner are ordered, while the stateful set supports the Service header manner to create Service for accessing internal services. If the Deployment mode is the Deployment, a plurality of Deployment objects need to be deployed, which is cumbersome.
Optionally, the Service deployed in the headset manner does not allocate a virtual IP, but uses polling access to directly communicate with the IP of the Pod each time, thereby reducing performance loss caused by communication with the registry.
S130, configuring the domain name of the service through the gateway management service.
In the gateway management service configuration, the api version of the Kubernetes deployment file selects ambassador/v1, and the resource type selects Mapping. Further, required internal network and external network domain names are configured in an etcd component (K/V key value pair) in Kubernetes, and the domain names are configured and registered through the gateway management service.
The visitor can then access the service (Pod) through the domain name. Further, the visitor can access the service (Pod) through a domain name including internal access and external access.
S140, loading the access request for the domain name into the corresponding Pod.
And when receiving a domain name access request to the service (Pod), loading the access request into the corresponding Pod in a load balancing mode to finish calling the service. Preferably, the load balancing mode comprises a polling access mode.
According to the Kubernets scheduling method based on registration and discovery of the Eureka Service, firstly, services in the system are modularized through the Eureka (mirror images of the services are created through the Eureka), each Service is separated from the whole system, so that the services are mutually decoupled, then the mirror images of the services are scheduled through the Kubernets, module multiplexing is achieved, and meanwhile, the functions of pluggable (pluggable), transferable (Portable) Service (Program), Data (Data) and Service dependence (Service) are achieved.
The functions of pluggable (pluggable), Portable (Portable) Service (Program), Data (Data), and Service dependency (Service) can be implemented by using the characteristics of kubernets after the services are decoupled from each other.
An embodiment of the present application further provides an apparatus, including:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the kubernets scheduling method based on Eureka service registration and discovery described above.
In addition, the embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the kubernets scheduling method based on Eureka service registration and discovery described above.
Reference is now made to fig. 3, which illustrates a schematic block diagram of a computer system suitable for implementing a terminal device or server of an embodiment of the present application. The terminal device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 3, the computer system includes a Central Processing Unit (CPU)301 that can perform various appropriate actions and processes based on a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data necessary for system operation are also stored. The CPU 301, ROM 302, and RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. The driver 310 is also connected to the I/O interface 305 on an as needed basis. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 310 on an as-needed basis, so that a computer program read out therefrom is mounted on the storage section 308 on an as-needed basis.
In particular, based on the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 309, and/or installed from the removable medium 311. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 301.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an information measuring unit, a travel track determining unit, a mapping relation determining unit, and a driving strategy generating unit. Here, the names of these units do not constitute a limitation on the unit itself in some cases, and for example, the information measuring unit may also be described as a "unit that measures the state information of the own vehicle and the surrounding scene information".
As another aspect, the present application also provides a non-volatile computer storage medium, which may be the non-volatile computer storage medium included in the apparatus in the above-described embodiments; or it may be a non-volatile computer storage medium that exists separately and is not incorporated into the terminal. The non-transitory computer storage medium stores one or more programs that, when executed by a device, cause the device to: calling a mirror image of the service constructed based on the Eureka from a mirror image warehouse; deploying the mirror image of the service to Pod of the Kubernets cluster node; configuring, by a gateway management service, a domain name for the service; and loading the access request to the domain name into the corresponding Pod.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. A Kubernetes scheduling method based on registration and discovery of an Eureka service is characterized by comprising the following steps:
calling a mirror image of the service constructed based on the Eureka from a mirror image warehouse;
deploying the mirror image of the service to Pod of the Kubernets cluster node;
configuring, by a gateway management service, a domain name for the service;
and loading the access request to the domain name into the corresponding Pod.
2. The method of claim 1, wherein the mirror repository is a Harbor private mirror repository.
3. The method of claim 2, wherein the mirroring of the service comprises:
docker images of the master and worker services.
4. The method of claim 3, wherein the service registration is performed using an IP address when the service is constructed based on the Eureka.
5. The method of claim 4, wherein deploying the image of the service into a Pod of a node in a Kubernets cluster comprises:
and deploying the mirror image of the service to the Pod in the Kubernets cluster by adopting a Headless deployment mode.
6. The method of claim 5, wherein configuring, by a gateway management service, the domain name for the service comprises:
the apicVersion of a Kubernetes deployment file in the gateway management service configuration selects ambassador/v1, and the resource type selects Mapping.
7. The method of claim 6, wherein loading the access request for the domain name into the corresponding Pod comprises:
and loading the access request for the domain name into the corresponding Pod in a load balancing mode.
8. The method of claim 7, wherein the load balancing comprises a round-robin access.
9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the processor, when executing the program, implements the method of any of claims 1-8.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 8.
CN202010137141.3A 2020-03-02 2020-03-02 Kubernetes scheduling method based on registration and discovery of Eureka service Pending CN113342457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010137141.3A CN113342457A (en) 2020-03-02 2020-03-02 Kubernetes scheduling method based on registration and discovery of Eureka service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010137141.3A CN113342457A (en) 2020-03-02 2020-03-02 Kubernetes scheduling method based on registration and discovery of Eureka service

Publications (1)

Publication Number Publication Date
CN113342457A true CN113342457A (en) 2021-09-03

Family

ID=77467243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010137141.3A Pending CN113342457A (en) 2020-03-02 2020-03-02 Kubernetes scheduling method based on registration and discovery of Eureka service

Country Status (1)

Country Link
CN (1) CN113342457A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745378A (en) * 2022-02-14 2022-07-12 优刻得科技股份有限公司 Function module distribution method and system based on edge cloud scene
CN114756261A (en) * 2022-03-23 2022-07-15 广域铭岛数字科技有限公司 Container cluster upgrading method and system, electronic equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745378A (en) * 2022-02-14 2022-07-12 优刻得科技股份有限公司 Function module distribution method and system based on edge cloud scene
CN114745378B (en) * 2022-02-14 2024-05-28 优刻得科技股份有限公司 Function module distribution method and system based on edge cloud scene
CN114756261A (en) * 2022-03-23 2022-07-15 广域铭岛数字科技有限公司 Container cluster upgrading method and system, electronic equipment and medium
CN114756261B (en) * 2022-03-23 2023-04-18 广域铭岛数字科技有限公司 Container cluster upgrading method and system, electronic equipment and medium

Similar Documents

Publication Publication Date Title
JP7203444B2 (en) Selectively provide mutual transport layer security using alternate server names
US11683220B2 (en) In-memory workflow management in edge devices
US10320674B2 (en) Independent network interfaces for virtual network environments
CN107615716B (en) Multi-tenant aware Dynamic Host Configuration Protocol (DHCP) mechanism for cloud networking
US9910687B2 (en) Data flow affinity for heterogenous virtual machines
US11095716B2 (en) Data replication for a virtual networking system
CN107210924B (en) Method and apparatus for configuring a communication system
CN113342457A (en) Kubernetes scheduling method based on registration and discovery of Eureka service
US10931581B2 (en) MAC learning in a multiple virtual switch environment
US10652283B1 (en) Deriving system architecture from security group relationships
US20190334862A1 (en) Seamless Network Characteristics For Hardware Isolated Virtualized Environments
US20150381491A1 (en) Packet encapsulation with redirected dma for software defined networks
US11381665B2 (en) Tracking client sessions in publish and subscribe systems using a shared repository
CN108111513B (en) Data management method, device, medium and electronic equipment applied to front-end device
US11792289B2 (en) Live socket redirection
CN114979144A (en) Cloud edge communication method and device and electronic equipment
CN115378993B (en) Method and system for supporting namespace-aware service registration and discovery
US20240111602A1 (en) Virtual edge devices
US20180287868A1 (en) Control method and control device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination