# Add a component

> Create a component file, pass local checks, and submit a pull request with signed-off commits.

Choose a capability and an upstream project, create a component file, run local checks, and submit a pull request. When you're done, you'll have a component file that passes the checks and a pull request.

## Before you begin

- Use `nix develop` to get Go, Helm, kubectl, kubeconform, etcd, kube-apiserver, and kind.
- `smoke` and `full` checks also require Docker on Linux.

### Choose a capability and an upstream project

Choose a capability (a category of functionality) and an upstream project with an OSI-approved license. Prefer CNCF or Kubernetes SIG projects.

If the license is `optInOnly` (such as `SSPL-1.0`), every profile must mark the component as `optional` or `unsupported`.

### Create a component file

Use a similar component as a reference to create `components/<id>/component.yaml`, and its READMEs next to it. The ID is the upstream's name, such as `traefik`. Name the capability in `provides`, such as `provides: {capability: ingress}`.

Specify configuration values for each of the two profiles (configuration sets), `single-node` and `multi-node`, and add a comment for each profile explaining the choice.

### Run local checks

Run the following commands:

```sh
cargo run -p zeabur-catalog -- check         # schema, license, references, comments
cargo run -p zeabur-catalog -- render        # helm template + kubeconform
go run ./tools/cmd/catalog e2e -tier check   # what every pull request runs
go run ./tools/cmd/catalog e2e -tier full <id>
```

`validate` checks the schema, license, references, and comments. `render` runs `helm template` and kubeconform. Every pull request runs the `check` tier.

### Submit a pull request

Use `git commit -s` to create a signed-off commit, then open a pull request.
