Giter VIP home page Giter VIP logo

gitops-apps's Introduction

Gitops Apps

Gitops driven apps deployment with ArgoCD to k8s using Helm charts.

Environments

Environments are managed in separate branches of this repository, one branch per environment. All environments must be kept in parity in terms of applications, common configuration and versions.

Name Codename EKS name Audience Availability Data Persistence Data Backups
Development dev dev-wgt7 devops, developers n/a ephemeral no
Staging stg stg-m4n4 developers as users 90% ephemeral no
Production prd prd-0e9c general public users 99.5% ephemeral yes (TBD policy)

Development

Development environment should be used only for testing purposes of deployment and integration, for example during chart creation or configuration changes. There is no availability guaranteed - the environment can get down at anytime for any period of time.

Staging

Staging environment can be used to showcase development changes and progress to other developers/internals, for example PR review deployments. However, deployments in this environment should not be shared to users/externals. The availability of the environment is low and it can get down anytime, no planned downtime windows.

Production

As the name implies this is user facing environment with strong availability and planned downtime windows announced in advance. The availability of the environment shall be kept as high as possible.

Persistence

This k9s cluster setup provides only ephemeral data persistence, that is Persistent Volumes can be used but only for the lifespan of the given cluster. If for some reason an environment cluster needs to be re-created for whatever reason all data would be lost.

Thus, it is mandatory to use external storage services like: S3, RDS, OpenSearch, ElastiCache, etc.

Promotion

It is mandatory to keep the promotion path as dev -> stg -> prd. This essentially means that each change start in the dev branch and gets promoted forward to prd. During promotion all changes are overwritten except environment specific configuration in the corresponding value files. This of course exclude environment specific configuration (values files) and it can be changed directly into the corresponding branch.

Chart Scaffold

To deploy a new application to the cluster one needs to create a Helm Chart that extends the base chart.

There is a little script that can do the scaffolding ($APP replacement) explained below for you given an application name:

./scripts/scaffold.sh myapp
  1. Start by copying the scaffold chart assuming application name being myapp. Skip this step if you run the scaffold script:
    export APP=myapp
    cp -r scaffold $APP
  2. Open myapp/values.yaml and adjust the configuration:
    1. Replace occurrence of $APP with your application name, i.e. myapp.
    2. Adjust the repository name. If the image name is the same as the chart name (myapp) it can be omitted.
    3. Adjust the secrets. Ask a devops team member to create a secret for you. If your app does not need any secrets: the section can be omitted.
    4. Adjust the service port. If it's 80 (the default), it can be omitted.
    5. Adjust the versions. If the application requires multiple version to be deployed simultaneously list all of them. If only a single version is needed omit the section and adjust the image.tag
    6. Adjust the Ingress. If your app does not need incoming external traffic, omit the section (it's disabled by default)
  3. Open myapp/values-dev.yaml and adjust the configuration:
    1. Replace occurrence of $APP with your application name, i.e. myapp.
    2. Adjust the secrets. Set the correct EKS name as remove prefix. If the application does not need secrets omit the section.
    3. Adjust the ingress. If the application does not need incoming external traffic, omit the section.
      1. Adjust the stripPrefix. If the application have multiple version deployed behind multiple paths, adjust the stripPrefix to drop the prefix when the requests are routed.
      2. Adjust the hosts. If the application is deployed on multiple domains list them and adjust the corresponding paths.
      3. Adjust the paths. Each path can be routed to different application version. If the application deploys a single version, the version key for paths can be omitted.
      4. Adjust TLS. List all hosts used in the hosts configuration above and set a unique secretName
  4. Open myapp/values-stg.yaml and adjust the configuration using the same steps as above.
  5. Open myapp/values-prd.yaml and adjust the configuration using the same steps as above.

gitops-apps's People

Contributors

dincho avatar michalbagrowski avatar mmpetarpeshev 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.