Map environments and apps in project.yaml
project.yaml is the source of truth for the Infra console. It lists your environments (a saved connection name plus a concrete namespace) and your applications (a name plus a Pod label selector). Every Infra page combines the selected environment and application to decide what to read from the cluster.
Edit it under 项目映射 (Project mapping) in the Infra sidebar, or let the Connect K3s wizard add entries for you. It contains no credentials.
Example
apiVersion: devopspad.project/v1
name: Local apps
environments:
- name: pro
connection: local-k3s
namespace: default
- name: dev
connection: local-k3s
namespace: dev
applications:
- name: svc-user
selector: app=svc-user
- name: svc-api
selector: app=svc-api
nginxPath: /etc/nginx/conf.d/svc-api.conf
Fields and rules
| Field | Rule |
|---|---|
apiVersion |
Must be devopspad.project/v1 |
name |
Project name, required, up to 120 characters |
environments[].name |
Unique; lowercase letters, digits and hyphens, up to 63 characters |
environments[].connection |
Name of a Kubernetes/K3s connection saved in DevOpsPad on this machine |
environments[].namespace |
A concrete namespace (no *) |
applications[].name |
Unique; same naming rule as environments |
applications[].selector |
Kubernetes label selector matching the app’s Pods, for example app=svc-api |
applications[].nginxPath |
Optional. A .conf file directly under /etc/nginx/conf.d/ on the host |
A project can have up to 32 environments and 500 applications. The file must contain a single YAML document. Unknown or invalid values are rejected when you save, with a message saying which entry is wrong.
Pods are matched against the full label selector, including matchExpressions on the workload. A Deployment counts as part of an application if either its own labels or its Pod template labels match.
Editing in the app
- 格式化 YAML (Format YAML) reflows long lines.
- 导出 YAML (Export YAML) saves a copy.
- Saving checks that the file has not changed on disk since you opened it. If someone else edited it — another DevOpsPad window,
devopspadctl, or agit pull— your edits are kept and you are asked to refresh and merge.
Where the file lives
The project directory defaults to ~/Library/Application Support/DevOpsPad/applications on macOS (os.UserConfigDir()/DevOpsPad/applications elsewhere). Choose another folder under 共享与同步 (Sharing & sync) → 选择目录 (Choose directory). The directory holds:
project.yaml # environments and applications
artifacts/<uuid>.yaml # one index file per registered image
releases/<uuid>.json # one record per desktop release, scale, restart or rollback
runs/<uuid>.json # AI build and external release records
Files are written atomically with 0600 permissions, and concurrent writers are serialized with a .devopspad-write.lock file. If a crash leaves that lock behind, check that no DevOpsPad or devopspadctl process is running before deleting it.
Sharing with a small team
Clone one Git repository on each machine and choose its root as the project directory. Under 共享与同步:
- 查看状态 (View status) shows the branch and working tree state.
- 提交并推送 (Commit and push) commits only valid project files —
project.yaml, artifact indexes, release and run records — and pushes. A failed push keeps the local commit. - 拉取更新 (Pull updates) runs
git pull --ff-onlyand requires a clean working tree. Diverged branches must be merged in a terminal; DevOpsPad never resets or force-pushes.
Sync is manual and Git-based. It is not real-time collaboration, and it never shares kubeconfig files or keychain secrets. Don’t put the project directory on a network share that several machines write to at once.