CN117560281A - Cluster automation deployment method and system based on ansable - Google Patents

Cluster automation deployment method and system based on ansable Download PDF

Info

Publication number
CN117560281A
CN117560281A CN202311399283.7A CN202311399283A CN117560281A CN 117560281 A CN117560281 A CN 117560281A CN 202311399283 A CN202311399283 A CN 202311399283A CN 117560281 A CN117560281 A CN 117560281A
Authority
CN
China
Prior art keywords
role
folder
cluster
tasks
playbook
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311399283.7A
Other languages
Chinese (zh)
Inventor
刘志远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Communication Information System Co Ltd
Original Assignee
Inspur Communication Information System Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Communication Information System Co Ltd filed Critical Inspur Communication Information System Co Ltd
Priority to CN202311399283.7A priority Critical patent/CN117560281A/en
Publication of CN117560281A publication Critical patent/CN117560281A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0889Techniques to speed-up the configuration process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an automatic cluster deployment method and system based on an existing, belongs to the technical field of network operation and maintenance, and aims to solve the technical problem of how to realize automatic k8s cluster deployment and to realize the transplanting and standardization of cluster deployment. The method comprises the following steps: installing an ansable environment and checking whether the ansable version environment is available; configuring a host list in an allowable, and setting a machine IP address corresponding to each role; configuring a role; configuring a playbook; pre-executing an analog script, and calling an analog predefined module to write a task corresponding to each role by using a pre-execution command before the analog script is executed; and running an allowable script deployment cluster, and verifying a cluster function.

Description

