GithubHelp home page GithubHelp logo

argocd-applicationset-demo's Introduction

ArgoCD ApplicationSet Demo

Kubernets Helm Argo

This repository contains the examples and demos explained in the article How to create ArgoCD Applications Automatically using ApplicationSet? “Automation of the Gitops”



Prerequisites

Kubernetes Cluster

To be able to run the examples and demos in this repository you need to have a running Kubernetes cluster with argocd namespace

you can install minikube locally if you don't have a cluster check here

you can also use a 2 nodes cluter using vagrant boxes check this Github repo

ArgoCD Installation

you need to have argocd installed on your cluster in argocd namespace

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

or check the documentation

ArgoCD ApplicationSet Installation

you need to install ApplicationSet alongside with argocd, some examples in this repository need a version > 0.3 make sure to use the latest image in your ApplicationSet Deployment

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/applicationset/master/manifests/install.yaml

or check the documentation

Add Repository to ArgoCD

ArgoCD needs access to this repository to be able to apply the demo examples, you can add this repository by applying the below manifest file on your argocd namepace

apiVersion: v1
kind: Secret
metadata:
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repository
  annotations:
    managed-by: argocd.argoproj.io
data:
  project: ZGVmYXVsdA==
  type: Z2l0
  url: >-
    aHR0cHM6Ly9naXRodWIuY29tL0FtckFsYWFZYXNzZW4vQXJnb0NELUFwcGxpY2F0aW9uU2V0LURlbW8uZ2l0
type: Opaque

List Generator

in this example we use ApplicationSet list generator to create same application to different destination (namespaces in our case) we have 3 different namespaces that need to be created as prerequisite to argo to be able to deploy those applications, namespaces are

  • uat
  • dev
  • test

defined in the destination section in the application template section of the ApplicationSet manifest

destination:
  # default cluster as destination, you can define multiple clusters in ArgoCD UI
  server: https://kubernetes.default.svc
  # will deploy to different namespaces as different destinations
  namespace: '{{namespace}}'

Git Directory

in this example we install a list of argo projects each project will be deployed on a specific namespace named with the tool name

  • argo-image-upater will be deployed on argo-image-updater namespace
  • argo-rollouts will be deployed on argo-rollouts namespace
  • argo-workflows will be deployed on argo-workflows namespace

Demo

in this example we getting more advanced using Git Directory generator we have a directory tree like the one below

           ├── app-hulk ────├── prod
           │                ├── qa
           │                ├── staging
           │
├── configs├── app-iron ────├── prod
│          │                ├── qa
│          │                ├── staging
│          │
│          ├── app-spider ──├── prod
│                           ├── qa
│                           ├── staging
│
├── templates # helm templates to be used
├── chart.yaml # our chart file

we have 3 different applications and we need to deploy them to 3 different environments prod, staging, and qa we have developed a common helm chart to be used for all of the 3 applications for each combination of application and environment we have different values.yaml files to be used alongside with our common helm chart, see diagram below architecture

argocd-applicationset-demo's People

Contributors

amralaayassen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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