# Oncall v2 dev deployment (aisupport)

## Added artifacts

Image build:
- `infra/images/oncall-v2/Dockerfile`

Kustomize base:
- `infra/kustomize/base/oncall-v2/kustomization.yaml`
- `infra/kustomize/base/oncall-v2/service.yml`
- `infra/kustomize/base/oncall-v2/deployment.yml`
- `infra/kustomize/base/oncall-v2/ingress.yml`

Kustomize dev overlay:
- `infra/kustomize/envs/dev/oncall-v2/kustomization.yaml`
- `infra/kustomize/envs/dev/oncall-v2/namespace.yml`
- `infra/kustomize/envs/dev/oncall-v2/configmap.yml`
- `infra/kustomize/envs/dev/oncall-v2/patch-deployment.yml`
- `infra/kustomize/envs/dev/oncall-v2/ingress.yml`
- `infra/kustomize/envs/dev/oncall-v2/oncall-v2-external-secret.yml`

## Dev authing policy

In dev overlay configmap:
- `APP_ENV=dev`
- `AUTHING_ENABLED=false`

So dev disables authing by default and uses bypass identity.

## Build image (example)

From repo root:

```bash
docker build -f infra/images/oncall-v2/Dockerfile -t oncall-v2:dev .
```

Push to your ECR repo and update `newName/newTag` in:
- `infra/kustomize/envs/dev/oncall-v2/kustomization.yaml`

## Render and apply

```bash
kubectl kustomize infra/kustomize/envs/dev/oncall-v2
kubectl apply -k infra/kustomize/envs/dev/oncall-v2
```

## Notes

1. Ingress path currently exposes `/api1` to service `oncall-v2`.
2. Feishu secrets are optional in deployment (`optional: true`).
3. ExternalSecret expects remote key `aisupport-dev/oncall-v2` with:
   - `FEISHU_APP_ID`
   - `FEISHU_APP_SECRET`
4. DB uses emptyDir in dev (`/var/lib/oncall-v2/oncall_v2.db`), so data is ephemeral.
