# CI/CD Basic
This document explains basic about ./cicd.
This module is the main implementation of CI/CD on k8s.
# How it works?
The built-in CI/CD utilize these projects:
- Argo Workflows (opens new window): Construct CI/CD pipelines/workflows
- Argo CD (opens new window): Provide CD + gitops implementation. Detect change of git repository and deploy.
- Argo Events (opens new window): Listen to various events and trigger various actions including
Argo Workflows. - [TODO]: chatops implementation
- MinIO (opens new window): Provide artifact repostiory capability for CI/CD.
# Deploy/Undeploy
make deploy
Undeploy:
make undeploy
# How to Use CI with Argo Workflows?
This section introduce basic CI usage with built-in Argo Workflows.
To know more, please check official documents (opens new window).
# Modify the Configuration
First, specify a host like argo.cicd.localhost or localhost for the web server of Argow Workflows.
Modify it through modify /spec/rules/0/host in ./cicd/kustomize/argo-workflows/local/ingress.yaml.
If you are deploying the cicd in local k8s cluster, you will need to be able to resolve DNS for *.localhost.
You can check ./local-k8s-cluster/scripts/override_dns.sh as a tip.
Also specify namespace in ./cicd/kustomize/kustomization.yaml and ./cicd/kustomize/namespace.yaml.
Default is cicd.
# After Deploy
After deploy, you can check Argo Workflow Server Web UI from http://localhost/cicd/argo (opens new window) or the host you specify.
You can check Argo CD Web UI from http://localhost/cicd/argo-cd (opens new window) or the host you specify.
You can check MinIO Web UI from http://minio.cicd.localhost/ (opens new window) or the host you specify.
WARNING
Please notice that currently MinIO only support serving as root path / for the reason to be compatiable with S3.
So we cannot modify the ingress host for MinIO to something like http://localhost/cicd/minio
# Deploy a Hello-World Workflow
kubectl --namespace cicd create -f ./cicd/manefest/argo-workflow-test.yaml
Then an Argo Workflow Resource with the name hello-world-xxx will be deploy, bringing up a pod with the same name.
kubectl --namespace cicd logs hello-world-xxx -c main
This command will show the execution result in the log.
To delete this workflow, simply
kubectl --namespace cicd delete workflow hello-world-xxx
# Argo Workflows Catalog
For more reusable Argo Workflow Template, please check Argo Workflows Catalog (opens new window).
# How to Use CD with Argo CD?
This section introduce basic CI usage with built-in Argo CD.
To know more, please check official documents (opens new window).
# Modify the Configuration
First, specify a host like argocd.cicd.localhost for the web server of Argow CD.
Modify it through modify ./cicd/kustomize/ingress.yaml.
If you are deploying the cicd in local k8s cluster, you will need to be able to resolve DNS for *.localhost.
You can check ./local-k8s-cluster/scripts/override_dns.sh as a tip.
Also specify namespace in ./cicd/kustomize/kustomization.yaml and ./cicd/kustomize/namespace.yaml.
Default is cicd.
# After Deploy
After deploy, you can check Argo CD Server Web UI. from http://localhost/cicd/argo-cd (opens new window) or the host you specify.
You can check the initial username & password by following the official documents (opens new window)
# Deploy a Hello-World Application
Follow the official documents (opens new window).
# How to Trigger CI/CD with Argo Events?
This section introduce basic event/trigger usage with built-in Argo Events.
To know more, please check official documents (opens new window).
# Deploy a Hello-World Event Bus/Event Source/Sensor
Please check the official documents (opens new window).
# Advance Configuration
# Artifact Repository Using Minio
In the default deploy using local k8s cluster, MinIO is setuped with 1 instance.
In production, you may want to setup HA for MinIO.
Check ./cicd/kustomize/minio/production/kustomization.yaml for HA MinIO cluster.
(Simply modify resources field in ./cicd/kustomize/kustomization, change the children - ./minio/local to - ./minio/production)