Cluster automation deployment method and system based on ansable
Technical Field
The invention relates to the technical field of network operation and maintenance, in particular to an automatic cluster deployment method and system based on an existing network.
Background
Anstable is an emerging automatic operation and maintenance tool, integrates the advantages of a plurality of operation and maintenance tools (puppet, chef, func, fabric) based on Python development, and achieves the functions of batch system configuration, batch program deployment, batch operation commands and the like. ansible was developed based on paramiko and based on modular work, itself, without the ability to deploy in bulk. What truly has a batch deployment is that an anstable is running, which merely provides a framework. The onsible does not need to install clients/agents on the remote host because they communicate with the remote host based on ssh.
Kubernetes (k 8s for short) is a container cluster management system of Google, which is open-sourced in 2014, and is developed by using Go language, and is used for managing containerized applications on multiple hosts in a cloud platform, and the goal of Kubernetes is to make the application for deploying containerization simple and efficient, and Kubernetes provides a set of functions of resource scheduling, deployment management, service discovery, capacity expansion and contraction, monitoring, maintenance, and the like, so as to strive to be a platform for automatic deployment, expansion and running of application containers across host clusters. It supports a range of container tools including Docker, etc.
How to realize the automatic deployment of k8s clusters and the migration and specification of the cluster deployment is a technical problem to be solved.
Disclosure of Invention
Aiming at the defects, the invention provides an automatic cluster deployment method and system based on an existing, which solve the technical problems of how to realize automatic deployment of k8s clusters and to realize transplanting and standardization of cluster deployment.
In a first aspect, the invention provides an ansable-based cluster automation deployment method, which deploys a k8s cluster meeting own requirements to a server through an ansblezi self-automation orchestration script based on an ansable automation operation and maintenance technology, and the method comprises the following steps:
installing an ansable environment and checking whether the ansable version environment is available;
configuring a host list in an allowable, and setting a machine IP address corresponding to each role;
configuring a role, including a role for system initialization, a role for installing a docker environment, a role for installing a storage system, and a role for installing a orchestration platform of Kubernetes;
configuring a playbook, wherein the playbook is a list consisting of one or more plays, the plays are matched for installing a Kubernetes container platform, and each play corresponds to at least one role;
pre-executing an analog script, and calling an analog predefined module to write a task corresponding to each role by using a pre-execution command before the analog script is executed;
and running an allowable script deployment cluster, and verifying a cluster function.
Preferably, when setting the machine IP address corresponding to each role, the machine IP address is deployed by packet planning.
Preferably, each role is configured with a file folder, a tasks folder, a templates folder and a vars folder, wherein the file folder is used for storing static files, the templates folder is used for storing writing template files, the vars folder is used for storing variables for setting operation, the tasks folder is used for storing one or more tasks executed by corresponding roles, and the task configuration files under the tasks folder need to follow an onsible script writing specification.
Preferably, when configuring a role, entering a role directory, creating a normalized role through an allowable-galaxy init command, and automatically generating and writing tasks needing automatic deployment by default file folders, tasks folders, templates folders and vars folders.
Preferably, when the playbook is configured, the deployed machine ip and the corresponding executed role are combined together through the ip resource list grouping, so that the corresponding task of each host node can be successfully executed.
In a second aspect, the invention provides an ansable-based cluster automation deployment system, which comprises an ansable environment installation module, a host list configuration module, a role configuration module, a playbook configuration module, a pre-execution module and an execution module;
the installation module of the stable environment is used for installing the stable environment and checking whether the stable version environment is available or not;
the host list configuration module is used for configuring a host list in the existing, and setting a machine IP address corresponding to each role;
the role configuration module is used for configuring roles, including a role for system initialization, a role for installing a docker environment, a role for installing a storage system and a role for installing a Kubernetes orchestration platform;
the playbook configuration module is used for configuring the playbook, the playbook is a list composed of one or more playbooks, the plurality of playbooks are matched for installing the Kubernetes container platform, and each playbook corresponds to at least one role;
the pre-execution module is used for pre-executing an analog script, and calling an analog predefined module to write a task corresponding to each role by using a pre-execution command before the analog script is executed;
the execution module is used for running an allowable script deployment cluster and verifying the cluster function.
Preferably, when the machine IP address corresponding to each role is set, the host list configuration module is configured to deploy the machine IP address through packet planning.
Preferably, each role is configured with a file folder, a tasks folder, a templates folder and a vars folder, wherein the file folder is used for storing static files, the templates folder is used for storing writing template files, the vars folder is used for storing variables for setting operation, the tasks folder is used for storing one or more tasks executed by corresponding roles, and the task configuration files under the tasks folder need to follow an onsible script writing specification.
Preferably, when configuring the role, the role configuration module is configured to perform the following: entering a role catalog, creating a normalized role through an allowable-gap init command, and automatically generating and writing tasks needing automatic deployment by default file folders, tasks folders, templates folders and vars folders.
Preferably, when configuring a playbook, the playbook configuration module is configured to combine the deployed machine ip with the corresponding executed role through the ip resource list packet, so as to implement that the corresponding task of each host node can be successfully executed.
The cluster automation deployment method and system based on the stable have the following advantages: the problems of low standardization and portability of cluster deployment and low efficiency of manually deploying clusters by operation and maintenance personnel are solved, an efficient automatic operation and maintenance technical tool is provided, and root causes can be quickly and accurately found after problems occur in the operation and maintenance process, so that active and quick processing is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
The invention is further described below with reference to the accompanying drawings.
Fig. 1 is a flow chart of an automatic cluster deployment method based on an existing table in embodiment 1.
Detailed Description
The invention will be further described with reference to the accompanying drawings and specific examples, so that those skilled in the art can better understand the invention and implement it, but the examples are not meant to limit the invention, and the technical features of the embodiments of the invention and the examples can be combined with each other without conflict.
The embodiment of the invention provides an automatic cluster deployment method and system based on an existing, which are used for solving the technical problems of how to realize automatic k8s cluster deployment and realizing the transplanting and specification of cluster deployment.
Example 1:
the invention discloses an anstable-based cluster automation deployment method which comprises six steps of installing an anstable environment, configuring a host list, configuring a role, configuring a playbook, pre-executing and executing.
Step S100 installs an allowable environment and checks whether an allowable version environment is available.
Step S200 configures a host list in the allowable, and sets a machine IP address corresponding to each role. Deployment machine ip addresses can be planned by grouping.
When the host list is configured, firstly, an existing environment is installed, an existing resource list file is modified, and the position of the resource list existing file can be checked in the per etc/existing.
Step S300 configures the role, including the role for system initialization, the role for installing a docker environment, the role for installing a storage system, and the role for installing a orchestration platform of Kubernetes.
As concrete implementation of configuring the role, entering a role catalog during configuration, creating normalized role through an allowable-galaxy init command, automatically generating file folders such as default files, tasks, templates, vars and the like, and writing tasks needing automatic deployment.
Step S400 configures a playbook, which is a list of one or more plays, the plurality of plays cooperating for installing the Kubernetes container platform, each play corresponding to at least one role.
The playbook uses yaml grammar format, is a list composed of one or more plays, and has the main functions of defining tasks and uniformly managing the tasks for a group, namely, organizing a plurality of palys in one playbook through a module of the task calling an active.
As a specific implementation of configuring a playbook, a deployed machine ip and a corresponding executed role are combined together through an ip resource list packet, so that corresponding tasks of each host node can be successfully executed.
Step S500 pre-executes an existing script, and calls an existing predefined module to write a task corresponding to each role by using a pre-execution command before the existing script is executed.
Step S600 runs an allowable script deployment cluster, and verifies the cluster function.
The method of the embodiment realizes the batch and standardized deployment of the Kubernetes clusters by introducing an analog automatic operation and maintenance tool. According to the method, the Kubernetes clusters meeting the requirements of the user can be built by modifying the configuration files such as playbook, role and the host list in the allowable according to the requirements, the deployment efficiency of operation and maintenance personnel is remarkably improved, the deployment cost is reduced, the problems of difficult migration and difficult standardization of cluster deployment are solved, and good technical conditions are created for application, popularization and popularization of micro-services.
Example 2:
the invention discloses an automatic cluster deployment system based on an existing, which comprises an existing environment installation module, a host list configuration module, a role configuration module, a playbook configuration module, a pre-execution module and an execution module, wherein the system can execute the method disclosed in the embodiment 1 to deploy a k8s cluster to a server.
The anstable environment installation module is used for installing an anstable environment and checking whether the anstable version environment is available.
The host list configuration module is used for configuring a host list in the existing and setting a machine IP address corresponding to each role.
When configuring the host list, the host list configuration module is configured to execute the following steps: the prior environment is installed, the inventory resource list file is modified, and the position of the resource list inventory file can be checked in the per etc/prior default file.
The role configuration module is used for configuring roles, including a role for system initialization, a role for installing a docker environment, a role for installing a storage system, and a role for installing a Kubernetes orchestration platform.
As a specific implementation of the role configuration module, the following is executed during configuration: entering a role catalog, creating normalized role through an allowable-gap init command, automatically generating folders such as default files, tasks, templates, vars and the like, and writing tasks needing automatic deployment.
The playbook configuration module is used for configuring the playbook, the playbook is a list composed of one or more playbooks, the plurality of playbooks are matched for installing the Kubernetes container platform, and each playbook corresponds to at least one role.
The playbook uses yaml grammar format, is a list composed of one or more plays, and has the main functions of defining tasks and uniformly managing the tasks for a group, namely, organizing a plurality of palys in one playbook through a module of the task calling an active.
As a specific implementation of the playbook configuration module, the module combines the deployed machine ip with the corresponding executed role through the ip resource list grouping, so that the corresponding task of each host node can be successfully executed.
The pre-execution module is used for pre-executing an analog script, and calling an analog predefined module to write a task corresponding to each role by using a pre-execution command before the analog script is executed.
The execution module is used for running an allowable script deployment cluster and verifying the cluster function.
The system of the embodiment is based on an automatic operation and maintenance technology of an existing network, and k8s clusters meeting the requirements of the existing network are deployed to a server through automatic arrangement of scripts of the existing network.
While the invention has been illustrated and described in detail in the drawings and in the preferred embodiments, the invention is not limited to the disclosed embodiments, but it will be apparent to those skilled in the art that many more embodiments of the invention can be made by combining the means of the various embodiments described above and still fall within the scope of the invention.

