Giter VIP home page Giter VIP logo

gitops-repo-example's Introduction

Sample GitOps Repo

Introduction

The given sample GitOps repo is an indication of the capability of the GitOps tool, the given repo structure constituting the entire GitOps configuration can be created by running a couple of day-1 and day-2 commands. A high level structure of the GitOps repo constitutes the config, environments folder and the pipelines.yaml file. This git repo is generated by kam CLI tool. It is for illustration purposes only. To create your GitOps repository, use kam CLI instead.

Important Note:

This repository cannot be applied to the cluster since the sealed secrets are encrypted with the private key in the cluster at the time the repository was created.

Pipelines.yaml

config:
  argocd:
    namespace: openshift-gitops
  pipelines:
    name: cicd
environments:
- apps:
  - name: app-taxi
    services:
    - name: taxi
      pipelines:
        integration:
          bindings:
          - dev-app-taxi-taxi-binding
          - github-push-binding
      source_url: https://github.com/<your organization>/taxi.git
      webhook:
        secret:
          name: webhook-secret-dev-taxi
          namespace: cicd
  name: dev
  pipelines:
    integration:
      bindings:
      - github-push-binding
      template: app-ci-template
- apps:
  - name: app-bus
    services:
    - name: bus
      pipelines:
        integration:
          bindings:
          - stage-app-bus-bus-binding
          - github-push-binding
      source_url: https://github.com/<your organization>/bus.git
      webhook:
        secret:
          name: webhook-secret-stage-bus
          namespace: cicd
  name: stage
  pipelines:
    integration:
      bindings:
      - github-push-binding
      template: app-ci-template
gitops_url: https://github.com/<your organization>/gitops.git
version: 1

The pipelines.yaml is a representation of the current directory structure, it throws light on the essential bits of the GitOps repo. The current GitOps repo structure can be broken down based on the pipelines.yaml file.

High level directory structure

├── config
│   ├── argocd
│   │   ├── argo-app.yaml
│   │   ├── cicd-app.yaml
│   │   ├── dev-app-taxi-app.yaml
│   │   ├── dev-env-app.yaml
│   │   ├── kustomization.yaml
│   │   ├── stage-app-bus-app.yaml
│   │   └── stage-env-app.yaml
│   └── cicd
│       ├── base
│       │   ├── 01-namespaces
│       │   │   └── cicd-environment.yaml
│       │   ├── 02-rolebindings
│       │   │   ├── argocd-admin.yaml
│       │   │   ├── internal-registry-cicd-binding.yaml
│       │   │   ├── pipeline-service-account.yaml
│       │   │   ├── pipeline-service-rolebinding.yaml
│       │   │   ├── pipeline-service-role.yaml
│       │   │   └── sealed-secrets-aggregate-to-admin.yaml
│       │   ├── 03-secrets
│       │   │   ├── docker-config.yaml
│       │   │   ├── git-host-basic-auth-token.yaml
│       │   │   ├── gitops-webhook-secret.yaml
│       │   │   ├── webhook-secret-dev-taxi.yaml
│       │   │   └── webhook-secret-stage-bus.yaml
│       │   ├── 04-tasks
│       │   │   └── deploy-from-source-task.yaml
│       │   ├── 05-pipelines
│       │   │   ├── app-ci-pipeline.yaml
│       │   │   └── ci-dryrun-from-push-pipeline.yaml
│       │   ├── 06-bindings
│       │   │   ├── dev-app-taxi-taxi-binding.yaml
│       │   │   ├── github-push-binding.yaml
│       │   │   └── stage-app-bus-bus-binding.yaml
│       │   ├── 07-templates
│       │   │   ├── app-ci-build-from-push-template.yaml
│       │   │   └── ci-dryrun-from-push-template.yaml
│       │   ├── 08-eventlisteners
│       │   │   └── cicd-event-listener.yaml
│       │   ├── 09-routes
│       │   │   └── gitops-webhook-event-listener.yaml
│       │   └── kustomization.yaml
│       └── overlays
│           └── kustomization.yaml
├── environments
│   ├── dev
│   │   ├── apps
│   │   │   └── app-taxi
│   │   │       ├── base
│   │   │       │   └── kustomization.yaml
│   │   │       ├── kustomization.yaml
│   │   │       ├── overlays
│   │   │       │   └── kustomization.yaml
│   │   │       └── services
│   │   │           └── taxi
│   │   │               ├── base
│   │   │               │   ├── config
│   │   │               │   │   ├── 100-deployment.yaml
│   │   │               │   │   ├── 200-service.yaml
│   │   │               │   │   ├── 300-route.yaml
│   │   │               │   │   └── kustomization.yaml
│   │   │               │   └── kustomization.yaml
│   │   │               ├── kustomization.yaml
│   │   │               └── overlays
│   │   │                   └── kustomization.yaml
│   │   └── env
│   │       ├── base
│   │       │   ├── argocd-admin.yaml
│   │       │   ├── dev-environment.yaml
│   │       │   ├── dev-rolebinding.yaml
│   │       │   └── kustomization.yaml
│   │       └── overlays
│   │           └── kustomization.yaml
│   └── stage
│       ├── apps
│       │   └── app-bus
│       │       ├── base
│       │       │   └── kustomization.yaml
│       │       ├── kustomization.yaml
│       │       ├── overlays
│       │       │   └── kustomization.yaml
│       │       └── services
│       │           └── bus
│       │               ├── base
│       │               │   ├── config
│       │               │   └── kustomization.yaml
│       │               ├── kustomization.yaml
│       │               └── overlays
│       │                   └── kustomization.yaml
│       └── env
│           ├── base
│           │   ├── argocd-admin.yaml
│           │   ├── kustomization.yaml
│           │   ├── stage-environment.yaml
│           │   └── stage-rolebinding.yaml
│           └── overlays
│               └── kustomization.yaml
└── pipelines.yaml

gitops-repo-example's People

Contributors

bigkevmcd avatar gaganhegde avatar ishitasequeira avatar wtam2018 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.