Skip to content

Feature Request: Allow ArtifactGenerator to create ExternalArtifact in other namespaces #354

Description

@matheuscscp

A common use case Flux users have is a multi-tenant monorepo containing the YAML for all tenants. ArtifactGenerator does not support it today because it can only create ExternalArtifact in the same namespace as the ArtifactGenerator, which breaks multi-tenancy i.e. it requires cross-namespace source references in appliers, which in a multi-tenant setup are blocked.

For allowing ExternalArtifact to be created in a different namespace (i.e. not the namespace of the ArtifactGenerator producing it), we need to introduce two fields:

  • .spec.artifacts[].namespace
  • .spec.serviceAccountName

CRD XValidation via CEL expressions must block .namespace from being used when .serviceAccountName is not specified.

When .serviceAccountName is specified, source-watcher will impersonate the ServiceAccount for reconciling the ExternalArtifact objects. This means the ServiceAccount will require the necessary RBAC bindings. Because RBAC allows cross-namespace access for ServiceAccounts (since a ServiceAccount is really just a username at the end of the day and RBAC has no concept of namespaces for username), this will allow ExternalArtifact to be created in other namespaces, which in turn will allow cross-namespace source references to remain blocked for multi-tenant setups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions