GithubHelp home page GithubHelp logo

svastikkka / config-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 134 KB

This tool facilitates the management of configuration changes on bare-metal infrastructure.

Home Page: https://www.svastikkka.com/

Dockerfile 36.21% Groovy 63.79%
ansible config-server groovy jenkins ssh-pass

config-server's Introduction

Config Server

This tool facilitates the management of configuration changes on bare-metal infrastructure.

All changes to our infra should come through pull requests to this repo.

Prerequisite

  • Docker
  • Docker compose
  • openjdk-17-jdk (for slave as Jenkins runs on java)

Need for Config Server

Config Server provides several benefits in software development and system architecture. Here are some key advantages:

  1. Centralized Configuration Management:

    • Simplified Updates: Centralized configuration makes it easier to update and manage configurations, as changes can be made in one place and propagated to all connected services.
  2. Versioned Configuration:

    • Auditing and History: Config Server often support versioning of configurations, providing an audit trail and history of changes. This can be valuable for debugging, troubleshooting, and understanding the evolution of configurations over time.
  3. Security and Access Control:

    • Access Control: Config Server can enforce access controls, ensuring that only authorized individuals or systems can modify or retrieve sensitive configuration information.
  4. Ease of Troubleshooting:

    • Centralized Logging: With a centralized configuration server, it's easier to log and monitor configuration changes. This aids in troubleshooting issues related to misconfigurations or unexpected behavior.

In summary, Config Server simplifies configuration management, enhances flexibility, and contributes to better control and security in distributed and dynamic software systems.

It also becomes a single source of truth for our infrastructure enhnacing visibility.

How to use this repo?

Whenever We want to update or add the configuration deployed service on any server we have to raise MR. While creating a MR there are few things need to commited/checked before raising a MR.

Following are the things

  1. We need to check that the service name is added in PATH.json file. If not we need to add it.
  2. Update the configuration of service for correct server folder. Example we want to update nginx.conf (nginx configuration) for 192.168.0.211 comp/server.
  3. Whenever we add a new configuration of a service in PATH.json. we should follow below structure
{
    "configurationFileName": {
      "path": "PATH OF configurationFileName present in remote server",
      "service": "Service Name Deployed On Remote Comp",
      "enable": "true: To auto restart service whenever we reboot." // Default is false
    }
}

Example

{
   "nginx.conf": {
      "path": "/etc/nginx/nginx.conf", // "PATH OF configurationFileName present in remote server 
      "service": "nginx", // Service Name Deployed On Remote Comp
      "enable": "false" // true: To auto restart service whenever we reboot.
   }
}
  1. We are now ready to raise an MR now.

Limitations

  • File deletions is not handled and ignored.

Components

  • Jenkins is used for ci/cd
  • Jenkins has vault integrated (done via UI) and Vault stores all the ssh user credentials

Installation Setup (one time for deployment)

Step 1 Required: Clone this repository using git.

git clone https://github.com/Svastikkka/CONFIG-SERVER.git

Step 2 Required: Go inside the repository

cd ./CONFIG-SERVER

Step 3 Required: Run the below command to initialize intial setup (If we are initializing without any previous/existing data)

docker compose up -d

Step 4 Optional: Run the below command to initialize intial setup (If we are initializing with any previous/existing data)

Step 4.1 Restore backups in below directories

  • jenkins_home (need to create it manually)
  • vault (need to create it manually)

Step 4.2 Run the below command to start Jenkins and Vault

docker compose up -d

Step 5 Required: Check services are UP

Step 5.1 Check Vault is UP by going on the following URL: http://COMP_PRIVATE_IP:8200. We should able to see its UI

Step 5.2 Check Jenkins is UP by going on the following URL: http://COMP_PRIVATE_IP:8080. We should able to see its UI

Step 6 Required: Configure Jenkins to install default Plugins.

Reference: We can go through following video to understand How to Install Jenkins on Ubuntu Linux

Step 7 Required: Unseal Vault

We can refer this doc: Vault Unseal

Step 8 Required: Enable approle in vault

We can refer this doc: Vault AppRole

Step 9 Required: Enable KV in vault

We can refer this doc: Vault KV

Step 10 Required: Install Required Plugins in Jenkins

  1. Pipeline Utility Steps
  2. Vault Plugin
  3. Gitlab

Reference: How to Install Jenkins Plugins

Reference: Managing Plugins

Step 11 Required: Integrate Jenkins with Vault

Navigate to manage Jenkins and Configure system. and find the vault plugin and fill the URL and then click on add the credentilas to add the approle authentication and select kind as Vault AppRole Credentials and fill out the role ID, Secret ID, path and ID as generic name to identify and click on Add.

Note: On advance settings disable the ssl certfication.

Reference How to Integrate HashiCorp Vault With Jenkins

Step 12 Create a Job Try to create a Job Config Server with type pipeline and add Config Server repository URL and Trigger it manually.

Reference

config-server's People

Contributors

svastikkka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.