{"id":21660810,"url":"https://github.com/mohammadll/cicd-with-argo-stack","last_synced_at":"2025-10-05T19:52:44.925Z","repository":{"id":216715436,"uuid":"737839696","full_name":"mohammadll/cicd-with-argo-stack","owner":"mohammadll","description":"The goal is to implement a comprehensive CI/CD pipeline using the Argo stack, which includes the integration of Argo CD, Argo Rollouts, Argo Workflows, and Argo Events.","archived":false,"fork":false,"pushed_at":"2024-03-16T16:09:12.000Z","size":125,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T07:11:15.031Z","etag":null,"topics":["argo-cd","argo-events","argo-rollouts","argo-workflow"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohammadll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-01T17:29:03.000Z","updated_at":"2024-07-29T21:47:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"a26eaa8c-d087-4b72-b0bf-b06c5a90e6d7","html_url":"https://github.com/mohammadll/cicd-with-argo-stack","commit_stats":null,"previous_names":["mohammadll/cicd-with-argo-stack"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fcicd-with-argo-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fcicd-with-argo-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fcicd-with-argo-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadll%2Fcicd-with-argo-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadll","download_url":"https://codeload.github.com/mohammadll/cicd-with-argo-stack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244556655,"owners_count":20471664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argo-cd","argo-events","argo-rollouts","argo-workflow"],"created_at":"2024-11-25T09:38:56.389Z","updated_at":"2025-10-05T19:52:39.900Z","avatar_url":"https://github.com/mohammadll.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cicd-with-argo-stack\n\n![Argo Image](argo.png)\n\n## 💡 Description of the scenario\nWe want to combine `Argo CD`, `Argo Rollouts`, `Argo Workflows`, and `Argo Events` in the form of a scenario and project to see how they work together in the real world. First, we'll set up Nexus as our artifact repository to store Docker images and set up a private GitLab as our code repository. Argo Events help us trigger the workflow that we want to create. Then, using Argo Events Custom Resource Definitions (CRDs), we'll create a resource named \"event-source\" to connect to our desired project on GitLab (assuming this project includes the source code of the application). By doing this, a webhook will be automatically created on this project in GitLab. Upon any changes to this project, this webhook is called. The workflow needs to be automatically executed by Argo Events. For this reason, we'll create a resource named \"sensor\" whose task is to execute the workflow. But what is the task of workflows in this scenario? Using Argo Workflows, we'll write a CI pipeline whose task is to build a Docker image and push it to Nexus. Argo Workflows will then go to the Rollouts manifest and change the tag of the previous image with the new value. At this stage, when the Rollouts manifest changes, Argo CD detects the new change and applies it to the Kubernetes cluster. In this scenario, we have used the canary strategy in the Rollouts manifest.\n\nThis repository has two different sections to follow:\n  - Requirements of this scenario\n  - Executing the scenario\n\n## 🔎 Requirements of this scenario\n\n:one: **Install sonatype nexus repository in your nexus server:**\n\n    cd nexus/ \u0026\u0026 docker-compose up -d\nIf Nexus is up and running, create a repository named `argo-demo` with the type `docker (hosted)` and set its HTTP port to `8085`.\n\n:two: **Add private registry to Docker/containerd in your kubernetes cluster:**\n\n**Docker:**\n\n    cat \u003c\u003cEOF | sudo tee /etc/docker/daemon.json\n    {\n      \"insecure-registries\": [\"REPLACE_ME_WITH_NEXUS_IP_ADDRESS:8085\"]\n    }\n    EOF\n**Containerd:**\n\n    sudo tee -a /etc/containerd/config.toml \u003c\u003cEOF\n    [plugins.\"io.containerd.grpc.v1.cri\".registry]\n      [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors]\n        [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"REPLACE_ME_WITH_NEXUS_IP_ADDRESS:8085\"]\n          endpoint = [\"http://REPLACE_ME_WITH_NEXUS_IP_ADDRESS:8085\"]\n    EOF\nRestart the service\n\n**Test everything is working well:**\n\n    docker login -u USERNAME NEXUS_IP_ADDRESS:8085\n    docker pull nginx:alpine\n    docker tag nginx:alpine NEXUS_IP_ADDRESS:8085/nginx:alpine \u0026\u0026 docker push NEXUS_IP_ADDRESS:8085/nginx:alpine\n\n:three: **Install and configure Gitlab**\n   - Install GitLab on your GitLab server\n   - Create two different repositories named `argo-config` and `my-app` in GitLab\n   - Put the content of the `argo-cd`, `argo-rollouts` and `argo-events` directories into the `argo-config GitLab repository`\n   - Put the content of the `my-app` directory into the `my-app GitLab repository`\n\n:four: **Create these namespaces in your Kubernetes cluster:**\n\n    kubectl create ns argocd\n    kubectl create ns argo-rollouts\n    kubectl create ns argo\n    kubectl create ns argo-events\n\n:five: **Install argo-cd, argo-rollouts, argo-workflows and argo-events in your kubernetes cluster**\n  - **Argo-CD:**\n    - https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/\n    - https://argo-cd.readthedocs.io/en/stable/getting_started/\n  - **Argo-Rollouts:**\n    -  https://argo-rollouts.readthedocs.io/en/stable/installation/\n  - **Argo-Workflows:**\n    -  https://argo-workflows.readthedocs.io/en/latest/installation/\n    -  https://argo-workflows.readthedocs.io/en/latest/quick-start/\n  - **Argo-events:**\n    - https://argoproj.github.io/argo-events/installation/\n    - https://argoproj.github.io/argo-events/quick_start/\n\n:six: **Create a Kubernetes secret in your Kubernetes cluster containing authentication credentials for Nexus:**\n\n    kubectl create secret generic -n argo-events docker-config-secret --from-file=/path/to/.docker/config.json\n\n:seven: **Install Minio in your kubernetes cluster and integrate it with Argo Workflows to store workflows artifacts:**\n\n    helm install -n argo-events argo-artifacts oci://registry-1.docker.io/bitnamicharts/minio --set service.type=NodePort --set service.nodePorts.api=32073 --set service.nodePorts.console=32074 --set fullnameOverride=argo-artifacts\n**Retrieve your ROOT-PASSWORD and ROOT-USER:**\n\n    echo `kubectl get secret argo-artifacts --namespace argo-events -o jsonpath=\"{.data.root-password}\"| base64 --decode`\n    echo `kubectl get secret argo-artifacts --namespace argo-events -o jsonpath=\"{.data.root-user}\"| base64 --decode`\n**Create a kubernetes secret in the `argo-events` namespace, so workflows can use it to connect to minio:**\n\n    kubectl create secret -n argo-events generic my-minio-cred --from-literal=root-user='REPLACE_ME_WITH_BASE64-DECODED-VALUE-OF-THE-ROOT-USER' --from-literal=root-password='REPLACE_ME_WITH_BASE64-DECODED-VALUE-OF-THE-ROOT-PASSWORD'\n\n**Create a kubernetes configmap in the `argo-events` namespace, so workflows can use it to store artifacts in minio:**\n\n    kubectl apply -f minio/minio-artifact-repo-cm.yml -n argo-events\n\n## 🔎 Executing the scenario\n\n**Test the scenario to see how it works**\n\n**Proceed with these steps in order once the previous step is completed**\n\n  1. Install your first argo-cd application using `kubectl apply -f argo-cd/argo-app.yml -n argocd`\n  2. Apply argo-events resources in your kubernetes cluster using `kubectl apply -f argo-events/ -n argo-events`\n  3. Open the browser and type the url of argo,rollouts, argo-cd and argo-workflows to see their dashboards and also type the url of your app: `http://argo.demo` (it has been deployed on your kubernetes cluster in step `1`)\n  4. Modify the `index.html` file that exists in your `my-app GitLab repository`\n  5. If you check the Argo Workflows dashboard, you'll see that a workflow is running, triggered by a push event in your `my-app GitLab repository`\n  6. The default polling interval in Argo CD is 3 minutes, indicating how frequently Argo CD checks for changes in your Git repository. Wait for 3 minutes or refresh your Argo CD app using its dashboard or CLI manually\n  7. As specified in the Argo Rollouts manifest, `20%` of the traffic is directed to the new version of the app and the promotion is paused until you manually unpause it (check `http://argo.demo` and refresh the page multiple times). If you are confident that everything is in order with the new version of the app, type `kubectl argo rollouts promote nginx-rollouts -n argo-demo` and then check the Argo Rollouts dashboard again. so, after a few minutes, you'll fully switch to the new version of your application. In this scenario, we are using the `canary` strategy, but you can also opt for the `blue-green` strategy if you prefer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadll%2Fcicd-with-argo-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadll%2Fcicd-with-argo-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadll%2Fcicd-with-argo-stack/lists"}