Skip to content

NebariApp CRD Reference

Updated 3 min read

Complete field-by-field reference for the NebariApp custom resource.

API Version: reconcilers.nebari.dev/v1 Kind: NebariApp Source: nebari-operator/api/v1/nebariapp_types.go

apiVersion: reconcilers.nebari.dev/v1
kind: NebariApp
metadata:
name: my-pack
namespace: my-pack
spec:
hostname: my-pack.nebari.example.com
service:
name: my-pack
port: 80
routing:
routes:
- pathPrefix: /
pathType: PathPrefix
tls:
enabled: true
auth:
enabled: true
provider: keycloak
provisionClient: true
enforceAtGateway: true
redirectURI: /
scopes:
- openid
- profile
- email
groups:
- admin
gateway: public
FieldTypeRequiredDefaultDescription
hostnamestringYes-FQDN where the app will be accessible. Used to generate HTTPRoute and TLS certificate. Must match pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$.
serviceServiceReferenceYes-The backend Kubernetes Service that receives traffic.
routingRoutingConfigNo-Routing behavior including path rules and TLS.
authAuthConfigNo-Authentication/authorization configuration.
gatewaystringNo"public"Which shared Gateway to use. Valid values: public, internal.
FieldTypeRequiredDefaultDescription
namestringYes-Name of the Kubernetes Service in the same namespace.
portint32Yes-Port number on the Service to route traffic to. Range: 1-65535.
FieldTypeRequiredDefaultDescription
routes[]RouteMatchNo-Path-based routing rules. If omitted, all traffic to the hostname is routed to the service.
tlsRoutingTLSConfigNo-TLS certificate management configuration.
FieldTypeRequiredDefaultDescription
pathPrefixstringYes-Path prefix to match. Must start with /. Examples: /, /api/v1, /dashboard.
pathTypestringNo"PathPrefix"How the path is matched. Values: PathPrefix (match prefix), Exact (exact match).
FieldTypeRequiredDefaultDescription
enabled*boolNotrueWhether to provision a TLS certificate via cert-manager and configure an HTTPS listener on the Gateway. When false, only HTTP listeners are used.
FieldTypeRequiredDefaultDescription
enabledboolNofalseWhether to enforce OIDC authentication.
providerstringNo"keycloak"OIDC provider. Values: keycloak, generic-oidc.
provisionClient*boolNotrueAuto-provision an OIDC client in the provider. Only supported for keycloak. The operator creates the client and stores credentials in a Secret.
enforceAtGateway*boolNotrueCreate an Envoy Gateway SecurityPolicy for gateway-level auth. When false, the operator provisions the client and Secret but does NOT create a SecurityPolicy - the app handles OAuth natively (e.g., Grafana’s built-in OAuth).
redirectURIstringNo"/oauth2/callback"OAuth2 callback path. The full URL is https://<hostname><redirectURI>.
clientSecretRef*stringNo-Reference to a Secret containing client-id and client-secret. If omitted and provisionClient is true, the operator creates <name>-oidc-client.
scopes[]stringNo["openid", "profile", "email"]OIDC scopes to request during authentication.
groups[]stringNo-Groups that have access. When specified, only users in these groups are authorized. Case-sensitive.
issuerURLstringNo-OIDC issuer URL. Required when provider=generic-oidc, ignored for keycloak. Example: https://accounts.google.com.

The operator sets conditions on the NebariApp status to indicate readiness:

ConditionDescription
RoutingReadyHTTPRoute has been created and the Gateway is routing traffic.
TLSReadyTLS certificate is provisioned and the HTTPS listener is configured.
AuthReadySecurityPolicy is created and OIDC client is available. Only set when auth.enabled=true.
ReadyAggregate condition - all components are ready.
ReasonDescription
AvailableResource is functioning correctly.
ReconcilingReconciliation is in progress.
ReconcileSuccessReconciliation completed successfully.
ValidationSuccessValidation passed successfully.
NamespaceNotOptedInNamespace is missing the nebari.dev/managed=true label.
ServiceNotFoundThe referenced Service does not exist in the namespace.
SecretNotFoundThe referenced Secret does not exist.
GatewayNotFoundThe target Gateway does not exist.
CertificateNotReadyThe cert-manager Certificate is not yet ready.
FailedReconciliation failed.

The namespace containing the NebariApp must be labeled for the operator to process it:

Terminal window
kubectl label namespace my-pack nebari.dev/managed=true

Without this label, the NebariApp will show NamespaceNotOptedIn and no resources will be created.

The NebariApp resource can be included in your pack using any deployment method.

The NebariApp is just another manifest file alongside your Deployment and Service:

nebariapp.yaml
apiVersion: reconcilers.nebari.dev/v1
kind: NebariApp
metadata:
name: my-pack
spec:
hostname: my-pack.nebari.example.com
service:
name: my-pack
port: 80

When deploying standalone (without Nebari), skip this file in your kubectl apply.

Include the NebariApp in your base kustomization.yaml and use overlays to patch environment-specific values like hostname and auth:

overlays/production/nebariapp-patch.yaml
apiVersion: reconcilers.nebari.dev/v1
kind: NebariApp
metadata:
name: my-pack
spec:
hostname: my-pack.nebari.example.com
auth:
enabled: true
groups:
- admin

In Helm charts, you can make the NebariApp conditional so the chart works both standalone and on Nebari:

{{- if .Values.nebariapp.enabled }}
apiVersion: reconcilers.nebari.dev/v1
kind: NebariApp
metadata:
name: {{ include "my-pack.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "my-pack.labels" . | nindent 4 }}
spec:
hostname: {{ required "nebariapp.hostname is required" .Values.nebariapp.hostname }}
service:
name: {{ .Values.nebariapp.service.name | default (include "my-pack.fullname" .) }}
port: {{ .Values.nebariapp.service.port | default 80 }}
{{- with .Values.nebariapp.auth }}
auth:
enabled: {{ .enabled | default false }}
provider: {{ .provider | default "keycloak" }}
provisionClient: {{ .provisionClient | default true }}
redirectURI: {{ .redirectURI | default "/" }}
{{- with .scopes }}
scopes:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}

The corresponding values.yaml section:

nebariapp:
enabled: false
# hostname: my-pack.nebari.example.com # Required when enabled
service:
name: "" # Defaults to release fullname
port: 80
auth:
enabled: false
provider: keycloak
provisionClient: true
redirectURI: /
scopes:
- openid
- profile
- email
gateway: public