#argocd - May 2023

argocdArchived
3 messages
João
Joãoover 3 years ago
Hello folks, argo question.

I want to have an applicationset similar to this, the problem is that https://github.com/argoproj/argo-cd/tree/master/applicationset/examples/git-generator-files-discovery/apps/guestbook I dont want to store my helm chart here since I am using an helm chart repo.

Is there a way of using git generators with helm charts stored on a rempo rather than on a templates/ folder locally?
Frank
Frankover 3 years ago(edited)
Hi! I'm troubleshooting a weird issue with ArgoCD while deploying the Grafana Helm chart on a Minikube test env.
For some reason the secret the chart generates is constantly being updated (specifically the admin-password key), resulting in the deployment to create a new replicaset and pod.

One would say this is an issue with their chart, but somehow I am seeing similar behavior with a different chart as well.

Any pointers on how to resolve this?
Lolu Ade
Lolu Adeover 3 years ago(edited)
I am trying to use ArgoCD notification to my Teams channel, but it isn't sending notification. So, I followed documentation here
I created an Incoming Webhook in teams and get URL
I set it to argocd-notification secrets:
Then I set up config map:
Then I subscribe it from application:
apiVersion: <http://argoproj.io/v1alpha1|argoproj.io/v1alpha1>
kind: Application
metadata:
  name: dreambook-argo-application
  namespace: argocd
  annotations:
    <http://notifications.argoproj.io/subscribe.on-sync-running.teams|notifications.argoproj.io/subscribe.on-sync-running.teams>: ArgoCD
    <http://notifications.argoproj.io/subscribe.on-deployed.teams|notifications.argoproj.io/subscribe.on-deployed.teams>: ArgoCD
    <http://notifications.argoproj.io/subscribe.on-health-degraded|notifications.argoproj.io/subscribe.on-health-degraded>: ArgoCD
spec:
  project: default
  source:
    repoURL: myrepo url
    targetRevision: HEAD
    path: dev/deployment
  destination:
    server: <https://kubernetes.default.svc>
    namespace: myns
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - Validate=false
      - Prune=true
      - SelfHeal=true
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
data:
  context: |
    argocdUrl: <https://20.204.207.96>
  trigger.on-health-degraded: |
    when: app.status.health.status == 'Degraded'
    send: [app-on-health-degraded]
  trigger.on-deployed: |
    when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy'
    oncePer: app.status.sync.revision
    send: [app-sync-succeeded]
  service.teams: |
    recipientUrls: 
      ArgoCD: $channel-teams-url
  template.app-on-health-degraded: |
    email:
      subject: Application {{.app.metadata.name}} has degraded.
    message: |
      Application {{.app.metadata.name}} has degraded.
      Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
    teams:
      facts: |
        [{
          "name": "Sync Status",
          "value": "{{.app.status.sync.status}}"
        },
        {
          "name": "Repository",
          "value": "{{.app.spec.source.repoURL}}"
        }
        {{range $index, $c := .app.status.conditions}}
          {{if not $index}},{{end}}
          {{if $index}},{{end}}
          {
            "name": "{{$c.type}}",
            "value": "{{$c.message}}",
          }
        {{end}}
        ]
      potentialAction: |
        [{
          "@type":"OpenUri",
          "name":"Open Application",
          "targets":[{
            "os":"default",
            "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
          }]
        },
        {
          "@type":"OpenUri",
          "name":"Open Repository",
          "targets":[{
            "os":"default",
            "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
          }]
        }]
      title: Application {{.app.metadata.name}} has degraded.

  template.app-sync-succeeded: |
    teams:
      facts: |
        [{
          "name": "Sync Status",
          "value": "{{.app.status.sync.status}}"
        },
        {
          "name": "Repository",
          "value": "{{.app.spec.source.repoURL}}"
        },
        {
          "name": "Revision",
          "value": "{{.app.status.sync.revision}}"
        }
        {{range $index, $c := .app.status.conditions}}
          {{if not $index}},{{end}}
          {{if $index}},{{end}}
          {
            "name": "{{$c.type}}",
            "value": "{{$c.message}}",
          }
        {{end}}
        ]
      potentialAction: |-
        [{
          "@type":"OpenUri",
          "name":"Operation Application",
          "targets":[{
            "os":"default",
            "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
          }]
        },
        {
          "@type":"OpenUri",
          "name":"Open Repository",
          "targets":[{
            "os":"default",
            "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
          }]
        }]
      title: New version of an application {{.app.metadata.name}} is up and running.
 
apiVersion: v1  
kind: Secret
metadata:   
  name: argocd-notifications-secret
stringData:
  channel-teams-url: mywebhookurl
type: Opaque
 

when i check the logs of argocd-notifications controller time="2023-05-26T01:44:34Z" level=info msg="Notification about condition 'on-created.[0].X_5TO4MPCKAyY0ipFgr6_IraRNs' already sent to '{teams