Claims (10)

1. The cluster automation deployment method based on the inherent is characterized in that k8s clusters meeting the self requirements are deployed to a server through the inherent automation arrangement script of the inherent based on the inherent automation operation and maintenance technology, and the method comprises the following steps:
installing an ansable environment and checking whether the ansable version environment is available;
configuring a host list in an allowable, and setting a machine IP address corresponding to each role;
configuring a role, including a role for system initialization, a role for installing a docker environment, a role for installing a storage system, and a role for installing a orchestration platform of Kubernetes;
configuring a playbook, wherein the playbook is a list consisting of one or more plays, the plays are matched for installing a Kubernetes container platform, and each play corresponds to at least one role;
pre-executing an analog script, and calling an analog predefined module to write a task corresponding to each role by using a pre-execution command before the analog script is executed;
and running an allowable script deployment cluster, and verifying a cluster function.
2. The method for automated deployment of an ansable-based cluster of claim 1 wherein the machine IP address is deployed by packet planning when setting the machine IP address corresponding to each role.
3. The method for automatically deploying an existing cluster according to claim 1 or 2, wherein each role is configured with a files folder, a tasks folder, a templates folder and a vars folder, the files folder is used for storing static files, the templates folder is used for storing writing template files, the vars folder is used for storing variables for setting running, the tasks folder is used for storing one or more tasks executed by corresponding roles, and the task configuration files under the tasks folder need to conform to the existing script writing specification.
4. The method for automatically deploying clusters based on an existing table according to claim 3, wherein when configuring a role, entering a role directory, creating a normalized role through an existing table-galaxy init command, and automatically generating and writing tasks requiring automatic deployment by default files folder, tasks folder, templates folder and vars folder.
5. The method for automatically deploying an ansable-based cluster according to claim 3 wherein, when a playbook is configured, a deployed machine ip is combined with a corresponding executed role through an ip resource list group, so that corresponding tasks of each host node can be successfully executed.
6. The cluster automation deployment system based on the inherent is characterized by comprising an inherent environment installation module, a host list configuration module, a role configuration module, a playbook configuration module, a pre-execution module and an execution module;
the installation module of the stable environment is used for installing the stable environment and checking whether the stable version environment is available or not;
the host list configuration module is used for configuring a host list in the existing, and setting a machine IP address corresponding to each role;
the role configuration module is used for configuring roles, including a role for system initialization, a role for installing a docker environment, a role for installing a storage system and a role for installing a Kubernetes orchestration platform;
the playbook configuration module is used for configuring the playbook, the playbook is a list composed of one or more playbooks, the plurality of playbooks are matched for installing the Kubernetes container platform, and each playbook corresponds to at least one role;
the pre-execution module is used for pre-executing an analog script, and calling an analog predefined module to write a task corresponding to each role by using a pre-execution command before the analog script is executed;
the execution module is used for running an allowable script deployment cluster and verifying the cluster function.
7. The anstable-based cluster automation deployment system of claim 6 wherein the host inventory configuration module is configured to deploy machine IP addresses by packet planning when setting the machine IP address corresponding to each role.
8. The automated cluster deployment system of claim 6 or 7, wherein each role is configured with a files folder, a tasks folder, a templates folder, and a vars folder, the files folder is used for storing static files, the templates folder is used for storing writing template files, the vars folder is used for storing variables for setting operation, the tasks folder is used for storing one or more tasks executed by corresponding roles, and the task configuration files under the tasks folder are required to conform to an existing script writing specification.
9. The ansible-based cluster automation deployment system of claim 8 wherein, when configuring role, the role configuration module is to perform the following: entering a role catalog, creating a normalized role through an allowable-gap init command, and automatically generating and writing tasks needing automatic deployment by default file folders, tasks folders, templates folders and vars folders.
10. The anstable-based cluster automation deployment system of claim 8 wherein, when configuring a playbook, the playbook configuration module is configured to combine a deployed machine ip with a corresponding executed role by an ip resource inventory packet, so that corresponding tasks of each host node can be successfully executed.
CN202311399283.7A 2023-10-26 2023-10-26 Cluster automation deployment method and system based on ansable Pending CN117560281A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311399283.7A CN117560281A (en) 2023-10-26 2023-10-26 Cluster automation deployment method and system based on ansable

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311399283.7A CN117560281A (en) 2023-10-26 2023-10-26 Cluster automation deployment method and system based on ansable

