{"id":13769086,"url":"https://github.com/Skyscanner/applicationset-progressive-sync","last_synced_at":"2025-05-11T01:31:40.657Z","repository":{"id":37424960,"uuid":"333692417","full_name":"Skyscanner/applicationset-progressive-sync","owner":"Skyscanner","description":"Progressive sync controller for Argo ApplicationSet","archived":false,"fork":false,"pushed_at":"2023-10-03T05:30:35.000Z","size":427,"stargazers_count":131,"open_issues_count":30,"forks_count":4,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-29T01:42:11.167Z","etag":null,"topics":["applicationset","argocd","cd","kubernetes","progressive-sync"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Skyscanner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS.md","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-01-28T08:22:19.000Z","updated_at":"2025-04-27T03:23:38.000Z","dependencies_parsed_at":"2024-01-12T09:46:01.145Z","dependency_job_id":null,"html_url":"https://github.com/Skyscanner/applicationset-progressive-sync","commit_stats":null,"previous_names":["skyscanner/argocd-progressive-rollout"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyscanner%2Fapplicationset-progressive-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyscanner%2Fapplicationset-progressive-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyscanner%2Fapplicationset-progressive-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyscanner%2Fapplicationset-progressive-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Skyscanner","download_url":"https://codeload.github.com/Skyscanner/applicationset-progressive-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253504544,"owners_count":21918827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applicationset","argocd","cd","kubernetes","progressive-sync"],"created_at":"2024-08-03T17:00:17.027Z","updated_at":"2025-05-11T01:31:40.329Z","avatar_url":"https://github.com/Skyscanner.png","language":"Go","funding_links":[],"categories":["Ecosystem Projects","kubernetes"],"sub_categories":[],"readme":"# applicationset-progressive-sync\n\n`applicationset-progressive-sync` is a controller to allow a progressive sync of ArgoCD Applications generated by an ApplicationSet.\n\n## Motivation\n\n[Argo ApplicationSet](https://github.com/argoproj-labs/applicationset) is being developed as the solution to replace the `app-of-apps` pattern.\n\nWhile `ApplicationSet` is great to programmatically generate ArgoCD Applications, we will still need to solve _how_ to update the Applications.\n\nIf we enable the `auto-sync` policy, we will update all the generated Applications at once.\n\nThis might not be a problem if we have only one production cluster, but organizations with tens or hundreds of clusters need to avoid a global rollout. They need to release new versions of their application in a safer way.\n\nThe `applicationset-progressive-sync` controller allows operators and developers to decide _how_ they want to update their Applications.\n\n## Example `spec`\n\n```yaml\napiVersion: argoproj.skyscanner.net/v1alpha1\nkind: ProgressiveSync\nmetadata:\n  name: myprogressivesync\n  namespace: argocd\nspec:\n  # a reference to the target ApplicationSet in the same namespace\n  appSetRef:\n    name: myappset\n    # the rollout steps\n  # app sync options\n  syncOptions:\n    # enable prune resources during sync, disabled by default\n    prune: true\n  stages:\n      # human friendly name\n    - name: two clusters as canary in EMEA\n      # how many targets to update in parallel\n      # can be an integer or %.\n      maxParallel: 2\n      # how many targets to update from the selector result\n      # can be an integer or %.\n      maxTargets: 2\n      # which targets to update\n      targets:\n        clusters:\n          selector:\n            matchLabels:\n              area: emea\n    - name: rollout to remaining clusters\n      maxParallel: 2\n      maxTargets: 4\n      targets:\n        clusters:\n          selector: {}\n```\n\n## Status: `pre-alpha`\n\nExpect a non-functional controller and breaking changes until Milestone 2 is completed.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n## Configuration\n\nThe controller connects to an Argo CD server and requires configuration to do so:\n\n```console\nARGOCD_AUTH_TOKEN: \u003ctoken of the Argo CD user\u003e\nARGOCD_SERVER_ADDR: \u003caddress of the Argo CD server\u003e\nARGOCD_INSECURE: \u003ctrue/false\u003e\n```\n\nThe above configuration is loaded taking into account the following priority order:\n\n1. Environment Variables.\n\n```console\nARGOCD_AUTH_TOKEN=ey...\nARGOCD_SERVER_ADDR=argocd-server\nARGOCD_INSECURE=true\n```\n\n1. Files in the Config Directory (`/etc/applicationset-progressive-sync/`).\n\n```console\n/etc/\n├── applicationset-progressive-sync/\n│   ├── ARGOCD_AUTH_TOKEN  # file content: ey...\n│   ├── ARGOCD_SERVER_ADDR # file content: argocd-server\n│   ├── ARGOCD_INSECURE    # file content: true\n```\n\nIf at least one of the options is missing, the controller will **fail** to start.\n\n## Development\n\n### Local development with Kubebuilder\n\nTo get the controller running against the configured Kubernetes cluster in ~/.kube/config, run:\n\n```shell\nmake install\nmake run\n```\n\nPlease remember the `ARGOCD_AUTH_TOKEN`, `ARGOCD_SERVER_ADDR` and `ARGOCD_INSECURE`  environment variables need to be present in order\nto run against a Kubernetes cluster with Argo CD. If the cluster was configured using the `hack/setup-dev.sh` script,\nthese variables are part of the `.env.local` file.\n\n### Deploying to a Kubernetes cluster\n\nTo deploy the controller to a Kubernetes cluster, run:\n\n```shell\nmake install\nmake docker-build\nmake deploy\n```\n\nIn order to do so, the target cluster needs to have a secret named `prc-config` containing the three necessary\nvariables: `ARGOCD_AUTH_TOKEN`, `ARGOCD_SERVER_ADDR` and `ARGOCD_INSECURE`. If using the dev environment\nin the following section, this secret has already been created.\n\nIf using `kind` clusters, docker images need to be loaded manually using `kind load docker-image \u003cimage\u003e:\u003cversion\u003e --name \u003ccluster-name\u003e`.\n\n#### Configuration Secret\n\nHere's a sample secret of the necessary configuration:\n\n```yaml\napiVersion: v1\ndata:\n  ARGOCD_AUTH_TOKEN: ey...\n  ARGOCD_INSECURE: true\n  ARGOCD_SERVER_ADDR: argocd-server\nkind: Secret\nmetadata:\n  name: prc-config\n  namespace: argocd\ntype: Opaque\n```\n\n### Setting up dev environment\n\nTo facilitate local debugging and testing against real clusters, you may run:\n\n```shell\nbash hack/install-dev-deps.sh\nbash hack/setup-dev.sh [argocd-version] [appset-version]\nmake install\nmake deploy\n```\n\nthis will install all the dependencies (`pre-commit`, `kubebuilder`, `argocd`, `kind`) and it will install the correct version of ArgoCD Application API package for you. If you omit `argocd-version` and/or `appset-version` it will default to the latest stable/tested versions of ArgoCD and Appset controller.\n\nAfter running the script, you will have 3 kind clusters created locally:\n\n- `kind-argocd-control-plane` - cluster hosting the argocd installation and the progressive sync operator. This cluster is also registered with Argo so that we can simulate using the same process for deploying to control cluster as well\n- `kind-prc-cluster-1` and `kind-prc-cluster-2` - are the target clusters for deploying the apps to.\n\nThis gives us a total of 3 clusters allowing us to play with multiple stages of deploying. It will also log you in argocd cli. You can find additional login details in `.env.local` file that will be generated for your convenience.\n\n#### Regenerating your access\n\nIn case that your access to the local argocd has become broken, you can regenerate it by running\n\n```shell\nbash hack/login-argocd-local.sh\n```\n\nThis will create a socat link in kind docker network allowing you to access argocd server UI through your localhost.\nThe exact port will be outputted after the command has been run. Running this command will also update the values in `.env.local`.\n\n#### Registering additional clusters\n\nIf you want to create additional clusters, you can do so by running:\n\n```shell\nbash hack/add-cluster \u003ccluster-name\u003e \u003crecreate\u003e \u003clabels\u003e\n```\n\nThis will spin up another kind cluster and register it against ArgoCD running in `kind-argocd-control-plane`\n\n#### Deploying local test resources\n\nYou can deploy a test appset and a progressive sync object to your kind environment via:\n\n```shell\nbash hack/redeploy-dev-resources.sh\n```\n\nFeel free to extend the cluster generation section of the appset spec if you want to deploy it clusters that you have manually created.\n\n### Debugging\n\n```shell\nmake debug\n```\n\nInvoking the command above should spin up a Delve debugger server in headless mode. You can then use your IDE specific functionality or the delve client itself to attach to the remote process and debug it.\n\n**NOTE**: On MacOSX, delve is currently unkillable in headless mode with `^C` or any other control signals that can be sent from the same terminal session. Instead, you'd need to run\n\n``` shell\nbash ./hack/kill-debug.sh\n```\n\nor\n\n``` shell\nmake debug\n```\n\nfrom another terminal session to kill the debugger.\n\n### Debugging tests\n\nDelve can be used to debug tests as well. See `Test` launch configuration in `.vscode/launch.json`. Something similar should be achievable in your IDE of choice as well.\n\n#### Update ArgoCD Application API package\n\nBecause of [https://github.com/argoproj/argo-cd/issues/4055](https://github.com/argoproj/argo-cd/issues/4055) we can't just run `go get github.com/argoproj/argo-cd`.\n\nUse `hack/install-argocd-application.sh` to install the correct version of the Application API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSkyscanner%2Fapplicationset-progressive-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSkyscanner%2Fapplicationset-progressive-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSkyscanner%2Fapplicationset-progressive-sync/lists"}