Argocd 배포 notication을 수정하자 (oncePer)

Glen·2023년 11월 7일
0

helm이 변경되면서 신규commit이 발생하게 되었다.
이미지가 변경되지 않았는데, Slack 알림이 울린다.

옵션중에 onceper가 있는데 이미 세팅되어있다

  • 정해진 값이 변경될때 한번만 실행한다
  • onceper를 수정해보자.

기존 oncePer

  • app.status.sync.revision

수정 oncePer

  • app.status.operationState.operation.sync.revision

기존 값은 repository를 바라보고 최신 commit에 의해 변경됨

  • 현재는 ci 이후 helm chart에 image tag를 수정하는 방식이라 helm이 수정될때마다 발생함. 따라서 image tag값이 아닌 다른 값을 수정해도 발생하게됨.

수정된 값은 배포되면 deployment에 의해 리비전이 결정됨

  • image가 변경되었을때 deployment의 rs가 생기면서 발생

참고

  • ArgoCD application.yaml 확인.
status:
  health:
    status: Healthy
  history:
  - deployStartedAt: "2023-07-27T16:03:21Z"
    deployedAt: "2023-07-27T16:03:22Z"
    id: 15
    revision: b15306af03f59b1297e276fdd4b3ddd2818fd850
    source:
      path: test/app
      repoURL: https://github.com/project-repo/helm.git
      targetRevision: test/app
  - deployStartedAt: "2023-07-27T19:01:38Z"
    deployedAt: "2023-07-27T19:01:40Z"
    id: 16
    revision: 6f07059b0d1fb6399b8bf45d3a71d75f51dbff59
    source:
      path: test/app
      repoURL: https://github.com/project-repo/helm.git
      targetRevision: test/app
  - deployStartedAt: "2023-07-28T06:10:54Z"
    deployedAt: "2023-07-28T06:10:54Z"
    id: 17
    revision: 5108ed6fd7a5121b8e409349db6dc6e2de5dbdd7
    source:
      path: test/app
      repoURL: https://github.com/project-repo/helm.git
      targetRevision: test/app
  operationState:
    finishedAt: "2023-07-28T06:10:54Z"
    message: successfully synced (all tasks run)
    operation:
      initiatedBy:
        username: admin
      retry: {}
      sync:
        revision: 5108ed6fd7a5121b8e409349db6dc6e2de5dbdd7
        syncOptions:
        - CreateNamespace=true
        syncStrategy:
          hook: {}
    phase: Succeeded
    startedAt: "2023-07-28T06:10:54Z"
    syncResult:
      resources:
      - group: ""
        hookPhase: Running
        kind: Service
        message: service/app unchanged
        name: app
        namespace: app
        status: Synced
        syncPhase: Sync
        version: v1
      - group: apps
        hookPhase: Running
        kind: Deployment
        message: deployment.apps/app configured
        name: app
        namespace: app
        status: Synced
        syncPhase: Sync
        version: v1
      - group: autoscaling
        hookPhase: Running
        kind: HorizontalPodAutoscaler
        message: horizontalpodautoscaler.autoscaling/app unchanged
        name: app
        namespace: app
        status: Synced
        syncPhase: Sync
        version: v2
      - group: networking.k8s.io
        hookPhase: Running
        kind: Ingress
        message: ingress.networking.k8s.io/test-lb configured
        name: test-lb
        namespace: app
        status: Synced
        syncPhase: Sync
        version: v1
      revision: 5108ed6fd7a5121b8e409349db6dc6e2de5dbdd7
      source:
        path: test/app
        repoURL: https://github.com/project-repo/helm.git
        targetRevision: test/app
  reconciledAt: "2023-07-31T07:30:51Z"
  resources:
  - health:
      status: Healthy
    kind: Service
    status: Synced
    version: v1
  - group: apps
    health:
      status: Healthy
    kind: Deployment
    status: OutOfSync
    version: v1
  - group: autoscaling
    health:
      message: recommended size matches current size
      status: Healthy
    kind: HorizontalPodAutoscaler
    status: Synced
    version: v2
  - group: networking.k8s.io
    health:
      status: Healthy
    kind: Ingress
    status: Synced
    version: v1
  sourceType: Helm
  summary:
    externalURLs:
    - http://k8s-app-testlb.ap-northeast-2.elb.amazonaws.com
    images:
    - 0123456789.dkr.ecr.ap-northeast-2.amazonaws.com/test-ecr:app-77e124b0
  sync:
    comparedTo:
      destination:
        namespace: app
        server: https://k8s.ap-northeast-2.eks.amazonaws.com
      source:
        path: test/app
        repoURL: https://github.com/project-repo/helm.git
        targetRevision: test/app
    revision: 9ef1ccbce839e8ba9d9a55c64f107d3dcc62f489
    status: OutOfSync
profile
어제보다 나은 엔지니어가 되기 위해서 공부중

0개의 댓글