All Projects → minghsu0107 → cicd-demo

minghsu0107 / cicd-demo

Licence: other
A demo repository that shows CI/CD integration using DroneCI + ArgoCD + Kubernetes.

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to cicd-demo

gitops-build-lib
Jenkins pipeline shared library for automating deployments via GitOps
Stars: ✭ 23 (-36.11%)
Mutual labels:  k8s, gitops, argocd
gitops-playground
Reproducible infrastructure to showcase GitOps workflows and evaluate different GitOps Operators on Kubernetes
Stars: ✭ 77 (+113.89%)
Mutual labels:  k8s, gitops, argocd
gimletd
The Gitops Release Manager
Stars: ✭ 24 (-33.33%)
Mutual labels:  k8s, gitops
Faas
OpenFaaS - Serverless Functions Made Simple
Stars: ✭ 20,820 (+57733.33%)
Mutual labels:  k8s, gitops
paas-templates
Bosh, CFAR, CFCR and OSB services templates for use with COA (cf-ops-automation) framework
Stars: ✭ 16 (-55.56%)
Mutual labels:  k8s, gitops
actions
Set of actions for implementing CI/CD with werf and GitHub Actions
Stars: ✭ 67 (+86.11%)
Mutual labels:  k8s, gitops
charts
Helm charts for creating reproducible and maintainable deployments of Polyaxon with Kubernetes.
Stars: ✭ 32 (-11.11%)
Mutual labels:  k8s, gitops
gitopscli
GitOps CLI - a command line interface (CLI) to perform operations on git repositories with yaml files
Stars: ✭ 25 (-30.56%)
Mutual labels:  gitops, argocd
aws-eks-accelerator-for-terraform
Configure and deploy complete EKS clusters.
Stars: ✭ 1,220 (+3288.89%)
Mutual labels:  gitops, argocd
nebulous
The Kubefirst Open Source Platform
Stars: ✭ 122 (+238.89%)
Mutual labels:  gitops, argocd
Kubernetes-and-Cloud-Native-Associate-KCNA
Useful notes for the KCNA - Kubernetes and Cloud Native Associate
Stars: ✭ 162 (+350%)
Mutual labels:  k8s, gitops
github-task-manager
receive github hook, notify agent, receive task results, notify github
Stars: ✭ 13 (-63.89%)
Mutual labels:  k8s, gitops
Book k8sInfra
< 컨테이너 인프라 환경 구축을 위한 쿠버네티스/도커 >
Stars: ✭ 176 (+388.89%)
Mutual labels:  k8s, gitops
okd-lab
Controlled Environment for OKD4 experiments
Stars: ✭ 24 (-33.33%)
Mutual labels:  gitops, argocd
humble
Just a humble project
Stars: ✭ 53 (+47.22%)
Mutual labels:  argocd
k8s-buildkite-plugin
Run any buildkite build step as a Kubernetes Job
Stars: ✭ 37 (+2.78%)
Mutual labels:  k8s
dcos-k8s-rust-skaffold-demo
A demo of pipelining Rust application development to Kubernetes on DC/OS with Skaffold.
Stars: ✭ 40 (+11.11%)
Mutual labels:  k8s
declarative-openshift
Working examples of manifests for openshift for use in a declarative management strategy.
Stars: ✭ 17 (-52.78%)
Mutual labels:  gitops
aks-keyvault
Access Azure Key Vault secrets, keys and certs from AKS Pods using Secret Store CSI provider and Pod Identity.
Stars: ✭ 21 (-41.67%)
Mutual labels:  k8s
tondra
Continuous Development on Kubernetes environments with Skaffold
Stars: ✭ 105 (+191.67%)
Mutual labels:  k8s

CI/CD Demo

This is the demo repo for my blog post.

This tutorial shows how to build CI/CD pipeline with DroneCI and ArgoCD. In this demo, we use DroneCI for running tests, publishing new images, and update image tags in the manifest repository. We then use ArgoCD for continuous delivery, synchronizing application states in the Kubernetes cluster with manifests maintained in the Git repository.

This way of doing Kubernetes cluster management and application delivery is kown as GitOps. By applying GitOps, we can maintain a 'source of truth' for both the application code and infrastructure, improving system reliability and efficiency for your team.

Architecture overview:

Prerequisites

  1. A Drone server
  2. A K8s cluster
  3. ArgoCD deployment
  4. A Github account and a Dockerhub account

DroneCI

Setup

After you have connected your Github account with Drone, you can browse all your repositories on Drone dashboard. Next, clone this repo, activate it and navigate to Repositories -> cicd-demo -> settings to add the following secrets:

image

  • docker_username: your Dockerhub account
  • docker_password: your Dockerhub password
  • ssh_key: base64-encoded RSA private key for accessing Github

To access Github using SSH, you should first upload a RSA public key, such as ~/.ssh/id_rsa.pub, to Github. Then, you could generate base64-encoded RSA private key by running cat ~/.ssh/id_rsa | base64.

Finally, replace minghsu0107 with your Github and Dockerhub account in .drone.yml. Now any push or pull request will trigger a Drone pipeline. You can check details via your repo -> setting -> webhook on Github.

Local Development

For local development, you will not want to push every change to your repo just for testing whether .drone.yml works. Instead, you can use Drone CLI to execute pipeline locally.

Login to Drone:

export DRONE_SERVER=<drone-server-url>
export DRONE_TOKEN=<drone-token> # check token under dashboard -> user setting
drone info

For example, you can run step test only by executing the following script under the project root:

drone exec --include=<pipline-step-name>

ArgoCD

Please clone the application manifest repository first. This repo holds the application manifests and will be synced with ArgoCD later. The manifests are maintained by Kustomize, which is supported by ArgoCD out-of-the-box.

If your repository is set to private, you need to configure access credentials on ArgoCD. Otherwise you can skip this step and create new app directly.

Credentials can be configured using Argo CD CLI:

argocd repo add <repo-url> --username <username> --password <password>

Or you can configure via UI. Navigate to Settings/Repositories; click Connect Repo using HTTPS and enter credentials:

You will see something like:

Create new app:

Remember to place the repository with your own repo.

Now we have finish all preparations, and it's time to let the magic happen. Navigate to /applications and click SYNC button on your app in order to synchronize the cluster state:

You can click your app to view details:

As we can see, ArgoCD automatically sync the application to our desired state specified in production base. It also shows how all resources roll out in the cluster. With ArgoCD, we can not only have complete control over the entire application deployment but also track updates to branches, tags, or pinned to a specific version of manifests at a Git commit.

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].