Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Draft) ApplicationSet Progressive Sync #1

Closed
wants to merge 3 commits into from

Conversation

wmgroot
Copy link
Owner

@wmgroot wmgroot commented Jul 11, 2022

-- THIS IS STILL A DRAFT --
Functionality is working, but unit tests still need to be added.
Please feel free to comment.

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

Example ApplicationSet spec used for E2E testing.

---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: hello-world-nginx
spec:
  generators:
  - clusters:
  ...
  syncPolicy:
    preserveResourcesOnDeletion: true
  strategy:
    type: RollingUpdate
    rollingUpdate:
      steps:
        - matchExpressions:
            - key: rolloutWave
              operator: In
              values:
                - tier-5
          maxUpdate: 0 # if undefined or 0, all applications matched are updated together
        - matchExpressions:
            - key: rolloutWave
              operator: In
              values:
                - tier-3
          maxUpdate: 1 # maxUpdate supports both integer and percentage string values
  template:
    metadata:
      name: 'hello-world-nginx-{{name}}'
      annotations:
        indeed.com/argo-cd-instance: test-mgroot
        indeed.com/applicationset: hello-world-nginx
      labels:
        rolloutWave: "{{criticality}}"  # label can be provided explicitly from a list generator or from cluster secret labels, etc
    spec:
      project: hello-world-nginx
      source:
        repoURL: <internal repo with a simple dummy nginx Deployment>
        path: charts/nginx
        targetRevision: master
        helm:
          releaseName: hello-world-nginx
          values: |-
            clusterName: {{name}}
            deployment:
              template:
                annotations:
                  test: "30"   # this field is incremented to test the progressive rollout capability, nginx pods become ready after 2 mins
      destination:
        name: '{{name}}'
        namespace: hello-world-nginx--demo
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
        syncOptions:
          - ApplyOutOfSyncOnly=true
          - CreateNamespace=true

Example ApplicationSet status progression.

# App #1 and App #2 stable on same AppSet version
status:
  applicationStatus:
  - application: hello-world-nginx-awscmhdev
    lastTransitionTime: "2022-07-19T22:17:29Z"
    message: Application resource becaame Healthy, updating status from Progressing
      to Healthy.
    observedGeneration: 3
    status: Healthy
  - application: hello-world-nginx-awscmhqa2
    lastTransitionTime: "2022-07-19T22:17:29Z"
    message: Application resource becaame Healthy, updating status from Progressing
      to Healthy.
    observedGeneration: 3
    status: Healthy


# App #1 Progressing, App #2 Waiting
status:
  applicationStatus:
  - application: hello-world-nginx-awscmhdev
    lastTransitionTime: "2022-07-19T22:56:58Z"
    message: Application resource became Progressing, updating status from Pending
      to Progressing.
    observedGeneration: 4
    status: Progressing
  - application: hello-world-nginx-awscmhqa2
    lastTransitionTime: "2022-07-19T22:56:58Z"
    message: Application is out of date with the current AppSet generation, setting
      status to Waiting.
    observedGeneration: 3
    status: Waiting

# App #1 Healthy, App #2 Progressing
status:
  applicationStatus:
  - application: hello-world-nginx-awscmhdev
    lastTransitionTime: "2022-07-19T22:59:04Z"
    message: Application resource becaame Healthy, updating status from Progressing
      to Healthy.
    observedGeneration: 4
    status: Healthy
  - application: hello-world-nginx-awscmhqa2
    lastTransitionTime: "2022-07-19T22:59:06Z"
    message: Application resource became Progressing, updating status from Pending
      to Progressing.
    observedGeneration: 4
    status: Progressing

# App #1 and App #2 on new AppSet version
status:
  applicationStatus:
  - application: hello-world-nginx-awscmhdev
    lastTransitionTime: "2022-07-19T22:59:04Z"
    message: Application resource becaame Healthy, updating status from Progressing
      to Healthy.
    observedGeneration: 4
    status: Healthy
  - application: hello-world-nginx-awscmhqa2
    lastTransitionTime: "2022-07-19T23:01:12Z"
    message: Application resource becaame Healthy, updating status from Progressing
      to Healthy.
    observedGeneration: 4
    status: Healthy

@wmgroot wmgroot changed the base branch from master to release-2.4 July 11, 2022 18:43
@wmgroot wmgroot force-pushed the wmgroot/ISS-9437/appset-progressive-sync branch 3 times, most recently from a06af6f to 38d9dd9 Compare July 11, 2022 21:21
@wmgroot wmgroot force-pushed the wmgroot/ISS-9437/appset-progressive-sync branch from 38d9dd9 to c23b372 Compare July 11, 2022 22:09
@wmgroot
Copy link
Owner Author

wmgroot commented Jul 19, 2022

Closing in favor of the official PR here.
argoproj#10048

@wmgroot wmgroot closed this Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants