Infrastructure as Code (Infrastructure as Code)

Infrastructure as Code

Hardware resources are the basis of service, we need to deploy with the code in vm (openstack cluster, ECS, aws or google cloud), these resources need to focus on management, it is part of our resources and what assets. At the same time the need to support cross-platform, such as Ali cloud, Tencent cloud, aws and so on.

Infrastructure codes, this in 2014 to put forward, this concept is not just automation, automation we have Salt, Puppet, but these are not enough.

As a best practice, infrastructure-as-code mandates that whatever work is needed to provision computing resources it must be done via code only. 作为最佳实践,基础设施及代码授权所有准备计算资源所需要做的工作都可以通过代码来完成 

Computing resources, including computing, storage, network, database, etc., which means we do not need to click on the deployment, but the following manner:

  1. To define the resources required by a specific format, json or other layout languages
  2. Stored in code control system
  3. pull, test
  4. Executing code to deploy

Such platforms are more like Terraform, Chef, Puppet Ansible, CloudFormation, Salt and so on. Terraform is currently more popular, cross-platform support, of course, also possible to select another.

The traditional idea is that, Terraform or cloudFormation and other platforms to provide physical resources, and then use the ansible or saltstack to configure and deploy. But we do not actually need so, ansilbe do, terraform can do.

Irreversible deployment

Our current practice is to deploy a separate server and code, but now the trend is bound code and vm, or containers have been included in the code as a whole is to deploy it, so there would be no environmental problems.

If you need to modify the parameters without modifying the original vm or docker, but modifying the configuration package, and then directly deploy a new vm or docker.

Benefits of doing so is only a configuration is not required to deploy a test environment, development environment configuration once, is a kind of online environment, saving manpower.

If you want to view the log, of course, do not need to log in to view the server, the server can be configured on the response of the logging component to upload logs to a centralized log center, unified management, convenient elk and other analysis after treatment. aws elk deployment reference

Guess you like

Origin www.cnblogs.com/wwh/p/11595636.html