GithubHelp home page GithubHelp logo

cloudopsworks / environment-template-eks Goto Github PK

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

EKS Environment template for CD pipelining though Github Actions

License: Apache License 2.0

Makefile 55.01% HCL 44.99%

environment-template-eks's Introduction

environment-template-eks

EKS Environment template for CD pipelining though Github Actions

Table of Contents

  1. How-To
    1. Promotion
    2. Branch Creation for Configuration changes
  2. Initial Setup
    1. Configuring Backend
    2. Environment Variables for deployment automation
    3. Create OWNERS file
  3. Promotions / Pull Request Approval Process
    1. 1st Step
    2. Approvals
  4. Pull Request 2nd Day
    1. Configuration Changes

How-To

Promotion:

Promotion process starts with creating an issue on APP Repository and issue the following comment:

/promote version=<version number> env=<this environment suffix> {tracking_d=CUSTOM TRACKING ID}

Version suffix stands for the name after environment-<organization>- on this repository name.

Branch Creation for Configuration changes

This will create a new Branch with following naming:

  • config-< declarative branch name >
  • Run Following command on the new branch
make config
  • Do all configuration changes on ./values/

  • Commit changes to the branch and push to repository

  • Create a new pull request in order to start the deployment, depending if automatic or not will merge the PR to Master branch.

Initial Setup

Configuring Backend

First step is to configure the backend configuration for the environment this is done copying the following file: backend.tf_template as backend.tf there is a asample configuration for S3 backend where it can be done but you can select whatever backend suits for the case.
Documentation about Terraform Backends can be found here.

Environment Variables for deployment automation

The second point is to configure the environment variables to setup this environment and maintain the deployment pipeline.

First step is to run the following command:

make init

Create OWNERS file

This file is require to configure the automation workflow you have to copy current OWNERS_template to `OWNERS

  • For this kind of repository you must have the following set:
    automatic: false
  • Branch protection is set as default for this kind of repository:
    branchProtection: true
    Branch will be protected automatically in order to preserve consistency on master branch.
  • Protected sources are set as default but can be expanded:
    protectedSources:
    - "*.tf"
    - "*.tfvars"
    - OWNERS
    - Makefile
    - .github
    Any changes on these files will fail the checks and invalidate the merge of the pull request.
  • Adjust the number of required reviewers, remember that the approvals should fulfill the number selected here, the entry is required.
    requiredReviewers: 2
  • Next you have to configure the valid reviewers/approvers on the workflow the entry is required, the users listed are the GitHub Ids.
    reviewers:
      - user1
      - user2
      - user3
  • When branch protection is enabled, you can configure the owners that can bypass the protection rules: the entry is required and the users are listed as GitHub Ids, teams can be specified by org/team-name.
    owners:
      - user1
      - user2
      - user3
      - org1/team1
  • You can setup forefront the contributors list and their role with the repository. This automates the way roles are assigned to the repo. It is preferred to have list of groups instead of users. To leave a role empty just indicate the empty list [].
    contributors:
    admin:
      - org1/admins1
    triage: []
    read: []
    write:
      - org1/devs1
    maintain: []
  • Push changes to Master ...
  • Proceed with Promotion Process.

Promotions / Pull Request Approval Process

1st step

  • After successful processing of workflow, you will obtain the enabled URLS and environment in the comments of the Pull Request.
  • All Checks Must be green in order to proceed with the promotion.

Approvals

  • Requirement:
    • Access to the GitHub Repository via Web https://github.com
    • CLI (gh) installed and configured to proceed to the approval.
  • With UI proceed this way:
    • Perform the Review of the Pull Request, clicking on the banner on the top of the Pull Request
    • In the Review section, select the Approve option, and write /approved in the comment section.
  • With the CLI Run the following commands
    • Approve the Pull Request
      gh pr review <PR#> --approved
    • Comment the Pull request with /approved to evaluate merge
      gh pr comment <PR#> --body "/approved"

Pull Request 2nd Day

On each values changes, push into the branch and create a pull request against master branch.~~~~

Configuration changes

  • Do all configuration changes on ./values/
  • Commit changes to the branch and push to repository

environment-template-eks's People

Contributors

berahac 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.