Movatterモバイル変換


[0]ホーム

URL:


CN114416290B - Method and equipment for automatically building container platform based on onsible - Google Patents

Method and equipment for automatically building container platform based on onsible
Download PDF

Info

Publication number
CN114416290B
CN114416290BCN202111643216.6ACN202111643216ACN114416290BCN 114416290 BCN114416290 BCN 114416290BCN 202111643216 ACN202111643216 ACN 202111643216ACN 114416290 BCN114416290 BCN 114416290B
Authority
CN
China
Prior art keywords
playbook
container platform
role
kubernetes
server
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
Application number
CN202111643216.6A
Other languages
Chinese (zh)
Other versions
CN114416290A (en
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.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino CorpfiledCriticalAisino Corp
Priority to CN202111643216.6ApriorityCriticalpatent/CN114416290B/en
Publication of CN114416290ApublicationCriticalpatent/CN114416290A/en
Application grantedgrantedCritical
Publication of CN114416290BpublicationCriticalpatent/CN114416290B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The application relates to a method and equipment for automatically building a container platform based on an existing. According to the application, an ansable automatic operation and maintenance tool is introduced, by configuring playbook and a host list in an ansable and operating playbook to install a Kubernetes container platform on a server, a standardized and batched delivery and deployment mode for constructing a k8s platform is realized, remarkable synergy and cost reduction are realized, and good technical conditions are created for application, popularization and popularization of micro-services. In addition, the Kubernetes platform is built by adopting an stable, an agent in an operating system is not required to be installed on the client, and the resource loss of the client can be reduced.

Description

Method and equipment for automatically building container platform based on onsible
Technical Field
The application relates to the field of deployment of micro-service computer systems, in particular to a method and equipment for automatically building a container platform based on an existing.
Background
With the transformation of enterprise IT architecture, container, orchestration, and micro-service technologies are popular, and the container technologies provide a floor guarantee for micro-services.
Kubernetes, abbreviated as k8s, is a portable container arrangement management tool for container service, more and more companies are hugging k8s, and currently k8s has dominant cloud business processes, so that popularization and landing of hot technologies such as micro-service architecture are promoted. The availability and the scalability of the micro-service architecture are concerned with obtaining a good solution through K8s, and the micro-service architecture also provides a good solution for service deployment, service monitoring, application capacity expansion and fault handling and K8s on the deployment operation and maintenance level.
In the prior art, k8s clusters are manually deployed through a field, so that the problems of inconsistent system environment versions, increased deployment time, high manual learning cost, difficult transplantation and the like are caused, and great difficulty is brought to the application and popularization of micro-services.
Disclosure of Invention
The application aims to provide a method for realizing automatic construction of a container platform. The application also provides corresponding electronic equipment and a computer storage medium.
In one aspect of the application, a method for automatically building a container platform based on an stable is provided, comprising the following steps:
a configuration playbook, the playbook comprising a plurality of plays for mounting a Kubernetes container platform, each play corresponding to at least one role;
configuring a host list, and setting an ip address corresponding to each role in the host list;
And running playbook, and installing a Kubernetes container platform on the server indicated by the ip address.
Optionally, the plurality of play-corresponding roles include a role for system initialization, a role for installing containers, a role for installing mirror warehouse, and a role for installing Kubernetes orchestration platform.
Optionally, each of the roll is configured to perform at least one task, the method further comprising:
before the playbook is operated, an allowable predefined module is called to write the task corresponding to each role.
Optionally, the method further comprises:
Before running the playbook, creating a plurality of folders for each of the roles, the plurality of folders including a folder storing static files, a folder storing template files, a folder setting variables, a folder storing the at least one task performed by the role.
Optionally, the method further comprises:
If the server indicated by the ip address is at a first security level, the playbook is run to remotely install a Kubernetes container platform on the server.
Optionally, running the playbook to remotely install the Kubernetes container platform on the server specifically includes:
and running playbook, and remotely installing a Kubernetes container platform on the server based on the ssh protocol.
Optionally, the method further comprises:
If the server indicated by the ip address is at a second security level, then the playbook is migrated to a device connected to the server, and the playbook is run on the device to install a Kubernetes container platform on the server.
Optionally, the Kubernetes container platform comprises:
the Kubernetes container platform is installed in a binary fashion.
In another aspect of the present application, there is provided an electronic apparatus including:
A memory storing executable instructions;
a processor that executes the executable instructions in the memory to implement the method of automatically building a container platform based on an onsible as described above.
In another aspect of the present application, a computer readable storage medium is provided, which stores a computer program which, when executed by a processor, implements a method of automatically building a container platform based on an onsite as described above.
According to the technical scheme disclosed by the application, an existing automated operation and maintenance tool is introduced, and through configuring playbook and configuring a host list (inventory) in the existing, and operating playbook to install a Kubernetes container platform on a server, the standardized and batched delivery and deployment modes for constructing a k8s platform are realized, the obvious synergy and cost reduction are realized, and good technical conditions are created for the application, popularization and popularization of micro-services. In addition, the Kubernetes platform is built by adopting an stable, an agent (agent) in an operating system is not required to be installed on the client, and the resource loss of the client can be reduced.
Drawings
The foregoing and other objects, features and advantages of the application will be apparent from the following more particular descriptions of exemplary embodiments of the application as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts throughout the exemplary embodiments of the application.
FIG. 1 shows a flowchart of a method for automatically building a container platform based on an onsite, according to one embodiment of the application.
Figure 2 shows a schematic flow diagram of a construction of a container platform according to an exemplary embodiment of the application.
Detailed Description
The application will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present application are illustrated in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
As described above, kubernetes has important significance for application, popularization and promotion of micro services and the like, but at present, the Kubernetes cluster needs to be manually deployed, so that the problems of inconsistent system environment version, increased deployment time, high artificial learning cost, difficult transplantation and the like are caused, and great difficulty is brought to the application of micro services.
Through deep knowledge of numerous technical schemes and combinations thereof, the applicant selects to introduce an existing into the Kubernetes cluster for deployment, realizes a standardized delivery deployment mode for constructing a Kubernetes container platform, remarkably improves efficiency and reduces cost, creates good technical conditions for application, popularization and popularization of micro-services, and can also reduce resource loss of a client operating system.
Ansible is a simple, powerful and agent-free automation language written based on YAML text, simple and legible. an onstable does not require an agent, and no additional agents (agents) need to be installed on the host or network device. Furthermore, the stable may also implement cross-platform support, which may support linux, windows, unix and network devices. playbook, play, role, manifest (invertory), task (task), module, etc. are important terms in the allowable. playbook can be viewed as a task list of roles, which are script files built based on YAML in an existing. The main function of play is to impersonate hosts that have been grouped together in advance into a roll that is defined in advance by the task. roll is a new property introduced by an onsible from version 1.2 for hierarchically, structured organization playbook. the task calls a module predefined in the stable to perform the desired task. A module (module) is a predefined module in an allowable. Inventory (inventory) is a list of roles, with an existing supporting dynamic objects as well as static objects. Plugin refers to a code segment added to an existing platform for extending the existing platform.
FIG. 1 shows a flowchart of a method for automatically building a container platform based on an onsite, according to one embodiment of the application. As shown in fig. 1, the method includes steps 102, 104, and 106.
Step 102, configuring playbook, wherein the playbook comprises a plurality of plays, wherein the plays are used for installing a Kubernetes container platform, and each play corresponds to at least one role.
In some possible embodiments, the plurality of play-corresponding roles include a role for system initialization, a role for installing containers, a role for installing mirror image warehouses, a role for installing Kubernetes' orchestration platform, and so on. The Kubernetes orchestration platform typically includes a master and a node.
In some possible embodiments, each of the roles is configured to execute at least one task (task), and an allowable predefined module may be called to write the task corresponding to each of the roles.
The deployment task may be split into multiple plays, each corresponding to at least one role, which impersonates hosts that have been previously grouped into a group into roles that are previously defined by tasks in the stable. An allowable predefined module (module) may be invoked to write the corresponding task. copy, template, shell, yum, etc. are commonly called modules in an existing. copy module to cover the files under the appointed directory to roll; the template module is used for replacing the configuration file on the covering roll; the shell module is used for remotely executing the shell script; yum module for remote installation and uninstallation of software.
In some possible embodiments, the method further comprises: creating a plurality of folders for each role, wherein the folders comprise folders for storing static files, folders for storing template files, folders for setting variables, folder groups for storing the at least one task executed by the role, file groups for setting variables, and file groups for storing the at least one task executed by the role.
A files, tasks, templates, vars folder may be created for each role. files are used for storing static files; the templates are used for storing template files; vars is used to set the variables of the operation; tasks are used for storing one or more tasks (tasks) executed by the role, and a predefined module in an existing can be called in a task file.
Step 104, configuring a host list, and setting an ip address corresponding to each role in the host list.
The ip address corresponding to each of the role may be set in the host list. The same role can be deployed on a plurality of servers, so that batch deployment is realized, and high availability of the system is also facilitated.
And 106, running playbook, and installing a Kubernetes container platform on the server indicated by the ip address.
The server may be a host (host) server or a network (networking) server.
In some possible implementations, if the server indicated by the ip address is at the first security level, the playbook is run to remotely install the Kubernetes container platform on the server. In one example, the Kubernetes container platform may be installed remotely on the server indicated by the ip address based on the ssh protocol.
In some possible implementations, if the server indicated by the ip address is at the second security level, then the playbook is migrated to a device connected to the server, on which the playbook is run to install the Kubernetes container platform on the server.
For servers in a common production environment (first security level), all the container platform servers can be opened by using a ssh authentication mode to carry out remote installation and deployment; and deleting the public key and the private key after deployment is completed, and adding the public key and the private key into the fort machine.
For a server in a network isolated environment (second security level), playbook may be copied to a device in communication with the server, which may be other servers in the same network isolated environment as the server or the server itself; running playbook on the device to install and deploy on the server; and playbook on the device may be deleted after installation, etc.
According to the technical scheme disclosed by the application, an allowable automatic operation and maintenance tool is introduced, through configuration playbook and a host list, and operation playbook, a Kubernetes container platform is installed on a server, so that a standardized delivery deployment mode for constructing a k8s platform is realized, remarkable synergy and cost reduction are realized, and good technical conditions are created for application, popularization and popularization of micro-services. In addition, the Kubernetes platform is built by adopting an onsible, an agent (agent) is not required to be installed on the client, and the resource loss of the client can be reduced.
For example, operating system initialization unified configuration optimization may be achieved by defining an init_system role in a play, typically including repairing security vulnerabilities, baseline repairs, etc. By the present application, an init_system is set in playbook, which can directly cover multiple remote container platform servers: sshd_ config, selinux, localtime, limits. Conf, sudo, sysctl. Conf, logic. Defs, pwquality. Conf, and can upgrade the linux kernel kube-APISERVER, KUBELET, KUBE-controller-manager, kube-scheduler, kube-prox, etc. at one time, install and delete RPM (RPM package manager), etc., thereby remarkably improving deployment efficiency and reducing error rate. In addition, since the agent is not deployed at the client, no resource loss is caused to the operating system thereof.
For another example, the deployment of container platform kubernetesdocker is complex, requiring manual deployment by highly experienced technicians in the prior art, and lead times are long. By defining the role of installing the dock container in one play, the method realizes the establishment of certificates, etcd clusters, master high availability, automatic installation of multiple components and the like, and can rapidly carry out delivery without knowing the internal principle of the container and a module calling mechanism. In addition, the role is stored in a file mode, has strong portability and reusability, and can be quickly copied to other projects.
In some possible implementations, the multiple plays in playbook can install the Kubernetes container platform on the character in a binary fashion.
The deployment is performed in a binary mode, so that the occurrence problem is easier to be checked, but the deployment is more complex and is easy to make mistakes. According to the application, automatic deployment of an automatic deployment binary mode is realized by introducing an allowable, so that the defects of complicated configuration file modification, easy error and the like of binary deployment are avoided.
Figure 2 shows a flow chart of a method of setting up a container platform according to an exemplary embodiment of the application. As shown in S202, operation playbook is started. S204, performing play corresponding to the system initialization role. S206, performing play corresponding to a install container (dock) role. S208, performing play of the corresponding installation mirror warehouse (harbor) role. S210, executing play corresponding to the installation etcd cluster role. When S210 is executed, the images in the image repository are also pulled. S212, performing play of the corresponding installation cluster master assembly (master) role. S214, performing play of the corresponding installation cluster controlled node (node) role.
The foregoing description of embodiments of the application has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described.

Claims (7)

CN202111643216.6A2021-12-292021-12-29Method and equipment for automatically building container platform based on onsibleActiveCN114416290B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111643216.6ACN114416290B (en)2021-12-292021-12-29Method and equipment for automatically building container platform based on onsible

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111643216.6ACN114416290B (en)2021-12-292021-12-29Method and equipment for automatically building container platform based on onsible

Publications (2)

Publication NumberPublication Date
CN114416290A CN114416290A (en)2022-04-29
CN114416290Btrue CN114416290B (en)2024-09-17

Family

ID=81269326

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111643216.6AActiveCN114416290B (en)2021-12-292021-12-29Method and equipment for automatically building container platform based on onsible

Country Status (1)

CountryLink
CN (1)CN114416290B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116248506A (en)*2022-12-232023-06-09天翼云科技有限公司 Method, device, electronic device and storage medium for deploying domain name resolution service

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109800055A (en)*2018-12-272019-05-24北京航天智造科技发展有限公司Container dispatches method of combination and system
US11449354B2 (en)*2020-01-172022-09-20Spectro Cloud, Inc.Apparatus, systems, and methods for composable distributed computing
CN111736960B (en)*2020-08-102020-12-22北京信安世纪科技股份有限公司Service providing method, device and storage medium based on software isolation
CN112346818B (en)*2020-11-022024-08-23北京新媒传信科技有限公司Container application deployment method and device, electronic equipment and storage medium
CN113127150B (en)*2021-03-182023-10-17同盾控股有限公司Rapid deployment method and device of cloud primary system, electronic equipment and storage medium

Also Published As

Publication numberPublication date
CN114416290A (en)2022-04-29

Similar Documents

PublicationPublication DateTitle
CN110752947B (en)K8s cluster deployment method and device, and deployment platform
CN114020448B (en) A cloud resource orchestration method, device, equipment and storage medium
CN111475260A (en)Flexible CICD method based on jenkins and kubernets platform
CN114024951B (en)Cloud edge collaboration-based power edge heterogeneous deployment method
CN111610985B (en)Kubernetes cluster rapid deployment method on domestic platform
CN113434158B (en)Custom management method, device, equipment and medium for big data component
CN111198695A (en)Automatic deployment method of micro-service administration management platform and electronic equipment
CN112099919B (en)Application service visualization rapid deployment method based on cloud computing API
CN111026723A (en)Big data cluster management control method and device, computer equipment and storage medium
CN108616384B (en)Centralized service management deployment tool and method
CN102882908A (en)Cloud computing management system and cloud computing management method
CN116860266A (en)Application containerized deployment method and device, electronic equipment and storage medium
US12026494B2 (en)Dynamic automation of prerequisite component deployment in disconnected environments
CN115499308B (en)Distributed FTP container deployment method, device, terminal and storage medium
US20250077262A1 (en)Cluster management method, electronic device, and storage medium
US20230008839A1 (en)Smart environment assessment of prerequisites to private cloud provisioning
CN115421740A (en) Deployment method and device for cloud-native applications
CN102567050B (en)The method and apparatus of B/S system remote deploying projects
CN114416290B (en)Method and equipment for automatically building container platform based on onsible
CN114003343A (en)Cloud native application construction method and device and computer equipment
CN115904404A (en)Application management method, device, equipment, medium and computer program product
CN110119279B (en)Application and upgrading method and device thereof
CN111008035B (en)Software operation and maintenance method, electronic equipment and storage medium
CN113419813A (en)Method and device for deploying bare engine management service based on container platform
CN116450153B (en)Rapid deployment method for containerized simulation platform

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp