Overview
AppProject is a Custom Resource Definition (CRD) that provides:- Source restrictions - Control which Git repositories can be deployed
- Destination restrictions - Control where apps may be deployed (clusters and namespaces)
- Resource restrictions - Control what kinds of Kubernetes objects can be deployed
- RBAC - Define project roles with fine-grained permissions
AppProject CRD Structure
The Default Project
Every application belongs to a project. If unspecified, applications belong to thedefault project.
Default Project Specification
Thedefault project is created automatically with permissive settings:
Locking Down Default Project
To prevent accidental use of the overly-permissive default project:Creating Projects
- Declarative (YAML)
- CLI
Source Repository Restrictions
Control which Git repositories can be used:Allow Specific Repositories
Using Wildcards
Denying Repositories
Use! prefix to explicitly deny repositories:
A repository is valid if ANY allow rule permits it AND NO deny rule rejects it. The pattern
!* is invalid.Managing Sources via CLI
Destination Restrictions
Control where applications can deploy:Specific Destinations
Using Cluster Names
Denying Destinations
Managing Destinations via CLI
Resource Restrictions
Cluster-Scoped Resources (Whitelist)
Only explicitly allowed cluster-scoped resources can be deployed:Restrict by Name
Namespace-Scoped Resources (Blacklist)
All namespace-scoped resources are allowed except those blacklisted:Managing Resources via CLI
Project Roles and RBAC
Define roles within projects for fine-grained access control:Available Actions
Roles can control access to multiple resource types:applications- Application resourcesapplicationsets- ApplicationSet resourcesrepositories- Repository credentialsclusters- Cluster credentialslogs- Application logsexec- Exec into pod containers
Managing Roles via CLI
JWT Tokens for Automation
Generate JWT tokens for programmatic access:Using JWT Tokens
Sync Windows
Define time windows when syncs are allowed or denied:Source Namespaces
Restrict which namespaces can contain ApplicationSet resources:Project-Scoped Repositories and Clusters
Allow developers to add repositories and clusters to projects:RBAC Configuration
Adding Project-Scoped Repository
- CLI
- Declarative
Restrict to Project-Scoped Clusters
Force applications to only use clusters belonging to the same project:project: my-project in their Secret.
Global Projects
Define global projects that other projects can inherit from:- namespaceResourceBlacklist
- namespaceResourceWhitelist
- clusterResourceBlacklist
- clusterResourceWhitelist
- syncWindows
- sourceRepos
- destinations
Destination Service Accounts
Specify service accounts for application deployments:Best Practices
Use descriptive names
Name projects after teams or applications for clarity
Principle of least privilege
Start restrictive and add permissions as needed
Leverage deny patterns
Use
! patterns to explicitly block dangerous operationsImplement sync windows
Use sync windows for production change management
Enable project-scoped repos
Give teams self-service capabilities with proper RBAC
Use global projects
Share common policies across multiple projects