Publications (1)

Publication Number Publication Date
CN117560281A true CN117560281A (en) 2024-02-13

Family

ID=89819442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311399283.7A Pending CN117560281A (en) 2023-10-26 2023-10-26 Cluster automation deployment method and system based on ansable

Country Status (1)

Country Link
CN (1) CN117560281A (en)

Similar Documents

Publication Publication Date Title
CN110851145B (en) Container arrangement-based edge cloud installation and maintenance method and system
CN107566165B (en) Method and system for discovering and deploying available resources of power cloud data center
CN112084008B (en) Method for rapidly deploying cloud pipe system based on container technology
CN101789886B (en) Environment setup automation system of distribution type environment and method
US20100325624A1 (en) Method and System for Application Portability
CN111682973B (en) Method and system for arranging edge cloud
CN110888657B (en) Method for deploying microservice based on Groovy template engine
CN111475260A (en) Flexible CICD method based on jenkins and kubernets platform
CN112328361A (en) Method for rapidly deploying kubenetes cluster
CN111367618A (en) Code management method, system, terminal and medium based on docker
CN113779477A (en) Assembly line publishing method and system based on PaaS cloud platform
CN111880738A (en) Method for automatically creating and mounting LVM (logical volume manager) volume in K8s environment
CN114237632A (en) Hybrid cloud automatic operation and maintenance release system and operation method thereof
CN102567050B (en) The method and apparatus of B/S system remote deploying projects
CN116450153B (en) Rapid deployment method for containerized simulation platform
CN117560281A (en) Cluster automation deployment method and system based on ansable
US9207928B2 (en) Computer-readable medium, apparatus, and methods of automatic capability installation
CN115421847A (en) Management method and equipment for research, development, operation and maintenance platform and CICD (common information carrier) assembly line supporting multiple engines
CN110162312A (en) A kind of BeeGFS configuration method and device based on IML
CN112685051A (en) Method, device, platform and storage medium for automatically executing shell script
CN113031977A (en) Software batch installation method and related device
KR102553084B1 (en) Edge cloud building system and method for high-speed installation of components
CN114327513B (en) Method and system for automatically deploying software and electronic equipment
KR102560827B1 (en) Edge cloud building system and method for user-interface based design
KR20240006299A (en) Self-managed cloud data center and control method thereof

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