Skip to content

Projects feature design

Alexander Matyushentsev edited this page Jun 19, 2018 · 1 revision

Projects

Use cases

  • RBAC: user selects one project for each application and then configure application access using projects instead of repository URLs.
  • control where the application can be deployed:
    • user defines list of clusters/namespaces which are available for project;
    • controller deploys application only if target cluster/namespace is available in application project;
  • projects provide a convenient filter on applications list page;

Data Schema

  • Project is defined by new CRD (argoproj.io/v1alpha1 Project). The project has following fields: name, description, app_destinations. The app_destinations field contains a list of cluster/namespaces and defines where project applications can be deployed. For user convenience ArgoCD provides default project. Default project is not stored in CRD; an application which belongs to default project can be deployed into any cluster and any namespace.

  • Application belongs to a project. The relationship is stored in label applications.argoproj.io/project. Label is chosen since it allows to filter using Kubernetes API. Missing/empty/invalid labels means that application belongs to default project.

API changes

  • New CRUD APIs for project management: GET, POST, DELETE, UPDATE /api/v1/projects/<id>
  • Application APIs allows to set application project: POST /api/v1/applications and PUT /api/v1/applications/{id} now accept project field.
  • Application list API supports filtering by project: GET /api/v1/applications accept projects parameter which contains list of project names. Empty string in projects filter means default project.
  • Session API changes - new APIs to get current user permissions. Required hide project management UI if project management is disabled.

UI changes:

  • Project management UI - allows to create, delete, update projects. Should be available only to administrators. Availability is controlled by RBAC.
  • Application creation wizard - user should be able to choose application project.
  • New filter on applications list page.
  • Move to project action on application details page.

UI changes should be visible only if project management is enabled, otherwise, UI should looks the same.