Deploying an application
Manifests
Traditional way
kubectl apply -f manifest.yaml
GitOps way
-
Choose project to deploy the application
For example,
agrospaiproject. If the project is not created, check Adding a new project. -
Create the application in
manifests/default/argo-cd/projects/agrospai/applications/{{application}}. Check Adding a new application. -
Add the manifests files in
manifests/system/{{application}}. -
Push the changes to the repository.
Helm
Example with cert-manager.
Search repo
helm search repo jetstack/cert-manager
NAME CHART VERSION APP VERSION DESCRIPTION
jetstack/cert-manager v1.16.1 v1.16.1 A Helm chart for cert-manager
Note: The version used in the next steps is the
CHART VERSION.
Download the repo
helm repo add jetstack https://charts.jetstack.io --force-update
Customize the values
helm show values jetstack/cert-manager --version v1.16.1 > values.yaml
Check template
helm template cert-manager jetstack/cert-manager --version v1.16.1 -f values.yaml --namespace cert-manager --create-namespace > template.yaml
Install
Traditional way
helm install cert-manager jetstack/cert-manager --version v1.16.1 -f values.yaml --namespace cert-manager --create-namespace
GitOps way
-
Choose project to deploy the application
We will deploy cert-manager in
systemproject. If the project is not created, check Adding a new project. -
In
manifests/default/argo-cd/projects/system/applications/cert-manager/:a. Add the
values.yamlfile.a. Add the
cert-manager.yamlfile. Check Adding a new application. `yaml apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: cert-manager namespace: argo-cd spec: project: system sources:- repoURL: https://charts.jetstack.io chart: cert-manager targetRevision: v1.16.1 helm: releaseName: cert-manager valueFiles: - $values/manifests/default/argo-cd/projects/system/applications/cert-manager/values.yaml
- repoURL: https://github.com/AgrospAI/apps-deploy.git targetRevision: HEAD ref: values
- repoURL: https://github.com/AgrospAI/apps-deploy.git
path: manifests/system/cert-manager
targetRevision: HEAD
directory:
recurse: true
include: '*.yaml'
destination:
server: "https://kubernetes.default.svc"
namespace: cert-manager
syncPolicy:
syncOptions:
- CreateNamespace=true `
-
In
manifests/system/cert-manageradd your custom manifests. -
Push the changes to the repository.