CN114461147B - Method and system for providing kubernetes clusters with different storage types - Google Patents
Method and system for providing kubernetes clusters with different storage types Download PDFInfo
- Publication number
- CN114461147B CN114461147B CN202210103966.2A CN202210103966A CN114461147B CN 114461147 B CN114461147 B CN 114461147B CN 202210103966 A CN202210103966 A CN 202210103966A CN 114461147 B CN114461147 B CN 114461147B
- Authority
- CN
- China
- Prior art keywords
- storage
- software
- service
- container
- client
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 239000011232 storage material Substances 0.000 claims description 27
- 238000007726 management method Methods 0.000 claims description 22
- 238000013500 data storage Methods 0.000 claims description 5
- 239000000306 component Substances 0.000 description 48
- 230000006870 function Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 241000380131 Ammophila arenaria Species 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000008358 core component Substances 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
- G06F3/0607—Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
- G06F3/0631—Configuration or reconfiguration of storage systems by allocating resources to storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45579—I/O management, e.g. providing access to device drivers or storage
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention provides a method and a system for providing different storage types for kubernetes clusters, wherein the method comprises the following steps: the storage operator component unit deployed in the kubernetes clusters automatically starts the service ends respectively possessed by each storage software deployed in the kubernetes clusters; setting a storage type for each storage software respectively; setting corresponding appointed storage spaces in each storage software respectively; for each service in kubernetes clusters, when a service container is created, the service container is connected with a service end of storage software with the same storage type in a preset mode. kubernete cluster administrators can provide multiple storage types, sharing stored traffic to different storage systems. The requirements of different services for different storage software are met.
Description
Technical Field
The invention relates to the field of storage, in particular to a method and a system for providing kubernetes clusters with different storage types.
Background
In the process of service migration of containers, kubernetes orchestration tools are required to deploy container services, and when the same service uses a plurality of containers, the containers in some cases need consistency of data to ensure that the services can provide unified data.
In the current technical environment, there are many types of storage software that can be provided, such as using kubernetes to deploy ceph storage software, deploying nfs storage software, deploying gfs storage software, deploying minio storage software, where in the case that multiple storage software exist at the same time, maintenance personnel of a container are required to select one of the storage software to provide storage (deployment service), but different services may need different storage software, and kubernetes cluster management personnel are required to configure the container in the kuberentes cluster respectively to support using different types of storage software.
In carrying out the present invention, the applicant has found that at least the following problems exist in the prior art: 1, the container manager needs to care what the storage software is to select the corresponding software to configure to use the corresponding storage.
2, Kuuberantes cluster manager needs to deploy various storage software in kubernetes clusters.
Disclosure of Invention
The embodiment of the invention provides a method and a system for providing different storage types for kubernetes clusters, kubernete cluster administrators can provide multiple storage types and share stored services to different storage systems. The requirements of different services for different storage software are met.
To achieve the above object, in one aspect, an embodiment of the present invention provides a method for providing kubernetes clusters with different storage types, including:
The storage operator component unit deployed in the kubernetes cluster automatically starts the service ends respectively possessed by the storage software deployed in the kubernetes cluster, and initializes the storage software; setting a storage type for each storage software respectively;
the storage operator component unit sets corresponding designated storage spaces in each piece of storage software respectively;
for each service in kubernetes clusters, connecting a service container with a service end of storage software with the same storage type in a preset mode when the service container is created; the server side of the storage software is used for receiving the data transmitted by the service container connected with the server side and writing the received data into the appointed storage space of the storage software, and/or is used for acquiring the data to be read from the appointed storage space of the storage software where the server side is located and transmitting the data to the service container connected with the server side.
In another aspect, an embodiment of the present invention provides a system for providing different storage types for kubernetes clusters, including:
The storage operator component unit is deployed in the kubernetes clusters and is used for automatically starting the service ends respectively possessed by the storage software deployed in the kubernetes clusters and initializing the storage software; setting a storage type for each storage software respectively; and
Setting corresponding appointed storage spaces in each storage software respectively;
The connection unit is used for connecting the service container with a server side of storage software with the same storage type in a preset mode when the service container is created for each service in the kubernetes clusters; the server side of the storage software is used for receiving the data transmitted by the service container connected with the server side and writing the received data into the appointed storage space of the storage software, and/or is used for acquiring the data to be read from the appointed storage space of the storage software where the server side is located and transmitting the data to the service container connected with the server side.
The technical scheme has the following beneficial effects: kubernete cluster administrators can provide multiple storage types, sharing stored traffic to different storage systems. The requirements of different services for different storage software are met.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of providing kubernetes clusters with different storage types in accordance with an embodiment of the present invention;
FIG. 2 is a block diagram of a method for providing kubernetes clusters with different storage types in accordance with an embodiment of the present invention;
FIG. 3 is a block diagram of another method for providing kubernetes clusters with different storage types in accordance with an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown, the embodiment of the present invention is summarized, a method for providing kubernetes clusters with different storage types is provided, including:
s101: the storage operator component unit deployed in the kubernetes cluster automatically starts the service ends respectively possessed by the storage software deployed in the kubernetes cluster, and initializes the storage software; setting a storage type for each storage software respectively;
s102: the storage operator component unit sets corresponding designated storage spaces in each piece of storage software respectively;
S103: for each service in kubernetes clusters, connecting a service container with a service end of storage software with the same storage type in a preset mode when the service container is created; the server side of the storage software is used for receiving the data transmitted by the service container connected with the server side and writing the received data into the appointed storage space of the storage software, and/or is used for acquiring the data to be read from the appointed storage space of the storage software where the server side is located and transmitting the data to the service container connected with the server side.
Preferably, in step 101, the setting storage types for each storage software includes:
S1011: the storage operator component unit creates a plurality of preset storage classes, and respectively defines the connection method of each storage class and storage software to be connected and deployed in kubernetes clusters; the connection method comprises the following steps: the address of the server of the storage software to be connected, the user name of the server of the storage software to be connected, and the password of the server of the storage software to be connected; and
S1012: for each piece of storage software deployed in the kubernetes cluster, respectively connecting each piece of storage software with each storage class to be connected according to the connection method so as to determine the storage type of each piece of storage software;
step 102 specifically includes:
S1021: the storage operator component unit respectively divides storage spaces with preset capacity from each storage software to serve as pvc resources, the pvc resources are served as designated storage spaces, and the storage types of the pvc resources are the storage types of the storage software where the pvc resources are located.
Preferably, before the service container is connected to the server side of the storage software with the same storage type in a preset manner for each service in the kubernetes clusters when the service container is created, the method includes:
S104: the kubectl component module sets a configuration of creating a business container, the configuration of creating a business container comprising: designating pvc resources of the same type as the service data storage type of the service container, and setting the identifier of the designated pvc resources at the volume field of the service container; according to the position of the appointed pvc resource in the storage software, declaring the storage or acquisition path of the data of the service container at the volume section hanging field; requiring that the volume field name used by the business container be named when the business container is created;
S105: the kubectl component module submits a request to create a business container to the management tool kubenetes while sending the configuration to create a business container to the management tool kubenetes;
S106: the management tool kubenetes analyzes the identifier of the appointed pvc resource from the configuration of the established service container, divides a plurality of pv storage sections from the appointed pvc resource according to the identifier of the appointed pvc resource, and takes the pv storage sections as the minimum storage unit of service data in the kubernets cluster;
s107: setting pv information for each pv storage segment in a specified pvc resource, the pv information including: the storage type of the storage software where the pv storage section is located and the identification of a container used for the service to be installed in the pv storage section;
s108: the management tool kubenetes sends the configured pv information to the client kubelet, and issues a command for mounting the pv storage section to the service container according to the pv information to the client kubelet; wherein the client kubelet is located within a kubenetes cluster.
Preferably, in step 103, for each service in the kubernetes clusters, when creating a service container, the service container is connected with a server side of storage software having the same storage type in a preset manner, which specifically includes:
S1031: the client kubelet, according to the received pv information, for each pv storage section of the storage type, the client kubelet connects itself to the server of the storage software where the pv storage section is located, and the client kubelet mounts the pv storage section to the service container in the pv information.
Preferably, the method further comprises:
S109: each node of kuberentes clusters is deployed with a storage agent component module, and a plurality of storage clients are installed in the storage agent component module; each storage client corresponds to one storage type; wherein each node comprises a plurality of containers;
step 1031 specifically includes:
The client kubelet sends the information of itself connected with the server of the storage software where the pv storage section is located and the information of the service container of the pv storage section mounted in the pv information to the storage agent component module through the storage volume plugin plug-in unit;
and the storage agent component module connects the storage client with the storage software server with the pv storage section according to the information that the client kubelet is connected with the storage software server with the pv storage section and the information that the pv storage section is mounted to a service container in the pv information.
As shown in fig. 2, in connection with an embodiment of the present invention, there is provided a system for providing kubernetes clusters with different storage types, including:
The storage operator component unit 21 deployed in the kubernetes clusters is used for automatically starting the service ends respectively possessed by the storage software deployed in the kubernetes clusters and initializing the storage software; setting a storage type for each storage software respectively; and
Setting corresponding appointed storage spaces in each storage software respectively;
The connection unit 22 is configured to connect, for each service in the kubernetes clusters, the service container with a server side of storage software having the same storage type in a preset manner when the service container is created; the server side of the storage software is used for receiving the data transmitted by the service container connected with the server side and writing the received data into the appointed storage space of the storage software, and/or is used for acquiring the data to be read from the appointed storage space of the storage software where the server side is located and transmitting the data to the service container connected with the server side.
Preferably, the storage operator component unit 21 includes:
A storage type setting subunit 211, configured to create a plurality of preset storage classes, and define a connection method between each storage class and each storage software to be connected and deployed in the kubernetes cluster; the connection method comprises the following steps: the address of the server of the storage software to be connected, the user name of the server of the storage software to be connected, and the password of the server of the storage software to be connected;
for each piece of storage software deployed in the kubernetes cluster, respectively connecting each piece of storage software with each storage class to be connected according to the connection method so as to determine the storage type of each piece of storage software;
The designated storage space setting subunit 212 is configured to divide a storage space with a preset capacity from each storage software respectively as a pvc resource, and use the pvc resource as a designated storage space, where a storage type of the pvc resource is a storage type of the storage software where the pvc resource is located.
Preferably, the connection unit 22 includes:
kubectl component module 221, configured to, before the service container is connected to a server side of storage software having the same storage type in a preset manner for each service in the kubernetes cluster, set a configuration for creating the service container, where the configuration for creating the service container includes: designating pvc resources of the same type as the service data storage type of the service container, and setting the identifier of the designated pvc resources at the volume field of the service container; according to the position of the appointed pvc resource in the storage software, declaring the storage or acquisition path of the data of the service container at the volume section hanging field; requiring that the volume field name used by the business container be named when the business container is created; and
Submitting the request to create the business container to the management tool kubenetes while sending the configuration to create the business container to the management tool kubenetes;
A management tool kubenetes222,222, configured to parse the identifier of the specified pvc resource from the configuration of the service creation container, divide a plurality of pv storage segments from the specified pvc resource according to the identifier of the specified pvc resource, and use the pv storage segments as the minimum storage unit of service data in the kubernets cluster;
setting pv information for each pv storage segment in a specified pvc resource, the pv information including: the storage type of the storage software where the pv storage section is located and the identification of a container used for the service to be installed in the pv storage section;
The configured pv information is sent to a client kubelet, and a command for mounting the pv storage section to a service container according to the pv information is issued to the client kubelet; wherein the client kubelet is located within a kubenetes cluster.
Preferably, the connection unit 22 further includes:
The client kubelet is configured to connect, according to the received pv information, for each pv storage section of each storage type, the client to a server of the storage software where the pv storage section is located, and mount the pv storage section to a service container in the pv information.
Preferably, the method comprises the steps of,
The client kubelet is further configured to send, through a storage volume plugin plug-in provided in the client kubelet, information that the client itself is connected to a server of the storage software where the pv storage section is located, and information that the pv storage section is mounted to a service container in the pv information, to a storage agent component module;
The storage agent component module 224 is configured to connect a storage client having the same storage type as the pv storage segment with a server of the storage software where the pv storage segment is located according to information that the client kubelet is connected with the server of the storage software where the pv storage segment is located and information that the pv storage segment is mounted to a service container in the pv information; the storage agent component module is deployed on node nodes of kuberentes clusters, and each node comprises a plurality of containers; each node is provided with a storage agent component module, and a plurality of storage clients are installed in the storage agent component module; each storage client corresponds to a storage type.
In the invention, when the container has service data for storage, the service data is sent to the server of the storage software connected with the storage client by the storage client of the storage type of the service container, and the server stores the received service data to the appointed position of the appointed storage space of the storage software where the service data is positioned. Namely: when the data in the service container is stored, the data is sent to a server on the storage software where the pv storage section with the same type as the service data is located according to the storage path of the service data through the client kubelet, the server on the storage software stores the service data into the pv storage section of the storage software, and the pv storage section identification for storing the service data is displayed in the container.
When the container needs to acquire data, a data acquisition request is sent to a server side of storage software connected with the storage client side through a storage client side of a storage type of the service container, and the server side acquires data from a designated position of a designated storage space of the storage software where the server side is located and sends the acquired data to the storage client side. Namely: when the data in the service container is stored, the data is sent to a server where the storage software where the pv storage section is located through a storage client with the same storage type as the pv storage section according to the storage path of the service data, the service data is stored in the pv storage section of the storage software, and the pv storage section identification for storing the service data is displayed in the container.
The beneficial effects obtained by the invention are as follows:
the container manager only needs to provide the needed size of the storage and the names of the storage software needed to be used, and does not need to care about the configuration items of each storage software on kubernetes clusters, and the configuration items are automatically created and completed by the system.
2, Kubernete cluster administrators can provide multiple storage types, sharing stored traffic to different storage systems. The requirements of different services for different storage software are met.
3, The operation is simple, the use is convenient, any storage software can be selected, and the storage software can be replaced at any time.
The foregoing technical solutions of the embodiments of the present invention will be described in detail with reference to specific application examples, and reference may be made to the foregoing related description for details of the implementation process that are not described.
The technical terms and abbreviations involved in this method are as follows:
Kubernetes: container arrangement management tool
Kubernetes clusters: all components of this software and servers running these components are included kubernetes.
Kubernetes application above: service deployed using kubernetes, such as the nginx service, the mysql service, and so on.
Kubernetes resources: such as duplicate, server, ingress, etc., which are used to deploy services above kubernetes.
Kubernetes ecological software: such as prometheus monitoring systems, ALERT MANAGER alarm systems, helm management tools, etc.
A container: the container image is a lightweight, independently executable software package of software that contains everything needed to run it: code, runtime, system tools, system libraries, settings, etc., a container is the running state of a program in a container impact.
Storing software: ceph nfs minio gfs, which are storage software providing shared storage functions, have a storage server and a storage client. Using the client to connect to the storage server, it is possible to want to write and read data in the storage.
CRD kubernetes functions for custom extension of kubbernetes functions.
Storage volume: a portion of the memory space allocated for storage is shared for use by a user.
And (3) mounting: the storage volume is placed in a location of the operating system that allows the operating system to access remote storage as well as local files.
The invention provides a method and a system for providing various storage types for Kubernetes, which aims to solve the technical problems:
1, the container manager does not need to care about the storage software, and only needs to configure the capacity of the storage.
2, Kuuberantes cluster management personnel only need one software of the system to support a plurality of storage software at kubernetes clusters.
The system provides a unified storage configuration that eliminates the need for maintenance personnel of the container to be concerned about what type of storage software is being used. Thus, the container maintainer is facilitated, and the kubernetes cluster manager is also facilitated.
The system can be used for quickly and simply using the storage software, and the storage can be used by using the unified configuration of the container without paying attention to different configurations used by different storage software; kuberentes the cluster manager uniformly configures different storage software and provides uniform storage for container manager.
The system comprises a plurality of components, each of which is responsible for a part of the functions, as shown in fig. 3:
1、storage operator:
This component is a piece of software deployed in kubernetes clusters, each kubernetes cluster deploys a storage operator, which acts to start up the servers of the storage software ceph, minio, nfs, gfs, and then initialize the storage of the storage software.
As shown in step 1 of fig. 3, a storage operator component (storage operator component unit) starts up a storage cluster ceph, a storage cluster minio, a storage cluster nfs and a storage cluster gfs, wherein the storage clusters are deployed in a kubernetes cluster, and are containers in the kubernetes cluster, and the containers respectively form different storage clusters and provide a storage server, and the storage server can accept read and write data of a storage client to shared storage.
The storage operator component unit sets a storage type for each storage software respectively, specifically: the storage operator component unit creates a plurality of preset storage classes, and respectively defines the connection method of each storage class and storage software to be connected and deployed in kubernetes clusters; the connection method comprises the following steps: the address of the server of the storage software to be connected, the user name of the server of the storage software to be connected, and the password of the server of the storage software to be connected; (after the storage cluster is started by the storage operator, as shown in step 2 of fig. 3, the storage operator starts to connect to kubernetes api, creates a storage class resource, which is a storage class, and defines a connection method of storage software, where the connection method includes an address, a user name, a password, and the like of a storage server). And for each storage software deployed in the kubernetes clusters, respectively connecting each storage software with each storage class to be connected according to the connection method so as to determine the storage type of each storage software.
The storage operator component unit sets corresponding designated storage spaces in each storage software respectively, and specifically includes: the storage operator component unit respectively divides storage spaces with preset capacity from each storage software to serve as pvc resources, the pvc resources are served as designated storage spaces, and the storage types of the pvc resources are the storage types of the storage software where the pvc resources are located. (the storage operator then creates pvc resources, which are a block of storage space in the storage software connected from the storage class, expressed in GB, e.g. a pvc may be 1000Gb in size. Pvc resources will be used later in creating the container, pvc will allocate to the container a pv storage section required by the container, where pv is the entity of the storage used by the container and contains the mounting location of the storage, i.e. the location of the storage shown in the container).
For each service in kubernetes clusters, connecting a service container with a service end of storage software with the same storage type in a preset mode when the service container is created; the server side of the storage software is used for receiving the data transmitted by the service container connected with the server side and writing the received data into the appointed storage space of the storage software, and/or is used for acquiring the data to be read from the appointed storage space of the storage software where the server side is located and transmitting the data to the service container connected with the server side.
2、kubernetes api
This component is the core component of the kuberntes cluster, accepts the request, verifies the validity of the parameters in the request, and is the transfer station core of the entire kubernetes cluster. Accept the request and forward to the component that needs to process the request.
3、kubectl
As shown in step 3 of fig. 3, through kubectl components, a service container may be created, and first, a configuration for creating a service container is set, where the configuration for creating a service container includes: designating pvc resources of the same type as the service data storage type of the service container, and setting the identifier of the designated pvc resources at the volume field of the service container; according to the position of the appointed pvc resource in the storage software, declaring the storage or acquisition path of the data of the service container at the volume section hanging field; the volume field name used by the business container is required to be named when the business container is created. (i.e., specify the pvc created in step 2 at the time of creating this container, which pvc is configured at the volume field of the container, then uses the stored path within the namecontainer at the volume mount field, while configuring the name of the volume for use by the namelet at the time of user creation of the container (i.e., at the time of creating the pod of kubernetes).
After the above configuration, kubectl component module submits a request to create a business container to management tool kubenetes, while sending the configuration to create a business container to management tool kubenetes; kubectl submits a request to create a container to kubernetes api as shown in step 3 of fig. 3, and kubernetes api sends kubectl a request to create a container to kubenetes.
The management tool kubenetes analyzes the identifier of the specified pvc resource from the configuration of the created service container, divides a plurality of pv storage segments from the specified pvc resource according to the identifier of the specified pvc resource, uses the pv storage segments as the minimum storage unit of the service data in the kubernets cluster (kubenetes analyzes the pvc according to the request submitted by the user, creates the pv resource (pv storage segment) required by the container, and creates kubernetes pv information describing the type of storage software and the type of the container to which the pv information is mounted. Wherein pv is the storage minimum unit of kubernets clusters.
The management tool kubenetes sends kubelet the information of the configured pv. kubelet based on the pv information, and issue a command to the client kubelet to mount the pv storage segments to the service container based on the pv information (the command refers to ready storage, mount storage into the container).
4、kubelet
As shown in step 4 of fig. 3, kubelet is a client of the kubenetes cluster, and executes the instruction sent by kubernetes. If a pod is created, preparing storage according to pv information, wherein the preparation storage is connection storage software; and then the storage is mounted. The client kubelet, according to the received pv information, for each pv storage section of the storage type, the client kubelet connects itself to the server of the storage software where the pv storage section is located, and the client kubelet mounts the pv storage section to the service container in the pv information.
Kubelet supports the development of additional plugins, which in the present system are storage volume plugin components, and storage volume plugin components can send the functions of creating storage and mounting storage to the storage agent (i.e. the client kubelet sends information that connects itself with the server of the storage software where the pv storage segment is located, and information that the pv storage segment mounts to the service container in the pv information, to the storage agent component module through storage volume plugin plugins that it has), as shown in step 101 and step 5.
5、storage agent
The storage agent component module is a container deployed by using a kubetnetes daemon set mode, and runs an instance (storage agent component) at each kuberentes node (node), and various storage clients are installed in the storage agent component module; each storage client corresponds to a storage type. Thus each node has the ability to mount various types of stored software. Wherein each node includes a plurality of containers.
The component accepts the request sent in step 5, starts to create storage, installs all storage clients of storage types (one client corresponds to one storage type), uses the clients to connect to different types of storage clusters (i.e. storage servers), and then connects to the storage servers, and then installs the storage to a container (the storage agent component module connects the storage clients of the same storage type as the pv storage segment to the storage software server of the pv storage segment according to the information that the client kubelet is connected to the storage software server of the pv storage segment and the information that the pv storage segment is installed to the service container in the pv information). The container refers to a container that needs to store data, that is, a container for business to be created through kubectl in step 3.
It can also be understood that: the storage agent is an extension of kubelet, kubelet takes pv information to give to the storage agent. After the store is created, the creation results are reported to kubentes api as shown in step 6 of FIG. 3. Kubenbetes api receives the result of the creation, modifies the created container to a state where the creation has been completed.
Creating and mounting to a container is two parts. The creation is to make the server side of the storage software distribute the storage section, and the mounting is to mount the storage section into the container (mounting is equivalent to connecting).
The creation is to let the server side of the storage software allocate the storage section, pv is the storage section (but not perceived by the user), pv is allocated by pvc, and what kind of storage software is used is configured in pvc.
The pv information in step 3 describes the type of stored software, which container to mount to; step 4 prepares for storage (the preparation for storage is connection storage software) based on the information, and mounts the information to the container.
The beneficial effects obtained by the invention are as follows:
the container manager only needs to provide the needed size of the storage and the names of the storage software needed to be used, and does not need to care about the configuration items of each storage software on kubernetes clusters, and the configuration items are automatically created and completed by the system.
2, Kubernete cluster administrators can provide multiple storage types, sharing stored traffic to different storage systems. The requirements of different services for different storage software are met.
3, The operation is simple, the use is convenient, any storage software can be selected, and the storage software can be replaced at any time.
It should be understood that the specific order or hierarchy of steps in the processes disclosed are examples of exemplary approaches. Based on design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.
In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, invention lies in less than all features of a single disclosed embodiment. Thus the following claims are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate preferred embodiment of this invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. As will be apparent to those skilled in the art; various modifications to these embodiments will be readily apparent, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, as used in the specification or claims, the term "comprising" is intended to be inclusive in a manner similar to the term "comprising," as interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean "non-exclusive or".
Those of skill in the art will further appreciate that the various illustrative logical blocks (illustrative logical block), units, and steps described in connection with the embodiments of the invention may be implemented by electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software (interchangeability), various illustrative components described above (illustrative components), elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Those skilled in the art may implement the described functionality in varying ways for each particular application, but such implementation is not to be understood as beyond the scope of the embodiments of the present invention.
The various illustrative logical blocks or units described in the embodiments of the invention may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described. A general purpose processor may be a microprocessor, but in the alternative, the general purpose processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. In an example, a storage medium may be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may reside in a user terminal. In the alternative, the processor and the storage medium may reside as distinct components in a user terminal.
In one or more exemplary designs, the above-described functions of embodiments of the present invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on a computer-readable medium or transmitted as one or more instructions or code on the computer-readable medium. Computer readable media includes both computer storage media and communication media that facilitate transfer of computer programs from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media may include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that may be used to carry or store program code in the form of instructions or data structures and other data structures that may be read by a general or special purpose computer, or a general or special purpose processor. Further, any connection is properly termed a computer-readable medium, e.g., if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless such as infrared, radio, and microwave, and is also included in the definition of computer-readable medium. The disks (disks) and disks (disks) include compact disks, laser disks, optical disks, DVDs, floppy disks, and blu-ray discs where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included within the computer-readable media.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.
Claims (10)
1. A method for providing kubernetes clusters with different storage types, comprising:
The storage operator component unit deployed in the kubernetes cluster automatically starts the service ends respectively possessed by the storage software deployed in the kubernetes cluster, and initializes the storage software; setting a storage type for each storage software respectively;
the storage operator component unit sets corresponding designated storage spaces in each piece of storage software respectively;
For each service in kubernetes clusters, connecting a service container with a service end of storage software with the same storage type in a preset mode when the service container is created; the server side of the storage software is used for receiving the data transmitted by the service container connected with the server side and writing the received data into the appointed storage space of the storage software, and/or is used for acquiring the data to be read from the appointed storage space of the storage software where the server side is located and transmitting the data to the service container connected with the server side;
the method for setting the storage type for each storage software comprises the following steps:
The storage operator component unit creates a plurality of preset storage classes, and respectively defines the connection method of each storage class and storage software to be connected and deployed in kubernetes clusters; the connection method comprises the following steps: the address of the server of the storage software to be connected, the user name of the server of the storage software to be connected, and the password of the server of the storage software to be connected; and
And for each storage software deployed in the kubernetes clusters, respectively connecting each storage software with each storage class to be connected according to the connection method so as to determine the storage type of each storage software.
2. The method for providing different storage types for kubernetes clusters according to claim 1, wherein the storage operation component unit sets a corresponding designated storage space in each storage software, and specifically includes:
The storage operator component unit respectively divides storage spaces with preset capacity from each storage software to serve as pvc resources, the pvc resources are served as designated storage spaces, and the storage types of the pvc resources are the storage types of the storage software where the pvc resources are located.
3. The method for providing the kubernetes clusters with different storage types according to claim 2, wherein, before the service container is created for each service in the kubernetes clusters, the service container is connected to a server side of storage software having the same storage type in a preset manner, the method includes:
The kubectl component module sets a configuration of creating a business container, the configuration of creating a business container comprising: designating pvc resources of the same type as the service data storage type of the service container, and setting the identifier of the designated pvc resources at the volume field of the service container; according to the position of the appointed pvc resource in the storage software, declaring the storage or acquisition path of the data of the service container at the volume section hanging field; requiring that the volume field name used by the business container be named when the business container is created;
The kubectl component module submits a request to create a business container to the management tool kubenetes while sending the configuration to create a business container to the management tool kubenetes;
The management tool kubenetes analyzes the identifier of the appointed pvc resource from the configuration of the established service container, divides a plurality of pv storage sections from the appointed pvc resource according to the identifier of the appointed pvc resource, and takes the pv storage sections as the minimum storage unit of service data in the kubernets cluster;
setting pv information for each pv storage segment in a specified pvc resource, the pv information including: the storage type of the storage software where the pv storage section is located and the identification of a container used for the service to be installed in the pv storage section;
the management tool kubenetes sends the configured pv information to the client kubelet, and issues a command for mounting the pv storage section to the service container according to the pv information to the client kubelet; wherein the client kubelet is located within a kubenetes cluster.
4. The method for providing different storage types for kubernetes clusters according to claim 3, wherein for each service in kubernetes clusters, when creating a service container, connecting the service container with a server of storage software having the same storage type in a preset manner, specifically includes:
The client kubelet, according to the received pv information, for each pv storage section of the storage type, the client kubelet connects itself to the server of the storage software where the pv storage section is located, and the client kubelet mounts the pv storage section to the service container in the pv information.
5. The method of providing a kubernetes cluster with different storage types according to claim 4, further comprising:
Each node of kuberentes clusters is deployed with a storage agent component module, and a plurality of storage clients are installed in the storage agent component module; each storage client corresponds to one storage type; wherein each node comprises a plurality of containers;
The client kubelet, according to the received pv information, for each pv storage section of the storage type, the client kubelet connects itself with a server of the storage software where the pv storage section is located, and the client kubelet mounts the pv storage section to a service container in the pv information, which specifically includes:
The client kubelet sends the information of itself connected with the server of the storage software where the pv storage section is located and the information of the service container of the pv storage section mounted in the pv information to the storage agent component module through the storage volume plugin plug-in unit;
and the storage agent component module connects the storage client with the storage software server with the pv storage section according to the information that the client kubelet is connected with the storage software server with the pv storage section and the information that the pv storage section is mounted to a service container in the pv information.
6. A system for providing kubernetes clusters with different storage types, comprising:
The storage operator component unit is deployed in the kubernetes clusters and is used for automatically starting the service ends respectively possessed by the storage software deployed in the kubernetes clusters and initializing the storage software; setting a storage type for each storage software respectively; setting corresponding appointed storage spaces in each storage software respectively;
The connection unit is used for connecting the service container with a server side of storage software with the same storage type in a preset mode when the service container is created for each service in the kubernetes clusters; the server side of the storage software is used for receiving the data transmitted by the service container connected with the server side and writing the received data into the appointed storage space of the storage software, and/or is used for acquiring the data to be read from the appointed storage space of the storage software where the server side is located and transmitting the data to the service container connected with the server side;
the storage operator component unit comprises:
A storage type setting subunit, configured to create a plurality of preset storage classes, and define a connection method between each storage class and storage software to be connected and deployed in the kubernetes clusters; the connection method comprises the following steps: the address of the server of the storage software to be connected, the user name of the server of the storage software to be connected, and the password of the server of the storage software to be connected; and for each storage software deployed in the kubernetes clusters, respectively connecting each storage software with each storage class to be connected according to the connection method so as to determine the storage type of each storage software.
7. The system for providing different storage types for kubernetes clusters according to claim 6, wherein the storage operation component unit further includes:
the specified storage space setting subunit is used for respectively dividing a storage space with preset capacity from each piece of storage software to serve as a pvc resource, and taking the pvc resource as the specified storage space, wherein the storage type of the pvc resource is the storage type of the storage software where the pvc resource is located.
8. The system for providing different storage types for kubernetes clusters according to claim 6, wherein the connection unit includes:
A kubectl component module, configured to, before the service container is connected to a server side of storage software having the same storage type in a preset manner for each service in the kubernetes cluster, set a configuration for creating the service container, where the configuration for creating the service container includes: designating pvc resources of the same type as the service data storage type of the service container, and setting the identifier of the designated pvc resources at the volume field of the service container; according to the position of the appointed pvc resource in the storage software, declaring the storage or acquisition path of the data of the service container at the volume section hanging field; requiring that the volume field name used by the business container be named when the business container is created; and submitting the request to create the business container to the management tool kubenetes while sending the configuration to create the business container to the management tool kubenetes;
A management tool kubenetes, configured to parse the identifier of the specified pvc resource from the configuration of the service creation container, divide a plurality of pv storage segments from the specified pvc resource according to the identifier of the specified pvc resource, and use the pv storage segments as the minimum storage unit of service data in the kubernets cluster; setting pv information for each pv storage segment in a specified pvc resource, the pv information including: the storage type of the storage software where the pv storage section is located and the identification of a container used for the service to be installed in the pv storage section; the configured pv information is sent to a client kubelet, and a command for mounting the pv storage section to a service container according to the pv information is issued to the client kubelet; wherein the client kubelet is located within a kubenetes cluster.
9. The system for providing different storage types for kubernetes clusters of claim 8, wherein said connection unit further comprises:
And the client kubelet is used for connecting the client with the server of the storage software where the pv storage section is located according to the received pv information for the pv storage section of each storage type, and mounting the pv storage section to a service container in the pv information.
10. The system for providing different storage types for kubernetes clusters as set forth in claim 9,
The client kubelet is further configured to send, through a storage volume plugin plug-in provided in the client, information that the client is connected to a server of the storage software where the pv storage segment is located, and information that the pv storage segment is mounted to a service container in the pv information, to a storage agent component module;
The storage agent component module is used for connecting a storage client with the same storage type of the pv storage segment with the server side of the storage software where the pv storage segment is located according to the information that the client kubelet is connected with the server side of the storage software where the pv storage segment is located and the information that the pv storage segment is mounted to a service container in the pv information; the storage agent component module is deployed on node nodes of kuberentes clusters, and each node comprises a plurality of containers; each node is provided with a storage agent component module, and a plurality of storage clients are installed in the storage agent component module; each storage client corresponds to a storage type.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210103966.2A CN114461147B (en) | 2022-01-28 | 2022-01-28 | Method and system for providing kubernetes clusters with different storage types |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210103966.2A CN114461147B (en) | 2022-01-28 | 2022-01-28 | Method and system for providing kubernetes clusters with different storage types |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114461147A CN114461147A (en) | 2022-05-10 |
CN114461147B true CN114461147B (en) | 2024-07-16 |
Family
ID=81412273
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210103966.2A Active CN114461147B (en) | 2022-01-28 | 2022-01-28 | Method and system for providing kubernetes clusters with different storage types |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114461147B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10841152B1 (en) * | 2017-12-18 | 2020-11-17 | Pivotal Software, Inc. | On-demand cluster creation and management |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030078996A1 (en) * | 2001-10-15 | 2003-04-24 | Ensoport Internetworks | EnsoBox clustered services architecture: techniques for enabling the creation of scalable, robust, and industrial strength internet services provider appliance |
CN105867955A (en) * | 2015-09-18 | 2016-08-17 | 乐视云计算有限公司 | Deployment system and deployment method of application program |
US11579941B2 (en) * | 2019-05-05 | 2023-02-14 | Mastercard International Incorporated | Control cluster for multi-cluster container environments |
CN110535831B (en) * | 2019-07-30 | 2022-02-01 | 平安科技(深圳)有限公司 | Kubernetes and network domain-based cluster security management method and device and storage medium |
US11836158B2 (en) * | 2020-02-03 | 2023-12-05 | Microstrategy Incorporated | Deployment of container-based computer environments |
CN111522639B (en) * | 2020-04-16 | 2022-11-01 | 南京邮电大学 | Multidimensional resource scheduling method under Kubernetes cluster architecture system |
CN111782370B (en) * | 2020-06-30 | 2022-12-06 | 平安科技(深圳)有限公司 | Kubernetes multi-cluster management system, method, terminal and storage medium |
-
2022
- 2022-01-28 CN CN202210103966.2A patent/CN114461147B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10841152B1 (en) * | 2017-12-18 | 2020-11-17 | Pivotal Software, Inc. | On-demand cluster creation and management |
Also Published As
Publication number | Publication date |
---|---|
CN114461147A (en) | 2022-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112187545B (en) | Network slice deployment method and device | |
CN108370341B (en) | Resource allocation method, virtual network function manager and network element management system | |
US20190372853A1 (en) | Dynamic reservation protocol for 5G network slicing | |
CN112230942A (en) | Automatic deployment method and system supporting various domestic operating systems | |
WO2014101475A1 (en) | Cloud platform application deployment method and apparatus | |
CN114827241A (en) | Cross-platform deployment method and system | |
CN109067599A (en) | A kind of method and device for disposing cluster | |
CN110099095B (en) | Software deployment method and device, electronic equipment and computer-readable storage medium | |
US20200106711A1 (en) | Apparatus and method for managing application on multi-cloud service environment | |
EP3091435A1 (en) | Resource management method and device for terminal system | |
CN111641521A (en) | Ambari-based method for deploying big data clusters on cloud | |
CN111324457A (en) | Method, device, equipment and medium for issuing inference service in GPU cluster | |
CN114461147B (en) | Method and system for providing kubernetes clusters with different storage types | |
CN114296909A (en) | Automatic node capacity expansion and reduction method and system according to kubernets event | |
CN106302075B (en) | A kind of method and device creating logical volume | |
CN113886093A (en) | Cloud resource management system based on multi-cloud architecture and electronic equipment | |
US9819732B2 (en) | Methods for centralized management API service across disparate storage platforms and devices thereof | |
US10764135B2 (en) | Method and system for solution integration labeling | |
CN107005468B (en) | Method and device for determining NSD (non-volatile memory) to be uploaded | |
CN112311886B (en) | Multi-cluster deployment method, device and management node | |
CN114489692A (en) | Automatic installation method and system of self-adaptive physical machine | |
CN113810463A (en) | Configuration method and system for issuing CDN server | |
CN113504872A (en) | Method, system, equipment and medium for mounting virtual disk on cloud physical machine | |
CN110881064B (en) | Domain name configuration method and device | |
US8412769B2 (en) | Scalably imaging clients over a network |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20230418 Address after: Room 501-502, 5/F, Sina Headquarters Scientific Research Building, Block N-1 and N-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193 Applicant after: Sina Technology (China) Co.,Ltd. Address before: 100193 7th floor, scientific research building, Sina headquarters, plot n-1, n-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193 Applicant before: Sina.com Technology (China) Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |