argocd: why helm app not applying values.yml 2023

208 Views Asked by At

Hi I have this issue of argocd not taking helm values.yml i have files like this

logstash-main.yml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: logstash-0
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    path: static/clusters/backup-test/cluster/logstash/ # CHANGE
    repoURL: https://git.sample-name.com/pub/argo-cd.git
    targetRevision: HEAD
    chart: logstash-0
    helm:
      valueFiles: 
      - logstash-helm-values.yaml
  destination:
    namespace: test
    server: 'https://kubernetes.default.svc'
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

Chart.yml

name: logstash-0
version: 1.0.0
apiVersion: v2
dependencies:
  - name: logstash
    version: "8.5.1"
    repository: "https://helm.elastic.co"

logstash-helm-values.yaml

logstash:
 image: "docker.elastic.co/logstash/logstash"
 imageTag: "8.11.1"
 imagePullPolicy: "IfNotPresent"

 logstashConfig:
   logstash.yml: |
     http.host: "0.0.0.0"
     path.config: /usr/share/logstash/pipeline
     pipeline.ecs_compatibility: disabled

 logstashPipeline:
   logstash.conf: |
     input {
       http {
         port => 5044
       }
     }
     filter {
       json {
         skip_on_invalid_json => true
         source => "message"
         target => "ets"
         remove_field => ["[ets][timestamp]","[ets][id]"]
       }
     }
     output {
       #output
     }

 service:
   type: ClusterIP
   ports:
     - name: beats
       port: 5044
       protocol: TCP
       targetPort: 5044

 ingress:
   enabled: true
   annotations: {}
   className: "nginx"
   pathtype: ImplementationSpecific
   hosts:
     - host: logstash-test-abc.com
       paths:
         - path: /
           servicePort: 5044

 httpPort: 5044
 fullnameOverride: "logstash"

I am following this approach because after this app is deployed I will need to add some lines in logstash-helm-values files under #output section earlier I was inline helmvalues parametes which worked fine but everytime I update the version of logstash, my manual added change get reverted.

Hence I opted this approach but was not able to to run it due to these error

Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = Manifest generation error (cached): helm template . --name-template logstash --namespace monitoring --kube-version 1.25 --values /tmp/87a12084-9089-4d8a-8907-f3a70e455b25/logstash/logstash-helm-values.yaml --api-versions acme.cert-manager.io/v1 --api-versions acme.cert-manager.io/v1/Challenge --api-versions acme.cert-manager.io/v1/Order --api-versions admissionregistration.k8s.io/v1 --api-versions admissionregistration.k8s.io/v1/MutatingWebhookConfiguration --api-versions admissionregistration.k8s.io/v1/ValidatingWebhookConfiguration --api-versions agent.k8s.elastic.co/v1alpha1 --api-versions agent.k8s.elastic.co/v1alpha1/Agent --api-versions apiextensions.k8s.io/v1 --api-versions`

I was expecting that after the logstash argocd-app is deployed I will add my manual changes of code in logstash-helm-values.yml so that I can easily version upgrade logstash in future

0

There are 0 best solutions below