Naiserator is a Kubernetes operator that handles the lifecycle of nais.io/Application and nais.io/Naisjob.
The main goal of Naiserator is to simplify application deployment by providing a high-level abstraction tailored for the Nais platform.
When an Application resource is created in Kubernetes, usually with Nais deploy,
Naiserator will generate several other Kubernetes resources that work together to form a complete deployment.
The contents of these resources are heavily dependent on per-cluster and per-application configuration.
Resources will remain in Kubernetes until the Application resource is deleted, upon which they will be removed.
Additionally, any unneeded resources will be automatically deleted upon next deploy
if disabled by feature flags or is lacking in a application manifest.
Kubernetes built-ins:
Deployment,JoborCronJobthat runs program executables,HorizontalPodAutoscalerfor automatic application scaling,Ingressadding TLS termination and virtualhost support,NetworkPolicyfor firewall configuration,PodDisruptionBudgetfor controlling how the application should be shut down or restart by Kubernetes,PodMonitorfor Prometheus integration,RoleandRoleBindingneeded for Leader election sidecar,Secretfor stuff that shouldn't be shared with anyone,ServiceAccountfor granting correct permissions to managed resources,Servicewhich points to the application endpoint.
Nais resources for external system provisioning:
AivenApplicationfor Aivenator,AzureAdApplicationfor Azurerator,IDPortenClientandMaskinportenClientfor Digdirator,Jwkerfor Jwker,Streamfor Kafkarator.
Google CNRM resources for Google Cloud Platform provisioning:
BigQueryDatasetfor BigQuery,IAMServiceAccount,IAMPolicyandIAMPolicyMemberfor workload identity,PubSubSubscriptionfor PubSub,SQLInstance,SQLUserandSqlDatabasefor Cloud SQL,StorageBucketfor Storage Buckets
The entire specification for the manifest is generated by Naiserator's companion library, liberator, and committed to the Nais end-user documentation.
Runs on Kubernetes v1.30.0 or later.
When GCP features are enabled, Naiserator must run on Google Kubernetes Engine together with CNRM.
See charts/naiserator for a installable Helm chart.
- The Go programming language, version indicated by go.mod
- liberator
- goimports
- Docker Desktop or other Docker release compatible with Kubernetes
- Kubernetes, either through minikube or a local cluster
Try these:
mise run test
mise run build
mise run local
Whenever an Application is deployed, a deployment event message is sent to a Kafka topic. There's a few prerequisites to develop with this enabled locally:
- Protobuf installed
- An instance of kafka to test against. Use
docker-compose upto bring up a local instance. - Enable this feature by passing
-kafka-enabled=truewhen starting Naiserator.
Whenever the Protobuf definition is updated you can update using mise run proto. It will download the definitions, compile
and place them in the correct packages.
The image is signed "keylessly" (is that a word?) using Sigstore cosign. To verify its authenticity run
cosign verify \
--certificate-identity "https://github.com/nais/naiserator/.github/workflows/deploy.yaml@refs/heads/master" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/nais/naiserator/naiserator@sha256:<shasum>
The images are also attested with SBOMs in the CycloneDX format. You can verify these by running
cosign verify-attestation --type cyclonedx \
--certificate-identity "https://github.com/nais/naiserator/.github/workflows/deploy.yaml@refs/heads/master" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/nais/naiserator/naiserator@sha256:<shasum>