Giter VIP home page Giter VIP logo

jump-app-gitops's Introduction

Jump App Gitops

Introduction

Jump App GitOps is one of a set of repositories developed to generate a microservice based application, named Jump App. This repository includes an automated way of deploy Jump App's microservices and all stuff around this application (Deployments, Services, Build Configs, Pipelines, etc), including optionally CI/CD or Service Mesh objects as well.

As probably known, this automated "tool" is based on helm and tries to integrate the following solutions:

  • Red Hat Openshift Container Platform 4 (*Kubernetes)
  • Multi programing language microservices (Javascript, Golang, Python and Java)
  • GitOps solution, based on ArgoCD.
  • CI/CD strategy, based Tekton.
  • Service Mesh architecture, based on Istio.

This repository was created to include all automated procedures to achieve the following goals:

  • Create required namespaces in Kubernetes (gitops-argocd, istio-system, jump-app-cicd, jump-app-dev, jump-app-pre and jump-app-pro)
  • Install required ArgoCD objects (ArgoCD Server, Route, Rolebindings and Applications)
  • Deploy CI/CD objects in jump-app-cicd namespace (Imagestreams, BuildConfigs, Tekton Pipelines, etc)
  • Deploy Jump App's microservices in each environment/namespace
  • Create Service Mesh objects when Istio support is enabled.

NOTE: It is important to know that it is possible to activate/deactivate features through variable enabled defined for each sub-chart in the global values.yaml file.

Requisites

