Skip to content
naisPublic

About

Nais feature management

Resources

Stars

5 stars

Watchers

2 watching

Forks

Repository files navigation

Fasit

Fasit is a multi-tenant feature management platform. It deploys OCI Helm charts — called features — across environments, using label-based targeting and automatic reconciliation.

How it works

  Feature author
       │
       ├─── push chart ───────► OCI Registry
       │                              ▲
       └─── create assignment ──┐     │
                                ▼     │
     ┌────── Fasit ─────────────────────────────┐
     │                                          │
     │  Desired state        Reconciler         │
     │  ┌─────────────┐         │               │
     │  │ assignment  │────► compare ◄──────┐   │
     │  │ config      │         │           │   │
     │  │ env values  │    deploy instr.    │   │
     │  └─────────────┘         │           │   │
     │                          │           │   │
     └──────────────────────────┼───────────┼───┘
                                ▼           │
                      ┌──────────────────┐  │
                      │  Environment     │  │
                      │                  │  │
                      │  naisd ► helm    │  │
                      │                  │  │
                      │  Actual state    │──┘
                      │  feature @ v1.2  │ (status report)
                      └──────────────────┘
  1. A feature is an OCI Helm chart with a Feature.yaml that declares its configurable values.
  2. A feature author creates an assignment — handing a feature version to Fasit with a set of target labels (e.g. tenant=nav, env=prod).
  3. Fasit matches the assignment to all environments whose labels are a superset of the target.
  4. The reconciler renders helm values for each matched environment and sends deploy instructions to the naisd agent running there.
  5. naisd executes helm install/upgrade and reports status back.

When configs, environment values, or feature versions change, the reconciler detects the drift and re-deploys automatically.

Documentation

  • Concepts — environments, features, assignments, values, reconciliation
  • Authoring a Feature — Feature.yaml spec, templates, template functions

Components

Component Role
fasit HTTP/gRPC server, web UI, reconciler, deployment orchestration
naisd Per-environment agent that executes Helm and reports status

Local development

mise install              # install tools
cp .env.example .env     # configure environment
mise run setup            # start postgres, seed database
mise run dev              # run fasit with auto-reload

Local development runs an in-process fake naisd (FASIT_FAKE_NAISD=true in .env), so no Pub/Sub emulator or separate naisd process is needed. The fake simulates Helm deploys and reports status, release state and health back to the reconciler. FASIT_FAKE_NAISD_FAILING_ENVS / FASIT_FAKE_NAISD_UNHEALTHY_ENVS reproduce a demo mix of FAILED and PENDING features.

See mise run --list for all available tasks.

Slack deploy failure mentions

Failed Helm deploy alerts can mention the actor of a recent change in the five minutes before the first recorded deploy instruction: creation of the exact assignment or a config change for the same feature and environment. Global config and known description-only edits are ignored. If the newest candidate can't be verified (for example, a secret update), actors are ambiguous, or the actor has no Slack mapping, the alert is sent without a mention, not with an older actor.

This is a best-effort hint. It does not check whether the config key was used; the recorded instruction timestamp does not guarantee that the deployment included a particular change or that the change caused the failure.

Fasit maps audit identities directly to Slack member IDs, without GitHub or Slack identity lookups. The Helm deployment optionally reads a separately maintained Secret in the nais-io cluster:

apiVersion: v1
kind: Secret
metadata:
  name: fasit-slack-users
  namespace: nais-system
type: Opaque
stringData:
  SLACK_GITHUB_USERS: |
    {"github-user": "U0123456789"}
  SLACK_EMAIL_USERS: |
    {"user@nais.io": "U0123456789"}

GitHub logins are matched case-insensitively; email addresses are matched exactly. Use the same Slack member ID for both identities of a person. Keep populated mappings outside this repository. No Terraform changes or users:read.email permission are required.

If the Secret, mapping, or audit history is missing, Fasit sends the usual alert without a mention and logs the reason. Invalid supplied JSON or mapping entries cause a configuration error at startup. Restart the pods after updating the Secret, since it is read through environment variables.

Testing

mise run test             # unit + integration tests
mise run test:unit        # unit tests only
mise run test:integration # integration tests (requires testcontainers)

JSON Schema

Enable IDE autocompletion/validation for Feature.yaml:

https://storage.googleapis.com/fasit-jsonschema/feature.json

License

MIT

About

Nais feature management

Resources

Stars

5 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages