I have requirement to deploy multiple apps in Kubernetes using single(common) helm chart, and app deployment will be happen via ArgoCD. Have created Helm charts and pushed it in Jfrog OCI based registries and the application value files(value.yaml) are present in gitlab repositories.
Trying to deploy ArgoCD app ‘argocd-app’ with gitlab pipeline, which will deploy main Argocd application and it’ll keep detecting whatever cahnges/new additions of value files happened in the gitlab repositories and accordingly Argocd will deploy/change applications in k8s.
Using below mentioned gitlab pipleline file, but it’s deploying only ‘argocd-apps’ with code present in approach1.yaml file.
Request your assistance here on what changes I need do in this pipeline file so that ‘argocd-app’ app will check for the other application value.yaml files present in the gitlab repo “argocd-apps/prm-helmchart/value_files” and will auto deploy. Or You can suggest entirely alternate way to achieve above mentioned requirement.
- At path “argocd-apps/prm-helmchart/value_files” at which all application value files are present.
.gitlab-ci.yml file:
stages:
- prepare
- deploy
prepare:
stage: prepare
script:
- git clone https://$CI_GITLAB_USER:[email protected]/gitlab1511220/argocd-apps.git
- cp -r argocd-apps/prm-helmchart/value_files .
artifacts:
paths:
- argocd-apps/prm-helmchart/approach1.yaml
deploy:
stage: deploy
image: google/cloud-sdk:latest
script:
- gcloud container clusters get-credentials my-gke-cluster1 --zone australia-southeast1-a --project my-project-v1
#- helm registry login $JFROG_DOMAIN -u $JFROG_USER -p $JFROG_PASSWORD
- |
cat <<EOF | kubectl apply -f -
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd-apps
namespace: argocd
spec:
project: default
source:
repoURL: 'cstmimgjfrog.jfrog.io'
chart: 'helm-oci-local/oci'
targetRevision: '0.1.0'
helm:
valueFiles:
- value_files/approach1.yaml
destination:
server: 'https://kubernetes.default.svc'
namespace: py-apps
syncPolicy:
automated:
prune: true
selfHeal: true
EOF
dependencies:
- prepare
You can suggest required modifications Or alternate way can be suggested to achieve above mentioned requirement. (i.e. Requirement: To deploy multiple apps in Kubernetes using single(common) helm chart, and app deployment will be happen via ArgoCD, vave created Helm charts and pushed it in Jfrog OCI based registries)
sdate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.