In order to start working with this repository, it is required:

  • A Red Hat Openshift Container Platform Cluster +4.5
  • ArgoCD Operator installed
  • Red Hat Openshift Pipelines Operator installed
  • Helm client installed in the local machine (Please follow https://helm.sh/docs/intro/install/ for more information)

Optional requirements when Service Mesh is activated:

  • Red Hat Openshift Service Mesh Operator installed
  • Kiali Operator installed provided by Red Hat
  • Red Hat Openshift Jaeger Operator installed
  • Service Mesh Control Plane Object with default gateways configured (Please, find object examples in examples folder)
  • Service Mesh Member Roll Object configured (Please, find object examples in examples folder)

IMPORTANT: Quick Start section (setup.sh script) include the procedure to install the previous requirements automatically with the exception of Red Hat Openshift Container Platform Cluster +4.5 and Helm in your local machine.

Multi Branch

This repository has a set of branches in order to manage different environments configuration files in ArgoCD. If you want to modify default values, it is required access to the specific branch, modify values.yaml file and push the file to the git repository.

  • feature/jump-app-cicd -> Tekton chart with CI/CD configuration
  • feature/jump-app-dev -> Jump App chart with DEV environment configuration
  • feature/jump-app-pre -> Jump App chart with PRE environment configuration
  • feature/jump-app-pro -> Jump App chart with PRO environment configuration

Quick Start

Jump App architecture contains three environments (dev, pre and pro) where the application is deployed automatically. If the priority is making use of this solution with three environments and not waste any time, the following procedure install Jump App and configure CI/CD and GitOps solutions automatically:

  • Openshift login
oc login -u <user> -p <pass> <ocp_cluster_console>
  • Download submodules
git submodule update --remote
  • Modify appsDomain parameter (*When it is required)
sh scripts/extra/update_charts_domain.sh apps.mydomain.com 
  • Execute setup.sh script for installing Operator
oc login
sh ./scripts/setup.sh

NOTE: It is possible to deploy Red Hat Service Mesh solution passing the following parameter to setup.sh script:

sh ./scripts/setup.sh --servicemesh

NOTE: It is possible to deploy Red Hat Serverless solution passing the following parameter to setup.sh script:

sh ./scripts/setup.sh --serverless

NOTE: It is possible to deploy Red Hat Serverless and Red Hat Service Mesh solutions passing the following parameter to setup.sh script:

sh ./scripts/setup.sh --serverless --servicemesh

IMPORTANT: By default, some namespaces will be created (gitops-argocd, istio-system, jump-app-cicd, jump-app-dev, jump-app-pre and jump-app-pro). If it is required to modify their names, take special attention to modify associated variables and define the new names correctly.

Custom Installation

When it is required to modify Jump App installation in order to customize the number of environments, for example, it is required to modify ./scripts/files/values-argocd.yaml file in order to specify these requirements.

E.g. Deploy ArgoCD and CI/CD elements

vi scripts/files/values-argocd.yaml

##
# Jump App ArgoCD Chart values
##

# Helm Repo GIT
helmRepoUrl: https://github.com/acidonper/jump-app-gitops.git

# ArgoCD apps definition
apps:
  jump-app-cicd:
    branch: feature/jump-app-cicd 
    enabled: true
  jump-app-pro:
    branch: feature/jump-app-pro
    enabled: false
  jump-app-pre:
    branch: feature/jump-app-pre
    enabled: false
  jump-app-dev:
    branch: feature/jump-app-dev 
    enabled: false
...
oc login
sh ./scripts/setup.sh

E.g. Deploy ArgoCD, CI/CD elements and DEV environment

vi scripts/files/values-argocd.yaml

##
# Jump App ArgoCD Chart values
##

# Helm Repo GIT
helmRepoUrl: https://github.com/acidonper/jump-app-gitops.git

# ArgoCD apps definition
apps:
  jump-app-cicd:
    branch: feature/jump-app-cicd 
    enabled: true
  jump-app-pro:
    branch: feature/jump-app-pro
    enabled: false
  jump-app-pre:
    branch: feature/jump-app-pre
    enabled: false
  jump-app-dev:
    branch: feature/jump-app-dev 
    enabled: true
...
oc login
sh ./scripts/setup.sh

Local CRC Installation (CodeReady Containers)

CodeReady Containers brings a minimal, preconfigured OpenShift cluster to your local laptop or desktop computer for development and testing purposes. CodeReady Containers supports native hypervisors for Linux, macOS, and Windows 10. You can download CodeReady Containers from the Red Hat CodeReady Containers product page.

Jump App architecture could be deployed in CRC using the following procedure:

  • Openshift login
oc login -u <user> -p <pass> <ocp_cluster_console>
  • Download submodules
git clone --recursive https://github.com/acidonper/jump-app-gitops.git
  • Execute setup.sh script for installing Operator
oc login
sh ./scripts/setup_crc.sh

NOTE: It is important to bear in mind that Jump App CRC deployment configuration is located in scripts/files/values-argocd.yaml and ArgoCD is using crc-cicd and cicd branches to deploy Jump App CI/CD solution and a single environment respectively.

ArgoCD

Access Console

Once ArgoCD Server is installed, it is possible access ArgoCD Web UI follow next procedure:

  • Obtain admin password and ArgoCD Server URL
oc login
oc get secret argocd-cluster -o jsonpath='{.data.admin\.password}' -n gitops-argocd | base64 -d
oc get route argocd-server -n gitops-argocd
argocd-gitops-argocd.apps.<mydomain>

ArgoCD CLI

  • Auth ArgoCD Server using CLI
oc port-forward service/argocd-server 8888:443
argocd login 127.0.0.1:8888 --username admin --password xxxx
  • List ArgoCD Apps
argocd app list
  • Sync ArgoCD Apps current state
argocd app sync jump-app-dev

Charts Tests

Jump App ArgoCD

helm template ./charts/jump-app-argocd -f examples/local/values-jump-app-argocd.yaml --debug --namespace gitops-argocd

Jump App CI/CD

helm template ./charts/jump-app-cicd -f examples/local/values-jump-app-cicd.yaml --namespace jump-app-cicd

Jump App

  • DEV
helm template ./charts/jump-app-micros -f examples/local/values-jump-app-dev.yaml --namespace jump-app-dev

Author Information

Asier Cidon

[email protected]

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.