<style>
/* Make the ... appear in front of the spec items in the right hand nav menu  */
.md-sidebar--secondary span.md-ellipsis {
	direction: rtl;
}
</style>

# Nais Application reference

<!--
  This documentation was automatically generated by the liberator pipeline.
  See https://github.com/nais/liberator/actions for details.
  
  DO NOT MAKE MANUAL CHANGES TO THIS FILE, THEY WILL BE OVERWRITTEN!
-->

This document describes all possible configuration values in the `Application` spec, commonly known as the `nais.yaml` file.

## accessPolicy

By default, no traffic is allowed between applications inside the cluster.
Configure access policies to explicitly allow communication between applications.
This is also used for granting inbound access in the context of Azure AD and TokenX clients.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/workloads/explanations/zero-trust/](https://doc.dev-nais.cloud.nais.io/workloads/explanations/zero-trust/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     inbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
>         - application: app4
>           permissions:
>             scopes:
>               - custom-scope
>         - application: app5
>           permissions:
>             roles:
>               - custom-role
>         - application: app6
>           permissions:
>             roles:
>               - custom-role
>             scopes:
>               - custom-scope
>     outbound:
>       external:
>         - host: external-application.example.com
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>         - ipv4: 1.2.3.4
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
> ```

### accessPolicy.inbound

Configures inbound access for your application.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     inbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
>         - application: app4
>           permissions:
>             scopes:
>               - custom-scope
>         - application: app5
>           permissions:
>             roles:
>               - custom-role
>         - application: app6
>           permissions:
>             roles:
>               - custom-role
>             scopes:
>               - custom-scope
> ```

#### accessPolicy.inbound.rules

List of Nais applications that may access your application.
These settings apply both to Zero Trust network connectivity and token validity for Azure AD and TokenX tokens.

Type: `array`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     inbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
>         - application: app4
>           permissions:
>             scopes:
>               - custom-scope
>         - application: app5
>           permissions:
>             roles:
>               - custom-role
>         - application: app6
>           permissions:
>             roles:
>               - custom-role
>             scopes:
>               - custom-scope
> ```

##### accessPolicy.inbound.rules[].application

The application's name.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     inbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
>         - application: app4
>           permissions:
>             scopes:
>               - custom-scope
>         - application: app5
>           permissions:
>             roles:
>               - custom-role
>         - application: app6
>           permissions:
>             roles:
>               - custom-role
>             scopes:
>               - custom-scope
> ```

##### accessPolicy.inbound.rules[].cluster

The application's cluster. May be omitted if it should be in the same cluster as your application.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     inbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
>         - application: app4
>           permissions:
>             scopes:
>               - custom-scope
>         - application: app5
>           permissions:
>             roles:
>               - custom-role
>         - application: app6
>           permissions:
>             roles:
>               - custom-role
>             scopes:
>               - custom-scope
> ```

##### accessPolicy.inbound.rules[].namespace

The application's namespace. May be omitted if it should be in the same namespace as your application.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     inbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
>         - application: app4
>           permissions:
>             scopes:
>               - custom-scope
>         - application: app5
>           permissions:
>             roles:
>               - custom-role
>         - application: app6
>           permissions:
>             roles:
>               - custom-role
>             scopes:
>               - custom-scope
> ```

### accessPolicy.outbound

Configures outbound access for your application.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       external:
>         - host: external-application.example.com
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>         - ipv4: 1.2.3.4
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
> ```

#### accessPolicy.outbound.external

List of external resources that your applications should be able to reach.

Type: `array`<br />
Required: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       external:
>         - host: external-application.example.com
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>         - ipv4: 1.2.3.4
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
> ```

##### accessPolicy.outbound.external[].host

The *host* that your application should be able to reach, i.e. without the protocol (e.g. `https://`). "Host" and "IPv4" are mutually exclusive

Type: `string`<br />
Required: `false`<br />
Pattern: `^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       external:
>         - host: external-application.example.com
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>         - ipv4: 1.2.3.4
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
> ```

##### accessPolicy.outbound.external[].ipv4

The IPv4 address that your application should be able to reach. "IPv4" and "Host" are mutually exclusive

Type: `string`<br />
Required: `false`<br />
Pattern: `^(([0-9])|([1-9][0-9])|(1([0-9]{2}))|(2[0-4][0-9])|(25[0-5]))((\.(([0-9])|([1-9][0-9])|(1([0-9]{2}))|(2[0-4][0-9])|(25[0-5]))){3})$`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       external:
>         - host: external-application.example.com
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>         - ipv4: 1.2.3.4
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
> ```

##### accessPolicy.outbound.external[].ports

List of port rules for external communication. Must be specified if using protocols other than HTTPS.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       external:
>         - host: external-application.example.com
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>         - ipv4: 1.2.3.4
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
> ```

###### accessPolicy.outbound.external[].ports[].port

The port used for communication.

Type: `integer`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       external:
>         - host: external-application.example.com
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
>         - ipv4: 1.2.3.4
>         - host: non-http-service.example.com
>           ports:
>             - port: 9200
> ```

#### accessPolicy.outbound.rules

List of Nais applications that your application needs to access.
These settings apply to Zero Trust network connectivity.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
> ```

##### accessPolicy.outbound.rules[].application

The application's name.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
> ```

##### accessPolicy.outbound.rules[].cluster

The application's cluster. May be omitted if it should be in the same cluster as your application.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
> ```

##### accessPolicy.outbound.rules[].namespace

The application's namespace. May be omitted if it should be in the same namespace as your application.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   accessPolicy:
>     outbound:
>       rules:
>         - application: app1
>         - application: app2
>           namespace: q1
>         - application: app3
>           cluster: dev-gcp
>           namespace: q2
>         - application: '*'
>           namespace: q3
> ```

## command

Override command when starting Docker image.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   command:
>     - /app/myapplication
>     - --param
>     - value
>     - --other-param
>     - other-value
> ```

## env

Custom environment variables injected into your container.
It is possible to use [Kubernetes Dependent Environment Variables](https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/), which allows you to use the value of one environment variable in another.
Environment variables set by the platform are defined before the application variables, and can be referenced/overwritten in the application variables.
Specify either `value` or `valueFrom`, but not both.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   env:
>     - name: MY_CUSTOM_VAR
>       value: some_value
>     - name: MY_APPLICATION_NAME
>       valueFrom:
>         fieldRef:
>           fieldPath: metadata.name
> ```

### env[].name

Environment variable name. May only contain letters, digits, and the underscore `_` character.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   env:
>     - name: MY_CUSTOM_VAR
>       value: some_value
>     - name: MY_APPLICATION_NAME
>       valueFrom:
>         fieldRef:
>           fieldPath: metadata.name
> ```

### env[].value

Environment variable value. Numbers and boolean values must be quoted.
Required unless `valueFrom` is specified.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   env:
>     - name: MY_CUSTOM_VAR
>       value: some_value
>     - name: MY_APPLICATION_NAME
>       valueFrom:
>         fieldRef:
>           fieldPath: metadata.name
> ```

### env[].valueFrom

Dynamically set environment variables based on fields found in the Pod spec.

Relevant information:

- [https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/](https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   env:
>     - name: MY_CUSTOM_VAR
>       value: some_value
>     - name: MY_APPLICATION_NAME
>       valueFrom:
>         fieldRef:
>           fieldPath: metadata.name
> ```

#### env[].valueFrom.fieldRef

Type: `object`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   env:
>     - name: MY_CUSTOM_VAR
>       value: some_value
>     - name: MY_APPLICATION_NAME
>       valueFrom:
>         fieldRef:
>           fieldPath: metadata.name
> ```

##### env[].valueFrom.fieldRef.fieldPath

Field value from the `Pod` spec that should be copied into the environment variable.

Type: `enum`<br />
Required: `true`<br />
Allowed values: *(empty string)*, `metadata.annotations`, `metadata.labels`, `metadata.name`, `metadata.namespace`, `spec.nodeName`, `spec.serviceAccountName`, `status.hostIP`, `status.podIP`<br />

> **Example**
> ```yaml
> spec:
>   env:
>     - name: MY_CUSTOM_VAR
>       value: some_value
>     - name: MY_APPLICATION_NAME
>       valueFrom:
>         fieldRef:
>           fieldPath: metadata.name
> ```

## envFrom

EnvFrom exposes all variables in the ConfigMap or Secret resources as environment variables.
One of `configMap` or `secret` is required.

Environment variables will take the form `KEY=VALUE`, where `key` is the ConfigMap or Secret key.
You can specify as many keys as you like in a single ConfigMap or Secret.

The ConfigMap and Secret resources must live in the same Kubernetes namespace as the Application resource.

Type: `array`<br />
Required: `false`<br />
Availability: team namespaces<br />

> **Example**
> ```yaml
> spec:
>   envFrom:
>     - secret: my-secret-with-envs
>     - configmap: my-configmap-with-envs
> ```

### envFrom[].configmap

Name of the `ConfigMap` where environment variables are specified.
Required unless `secret` is set.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   envFrom:
>     - secret: my-secret-with-envs
>     - configmap: my-configmap-with-envs
> ```

### envFrom[].secret

Name of the `Secret` where environment variables are specified.
Required unless `configMap` is set.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   envFrom:
>     - secret: my-secret-with-envs
>     - configmap: my-configmap-with-envs
> ```

## filesFrom

List of ConfigMap, Secret, or EmptyDir resources that will have their contents mounted into the containers.
Either `configMap`, `secret`, or `emptyDir` is required.

Files will take the path `<mountPath>/<key>`, where `key` is the ConfigMap or Secret key.
You can specify as many keys as you like in a single ConfigMap or Secret, and they will all
be mounted to the same directory.

If you reference an emptyDir you will just get an empty directory, backed
by your requested memory or the disk on the node where your pod is
running.

The ConfigMap and Secret resources must live in the same Kubernetes namespace as the Application resource.

Type: `array`<br />
Required: `false`<br />
Availability: team namespaces<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

### filesFrom[].configmap

Name of the `ConfigMap` that contains files that should be mounted into the container.
Required unless `secret` or `persistentVolumeClaim` is set.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

### filesFrom[].emptyDir

Specification of an empty directory

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

#### filesFrom[].emptyDir.medium

Type: `enum`<br />
Required: `false`<br />
Allowed values: `Disk`, `Memory`<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

### filesFrom[].mode

File permissions for files mounted from a Secret or ConfigMap, e.g. `0640` in octal (`416` in decimal).
Defaults to `0644`.

Type: `integer`<br />
Required: `false`<br />
Default value: `0644`<br />
Value range: `0`-`511`<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

### filesFrom[].mountPath

Filesystem path inside the pod where files are mounted.
The directory will be created if it does not exist. If the directory exists,
any files in the directory will be made unaccessible.

Defaults to `/var/run/configmaps/<NAME>`, `/var/run/secrets`, or `/var/run/pvc/<NAME>`, depending on which of them is specified.
For EmptyDir, MountPath must be set.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

### filesFrom[].persistentVolumeClaim

Name of the `PersistentVolumeClaim` that should be mounted into the container.
Required unless `configMap` or `secret` is set.
This feature requires coordination with the Nais team.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

### filesFrom[].secret

Name of the `Secret` that contains files that should be mounted into the container.
Required unless `configMap` or `persistentVolumeClaim` is set.
If mounting multiple secrets, `mountPath` *MUST* be set to avoid collisions.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   filesFrom:
>     - configmap: example-files-configmap
>       mountPath: /var/run/configmaps
>     - mode: 416
>       mountPath: /var/run/secrets
>       secret: my-secret-file
>     - emptyDir:
>         medium: Memory
>       mountPath: /var/cache
>     - mountPath: /var/run/pvc
>       persistentVolumeClaim: pvc-name
> ```

## frontend

Configuration options specifically for frontend applications.

> **Experimental feature**
> This feature has not undergone much testing, and is subject to API change, instability, or removal.

Type: `object`<br />
Required: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   frontend:
>     generatedConfig:
>       mountPath: /usr/share/nginx/html/js/nais.js
> ```

### frontend.generatedConfig

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   frontend:
>     generatedConfig:
>       mountPath: /usr/share/nginx/html/js/nais.js
> ```

#### frontend.generatedConfig.mountPath

If specified, a Javascript file with application specific frontend configuration variables
will be generated and mounted into the pod file system at the specified path.
You can import this file directly from your Javascript application.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/observability/frontend/#auto-configuration](https://doc.dev-nais.cloud.nais.io/observability/frontend/#auto-configuration)

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   frontend:
>     generatedConfig:
>       mountPath: /usr/share/nginx/html/js/nais.js
> ```

## gcp

Type: `object`<br />
Required: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     bigQueryDatasets:
>       - cascadingDelete: true
>         description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset1
>         permission: READWRITE
>       - description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset2
>         permission: READ
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
>     permissions:
>       - resource:
>           apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
>           kind: Project
>           name: myteam-dev-ab23
>         role: roles/cloudsql.client
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

### gcp.bigQueryDatasets

Provision BigQuery datasets and give your application's pod mountable secrets for connecting to each dataset.
Datasets are immutable and cannot be changed.

Relevant information:

- [https://cloud.google.com/bigquery/docs](https://cloud.google.com/bigquery/docs)

Type: `array`<br />
Required: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     bigQueryDatasets:
>       - cascadingDelete: true
>         description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset1
>         permission: READWRITE
>       - description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset2
>         permission: READ
> ```

#### gcp.bigQueryDatasets[].cascadingDelete

When set to true will delete the dataset, when the application resource is deleted.
NB: If no tables exist in the bigquery dataset, it *will* delete the dataset even if this value is set/defaulted to `false`.
Default value is `false`.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     bigQueryDatasets:
>       - cascadingDelete: true
>         description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset1
>         permission: READWRITE
>       - description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset2
>         permission: READ
> ```

#### gcp.bigQueryDatasets[].description

Human-readable description of what this BigQuery dataset contains, or is used for.
Will be visible in the GCP Console.

Type: `string`<br />
Required: `false`<br />
Immutable: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     bigQueryDatasets:
>       - cascadingDelete: true
>         description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset1
>         permission: READWRITE
>       - description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset2
>         permission: READ
> ```

#### gcp.bigQueryDatasets[].name

Name of the BigQuery Dataset.
The canonical name of the dataset will be `<TEAM_PROJECT_ID>:<NAME>`.

Type: `string`<br />
Required: `true`<br />
Immutable: `true`<br />
Pattern: `^[a-z0-9][a-z0-9_]+$`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     bigQueryDatasets:
>       - cascadingDelete: true
>         description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset1
>         permission: READWRITE
>       - description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset2
>         permission: READ
> ```

#### gcp.bigQueryDatasets[].permission

Permission level given to application.

Type: `enum`<br />
Required: `true`<br />
Immutable: `true`<br />
Allowed values: `READ`, `READWRITE`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     bigQueryDatasets:
>       - cascadingDelete: true
>         description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset1
>         permission: READWRITE
>       - description: Contains big data, supporting big queries, for use in big ideas.
>         name: my_bigquery_dataset2
>         permission: READ
> ```

### gcp.buckets

Provision cloud storage buckets and connect them to your application.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/persistence/buckets/](https://doc.dev-nais.cloud.nais.io/persistence/buckets/)

Type: `array`<br />
Required: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

#### gcp.buckets[].cascadingDelete

Allows deletion of bucket. Set to true if you want to delete the bucket.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

#### gcp.buckets[].lifecycleCondition

Conditions for the bucket to use when selecting objects to delete in cleanup.

Relevant information:

- [https://cloud.google.com/storage/docs/lifecycle](https://cloud.google.com/storage/docs/lifecycle)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

##### gcp.buckets[].lifecycleCondition.age

Condition is satisfied when the object reaches the specified age in days. These will be deleted.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

##### gcp.buckets[].lifecycleCondition.createdBefore

Condition is satisfied when the object is created before midnight on the specified date. These will be deleted.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

##### gcp.buckets[].lifecycleCondition.daysSinceCustomTime

Condition is satisfied when the specified number of days have passed since the date and time specified in an
object's Custom-Time metadata field.

Relevant information:

- [https://cloud.google.com/storage/docs/lifecycle#dayssincecustomtime](https://cloud.google.com/storage/docs/lifecycle#dayssincecustomtime)
- [https://cloud.google.com/storage/docs/metadata#custom-time](https://cloud.google.com/storage/docs/metadata#custom-time)

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

##### gcp.buckets[].lifecycleCondition.numNewerVersions

Condition is satisfied when the object has the specified number of newer versions.
The older versions will be deleted.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

##### gcp.buckets[].lifecycleCondition.withState

Condition is satisfied when the object has the specified state.

Type: `enum`<br />
Required: `false`<br />
Allowed values: *(empty string)*, `ANY`, `ARCHIVED`, `LIVE`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

#### gcp.buckets[].name

The name of the bucket

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

#### gcp.buckets[].publicAccessPrevention

Public access prevention allows you to prevent public access to your bucket.

Relevant information:

- [https://cloud.google.com/storage/docs/public-access-prevention](https://cloud.google.com/storage/docs/public-access-prevention)

Type: `boolean`<br />
Required: `false`<br />
Default value: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

#### gcp.buckets[].retentionPeriodDays

The number of days to hold objects in the bucket before it is allowed to delete them.

Type: `integer`<br />
Required: `false`<br />
Value range: `1`-`36500`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     buckets:
>       - cascadingDelete: true
>         lifecycleCondition:
>           age: 10
>           createdBefore: "2020-01-01"
>           daysSinceCustomTime: 5
>           numNewerVersions: 2
>           withState: ARCHIVED
>         name: my-cloud-storage-bucket
>         publicAccessPrevention: true
>         retentionPeriodDays: 30
> ```

### gcp.permissions

List of *additional* permissions that should be granted to your application for accessing external GCP resources that have not been provisioned through Nais.

Type: `array`<br />
Required: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     permissions:
>       - resource:
>           apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
>           kind: Project
>           name: myteam-dev-ab23
>         role: roles/cloudsql.client
> ```

#### gcp.permissions[].resource

IAM resource to bind the role to.

Type: `object`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     permissions:
>       - resource:
>           apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
>           kind: Project
>           name: myteam-dev-ab23
>         role: roles/cloudsql.client
> ```

##### gcp.permissions[].resource.apiVersion

Kubernetes *APIVersion*.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     permissions:
>       - resource:
>           apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
>           kind: Project
>           name: myteam-dev-ab23
>         role: roles/cloudsql.client
> ```

##### gcp.permissions[].resource.kind

Kubernetes *Kind*.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     permissions:
>       - resource:
>           apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
>           kind: Project
>           name: myteam-dev-ab23
>         role: roles/cloudsql.client
> ```

##### gcp.permissions[].resource.name

Kubernetes *Name*.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     permissions:
>       - resource:
>           apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
>           kind: Project
>           name: myteam-dev-ab23
>         role: roles/cloudsql.client
> ```

#### gcp.permissions[].role

Name of the GCP role to bind the resource to.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     permissions:
>       - resource:
>           apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
>           kind: Project
>           name: myteam-dev-ab23
>         role: roles/cloudsql.client
> ```

### gcp.sqlInstances

Provision database instances and connect them to your application.
Only one item allowed in the list.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/persistence/postgres/](https://doc.dev-nais.cloud.nais.io/persistence/postgres/)
- [https://cloud.google.com/sql/docs/postgres/instance-settings#impact](https://cloud.google.com/sql/docs/postgres/instance-settings#impact)

Type: `array`<br />
Required: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].autoBackupHour

If specified, run automatic backups of the SQL database at the given hour.
Note that this will backup the whole SQL instance, and not separate databases.
Restores are done using the Google Cloud Console.

Type: `integer`<br />
Required: `false`<br />
Value range: `0`-`23`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].cascadingDelete

Remove the entire Postgres server including all data when the Kubernetes resource is deleted.
*THIS IS A DESTRUCTIVE OPERATION*! Set cascading delete only when you want to remove data forever.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].collation

Sort order for `ORDER BY ...` clauses.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].databases

List of one database or less(!) that should be created on this Postgres server.
If not present, a default database with the same name as the application will be created.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].databases[].envVarPrefix

Prefix to add to environment variables made available for database connection.
If switching to `envVarPrefix` you need to [reset database credentials](https://docs.nais.io/persistence/cloudsql/how-to/reset-database-credentials/).

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].databases[].name

Database name.
*Be aware that only one database with this name is allowed in a namespace, regardless of which SQLInstance it belongs to*

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].databases[].users

Add extra users for database access. These users need to be manually given access to database tables.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

###### gcp.sqlInstances[].databases[].users[].name

User name.

Type: `string`<br />
Required: `true`<br />
Pattern: `^[_a-zA-Z][-_a-zA-Z0-9]+$`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].diskAutoresize

When set to true, GCP will automatically increase storage by XXX for the database when
disk usage is above the high water mark. Setting this field to true also disables
manual control over disk size, i.e. the `diskSize` parameter will be ignored.

Relevant information:

- [https://cloud.google.com/sql/docs/postgres/instance-settings#threshold](https://cloud.google.com/sql/docs/postgres/instance-settings#threshold)

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].diskAutoresizeLimit

The maximum size, in GB, to which storage capacity can be automatically increased.
The default value is 0, which specifies that there is no limit.

Type: `integer`<br />
Required: `false`<br />
Default value: `0`<br />
Value range: `0`-`1000`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].diskSize

How much hard drive space to allocate for the SQL server, in gigabytes.
This parameter is used when first provisioning a server.
Disk size can be changed using this field *only when diskAutoresize is set to false*.

Type: `integer`<br />
Required: `false`<br />
Minimum value: `10`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].diskType

Disk type to use for storage in the database.

Type: `enum`<br />
Required: `false`<br />
Allowed values: `HDD`, `SSD`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].flags

Set flags to control the behavior of the instance.
Be aware that Nais *does not validate* these flags, so take extra care
to make sure the values match against the specification, otherwise your deployment
will seemingly work OK, but the database flags will not function as expected.

> **Experimental feature**
> This feature has not undergone much testing, and is subject to API change, instability, or removal.

Relevant information:

- [https://cloud.google.com/sql/docs/postgres/flags#list-flags-postgres](https://cloud.google.com/sql/docs/postgres/flags#list-flags-postgres)

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].flags[].name

Name of the flag.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].flags[].value

Value of the flag.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].highAvailability

When set to true this will set up standby database for failover.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].insights

Configures query insights which are now default for new sql instances.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].insights.enabled

True if Query Insights feature is enabled.

Type: `boolean`<br />
Required: `false`<br />
Default value: `true`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].insights.queryStringLength

Maximum query length stored in bytes. Between 256 and 4500. Default to 1024.

Type: `integer`<br />
Required: `false`<br />
Default value: `1024`<br />
Value range: `256`-`4500`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].insights.recordApplicationTags

True if Query Insights will record application tags from query when enabled.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].insights.recordClientAddress

True if Query Insights will record client address when enabled.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].maintenance

Desired maintenance window for database updates.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].maintenance.day

Type: `integer`<br />
Required: `true`<br />
Value range: `1`-`7`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

##### gcp.sqlInstances[].maintenance.hour

Type: `integer`<br />
Required: `true`<br />
Value range: `0`-`23`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].name

The name of the instance, if omitted the application name will be used.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].pointInTimeRecovery

Enables point-in-time recovery for sql instances using write-ahead logs.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].retainedBackups

Number of daily backups to retain. Defaults to 7 backups.
The number of retained backups must be greater or equal to TransactionLogRetentionDays.

Relevant information:

- [https://cloud.google.com/sql/docs/postgres/backup-recovery/backups](https://cloud.google.com/sql/docs/postgres/backup-recovery/backups)

Type: `integer`<br />
Required: `false`<br />
Default value: `7`<br />
Value range: `1`-`365`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].tier

Server tier, i.e. how much CPU and memory allocated.
Available tiers are `db-f1-micro`, `db-g1-small` and custom `db-custom-CPU-RAM`.
Custom instances must specify memory as a multiple of 256 MB and at least 3.75 GB (e.g. `db-custom-1-3840` for 1 cpu, 3840 MB ram).
The smallest possible instance is `db-f1-micro`, which is recommended only for development instances.
For production workloads, please specify at least `db-custom-1-3840`.

Type: `string`<br />
Required: `true`<br />
Pattern: `db-.+`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].transactionLogRetentionDays

The number of days of transaction logs gcp retains for point in time restores.

Relevant information:

- [https://cloud.google.com/sql/docs/mysql/backup-recovery/backups#retention](https://cloud.google.com/sql/docs/mysql/backup-recovery/backups#retention)

Type: `integer`<br />
Required: `false`<br />
Default value: `7`<br />
Value range: `1`-`7`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

#### gcp.sqlInstances[].type

PostgreSQL version.

Relevant information:

- [https://cloud.google.com/sql/docs/postgres/instance-settings](https://cloud.google.com/sql/docs/postgres/instance-settings)

Type: `enum`<br />
Required: `true`<br />
Allowed values: `POSTGRES_12`, `POSTGRES_13`, `POSTGRES_14`, `POSTGRES_15`, `POSTGRES_16`, `POSTGRES_17`, `POSTGRES_18`<br />

> **Example**
> ```yaml
> spec:
>   gcp:
>     sqlInstances:
>       - autoBackupHour: 1
>         cascadingDelete: true
>         collation: nb_NO.UTF8
>         databases:
>           - envVarPrefix: DB
>             name: mydatabase
>             users:
>               - name: extra_user
>         diskAutoresize: true
>         diskAutoresizeLimit: 60
>         diskSize: 30
>         diskType: SSD
>         flags:
>           - name: max_connections
>             value: "50"
>         highAvailability: true
>         insights:
>           enabled: true
>           queryStringLength: 4500
>           recordApplicationTags: true
>           recordClientAddress: true
>         maintenance:
>           day: 1
>           hour: 4
>         name: myinstance
>         pointInTimeRecovery: true
>         retainedBackups: 14
>         tier: db-f1-micro
>         transactionLogRetentionDays: 3
>         type: POSTGRES_18
> ```

## image

Your application's Docker image location and tag.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   image: navikt/testapp:69.0.0
> ```

## ingresses

List of URLs that will route HTTPS traffic to the application.
All URLs must start with `https://`. Domain availability differs according to which environment your application is running in.
Check the available environments in the reference documentation.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   ingresses:
>     - https://myapplication.nav.no
> ```

## kafka

Set up Aiven Kafka for your application.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/persistence/kafka/](https://doc.dev-nais.cloud.nais.io/persistence/kafka/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   kafka:
>     pool: nav-dev
>     streams: true
> ```

### kafka.pool

Configures your application to access an Aiven Kafka cluster.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   kafka:
>     pool: nav-dev
> ```

### kafka.streams

Allow this app to use kafka streams

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/persistence/kafka/how-to/internal](https://doc.dev-nais.cloud.nais.io/persistence/kafka/how-to/internal)

Type: `boolean`<br />
Required: `false`<br />
Default value: `false`<br />
Availability: GCP<br />

> **Example**
> ```yaml
> spec:
>   kafka:
>     streams: true
> ```

## leaderElection

If true, an HTTP endpoint will be available at `$ELECTOR_GET_URL` that returns the current leader.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/services/leader-election/](https://doc.dev-nais.cloud.nais.io/services/leader-election/)

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   leaderElection: true
> ```

## liveness

Many applications running for long periods of time eventually transition to broken states,
and cannot recover except by being restarted. Kubernetes provides liveness probes to detect
and remedy such situations. Read more about this over at the
[Kubernetes probes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   liveness:
>     failureThreshold: 10
>     initialDelay: 20
>     path: /isalive
>     periodSeconds: 5
>     port: 8080
>     timeout: 1
> ```

### liveness.failureThreshold

When a Pod starts, and the probe fails, Kubernetes will try *failureThreshold* times before giving up.
Giving up in case of a startup probe means restarting the Pod.

Type: `integer`<br />
Required: `false`<br />
Default value: `3`<br />

> **Example**
> ```yaml
> spec:
>   liveness:
>     failureThreshold: 10
> ```

### liveness.initialDelay

Number of seconds after the container has started before startup probes are initiated.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   liveness:
>     initialDelay: 20
> ```

### liveness.path

HTTP endpoint path that signals 200 OK if the application has started successfully.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   liveness:
>     path: /isalive
> ```

### liveness.periodSeconds

How often (in seconds) to perform the probe.

Type: `integer`<br />
Required: `false`<br />
Default value: `10`<br />

> **Example**
> ```yaml
> spec:
>   liveness:
>     periodSeconds: 5
> ```

### liveness.port

Port for the startup probe.
Defaults to application port, as defined in `.spec.port`.

Type: `integer`<br />
Required: `false`<br />
Default value: `.spec.port`<br />
Value range: `1`-`65535`<br />

> **Example**
> ```yaml
> spec:
>   liveness:
>     port: 8080
> ```

### liveness.timeout

Number of seconds after which the probe times out.

Type: `integer`<br />
Required: `false`<br />
Default value: `1`<br />

> **Example**
> ```yaml
> spec:
>   liveness:
>     timeout: 1
> ```

## login

Login configures a login proxy that sits in front of the application.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/auth/explanations/#login-proxy](https://doc.dev-nais.cloud.nais.io/auth/explanations/#login-proxy)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   login:
>     enforce:
>       enabled: true
>       excludePaths:
>         - /some/path
>         - /api/**
>     provider: openid
> ```

### login.enforce

Enforce login for all requests to the application.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   login:
>     enforce:
>       enabled: true
>       excludePaths:
>         - /some/path
>         - /api/**
> ```

#### login.enforce.enabled

If enabled, all unauthenticated requests to the application will be redirected to the login provider.

Type: `boolean`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   login:
>     enforce:
>       enabled: true
> ```

#### login.enforce.excludePaths

Absolute paths to ignore when enforcing login.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   login:
>     enforce:
>       excludePaths:
>         - /some/path
>         - /api/**
> ```

### login.provider

Provider configures the authentication provider for the application.

Type: `enum`<br />
Required: `true`<br />
Allowed values: `openid`<br />

> **Example**
> ```yaml
> spec:
>   login:
>     provider: openid
> ```

## observability

Configuration options related to application observability.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/observability/](https://doc.dev-nais.cloud.nais.io/observability/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     autoInstrumentation:
>       destinations:
>         - id: my-destination
>       enabled: true
>       runtime: java
>     logging:
>       destinations:
>         - id: my-destination
>       enabled: true
>     tracing:
>       enabled: true
> ```

### observability.autoInstrumentation

Auto-instrumentiation for your application using OpenTelemetry for collecting telemetry data such as traces, metrics and logs.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/observability/auto-instrumentation/](https://doc.dev-nais.cloud.nais.io/observability/auto-instrumentation/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     autoInstrumentation:
>       destinations:
>         - id: my-destination
>       enabled: true
>       runtime: java
> ```

#### observability.autoInstrumentation.destinations

Destinations are where telemetry data should be stored.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/observability/reference/auto-config/#destinations](https://doc.dev-nais.cloud.nais.io/observability/reference/auto-config/#destinations)

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     autoInstrumentation:
>       destinations:
>         - id: my-destination
> ```

##### observability.autoInstrumentation.destinations[].id

Destination ID.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     autoInstrumentation:
>       destinations:
>         - id: my-destination
> ```

#### observability.autoInstrumentation.enabled

Enable automatic instrumentation of your application using OpenTelemetry Agent.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     autoInstrumentation:
>       enabled: true
> ```

#### observability.autoInstrumentation.runtime

Application runtime. Supported runtimes are `java`, `nodejs`, `python`, `sdk`.

Type: `enum`<br />
Required: `false`<br />
Allowed values: `dotnet`, `java`, `nodejs`, `python`, `sdk`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     autoInstrumentation:
>       runtime: java
> ```

### observability.logging

Configure logging for your application.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/observability/logging/](https://doc.dev-nais.cloud.nais.io/observability/logging/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     logging:
>       destinations:
>         - id: my-destination
>       enabled: true
> ```

#### observability.logging.destinations

Log destinations for where to forward application logs for persistent storage. Leave empty to use default destinations.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/observability/logging/reference/destinations/#destinations](https://doc.dev-nais.cloud.nais.io/observability/logging/reference/destinations/#destinations)

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     logging:
>       destinations:
>         - id: my-destination
> ```

##### observability.logging.destinations[].id

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     logging:
>       destinations:
>         - id: my-destination
> ```

#### observability.logging.enabled

Enable forwarding of application logs to persistent storage.

Type: `boolean`<br />
Required: `false`<br />
Default value: `true`<br />

> **Example**
> ```yaml
> spec:
>   observability:
>     logging:
>       enabled: true
> ```

## openSearch

OpenSearch instance to get credentials for.
Must be owned by same team.
Create the instance separately using [Nais Console](https://doc.nais.io/persistence/opensearch/how-to/create/).

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/persistence/opensearch/](https://doc.dev-nais.cloud.nais.io/persistence/opensearch/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   openSearch:
>     access: readwrite
>     instance: my-open-search-instance
> ```

### openSearch.access

Access level for OpenSearch user

Type: `enum`<br />
Required: `false`<br />
Default value: `read`<br />
Allowed values: `admin`, `read`, `readwrite`, `write`<br />

> **Example**
> ```yaml
> spec:
>   openSearch:
>     access: readwrite
> ```

### openSearch.instance

Configure your application to access your OpenSearch instance.
The last part of the name used when creating the instance (ie. opensearch-{team}-{instance})

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   openSearch:
>     instance: my-open-search-instance
> ```

## port

The port number which is exposed by the container and should receive traffic.
Note that ports under 1024 are unavailable.

Type: `integer`<br />
Required: `false`<br />
Default value: `8080`<br />

> **Example**
> ```yaml
> spec:
>   port: 8080
> ```

## postgres

Postgres is the deprecated integration with a single legacy Postgres cluster.
Use uses.postgres for new integrations.

> **Experimental feature**
> This feature has not undergone much testing, and is subject to API change, instability, or removal.

Type: `object`<br />
Required: `false`<br />

### postgres.clusterName

ClusterName is the name of the Postgres cluster.

Type: `string`<br />
Required: `true`<br />
Pattern: `^[a-z0-9][a-z0-9-]{1,49}$`<br />

## preStopHook

PreStopHook is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc.
The handler is not called if the container crashes or exits by itself.
The reason for termination is passed to the handler.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/workloads/explanations/good-practices/#handles-termination-gracefully](https://doc.dev-nais.cloud.nais.io/workloads/explanations/good-practices/#handles-termination-gracefully)
- [https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   preStopHook:
>     exec:
>       command:
>         - ./my
>         - --shell
>         - script
>     http:
>       path: /internal/stop
>       port: 8080
> ```

### preStopHook.exec

Command that should be run inside the main container just before the pod is shut down by Kubernetes.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   preStopHook:
>     exec:
>       command:
>         - ./my
>         - --shell
>         - script
> ```

#### preStopHook.exec.command

Command is the command line to execute inside the container before the pod is shut down.
The command is not run inside a shell, so traditional shell instructions (pipes, redirects, etc.) won't work.
To use a shell, you need to explicitly call out to that shell.

If the exit status is non-zero, the pod will still be shut down, and marked as `Failed`.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   preStopHook:
>     exec:
>       command:
>         - ./my
>         - --shell
>         - script
> ```

### preStopHook.http

HTTP GET request that is called just before the pod is shut down by Kubernetes.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   preStopHook:
>     http:
>       path: /internal/stop
>       port: 8080
> ```

#### preStopHook.http.path

Path to access on the HTTP server.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   preStopHook:
>     http:
>       path: /internal/stop
> ```

#### preStopHook.http.port

Port to access on the container.
Defaults to application port, as defined in `.spec.port`.

Type: `integer`<br />
Required: `false`<br />
Default value: `.spec.port`<br />
Value range: `1`-`65535`<br />

> **Example**
> ```yaml
> spec:
>   preStopHook:
>     http:
>       port: 8080
> ```

## preStopHookPath

An HTTP GET will be issued to this endpoint at least once before the pod is terminated.
This feature is deprecated and will be removed in the next major version (nais.io/v1).

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/workloads/explanations/good-practices/#handles-termination-gracefully](https://doc.dev-nais.cloud.nais.io/workloads/explanations/good-practices/#handles-termination-gracefully)

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   preStopHookPath: /internal/stop
> ```

## prometheus

Prometheus is used to [scrape metrics from the pod](https://doc.nais.io/observability/metrics/).
Use this configuration to override the default values.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   prometheus:
>     enabled: true
>     path: /metrics
>     port: "8080"
> ```

### prometheus.enabled

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   prometheus:
>     enabled: true
> ```

### prometheus.path

Type: `string`<br />
Required: `false`<br />
Default value: `/metrics`<br />

> **Example**
> ```yaml
> spec:
>   prometheus:
>     path: /metrics
> ```

### prometheus.port

Defaults to application port, as defined in `.spec.port`.

Type: `string`<br />
Required: `false`<br />
Default value: `.spec.port`<br />

> **Example**
> ```yaml
> spec:
>   prometheus:
>     port: "8080"
> ```

## readiness

Sometimes, applications are temporarily unable to serve traffic. For example, an application might need
to load large data or configuration files during startup, or depend on external services after startup.
In such cases, you don't want to kill the application, but you don’t want to send it requests either.
Kubernetes provides readiness probes to detect and mitigate these situations. A pod with containers
reporting that they are not ready does not receive traffic through Kubernetes Services.
Read more about this over at the [Kubernetes readiness documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   readiness:
>     failureThreshold: 10
>     initialDelay: 20
>     path: /isready
>     periodSeconds: 5
>     port: 8080
>     timeout: 1
> ```

### readiness.failureThreshold

When a Pod starts, and the probe fails, Kubernetes will try *failureThreshold* times before giving up.
Giving up in case of a startup probe means restarting the Pod.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   readiness:
>     failureThreshold: 10
> ```

### readiness.initialDelay

Number of seconds after the container has started before startup probes are initiated.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   readiness:
>     initialDelay: 20
> ```

### readiness.path

HTTP endpoint path that signals 200 OK if the application has started successfully.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   readiness:
>     path: /isready
> ```

### readiness.periodSeconds

How often (in seconds) to perform the probe.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   readiness:
>     periodSeconds: 5
> ```

### readiness.port

Port for the startup probe.
Defaults to application port, as defined in `.spec.port`.

Type: `integer`<br />
Required: `false`<br />
Default value: `.spec.port`<br />
Value range: `1`-`65535`<br />

> **Example**
> ```yaml
> spec:
>   readiness:
>     port: 8080
> ```

### readiness.timeout

Number of seconds after which the probe times out.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   readiness:
>     timeout: 1
> ```

## redirects

List of ingress redirects

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   redirects:
>     - from: https://myapplication-old.nav.no
>       to: https://myapplication.nav.no
> ```

### redirects[].from

Type: `string`<br />
Required: `true`<br />
Pattern: `^https:\/\/.+$`<br />

> **Example**
> ```yaml
> spec:
>   redirects:
>     - from: https://myapplication-old.nav.no
>       to: https://myapplication.nav.no
> ```

### redirects[].to

Type: `string`<br />
Required: `true`<br />
Pattern: `^https:\/\/.+$`<br />

> **Example**
> ```yaml
> spec:
>   redirects:
>     - from: https://myapplication-old.nav.no
>       to: https://myapplication.nav.no
> ```

## replicas

The numbers of pods to run in parallel.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     cpuThresholdPercentage: 50
>     disableAutoScaling: true
>     max: 4
>     min: 2
>     scalingStrategy:
>       cpu:
>         thresholdPercentage: 50
>       kafka:
>         consumerGroup: dev-gcp
>         threshold: 10
>         topic: nais-verification.kafka-canary-dev-gcp
>       scaleDownStabilizationWindowSeconds: 30
>       scaleUpStabilizationWindowSeconds: 30
> ```

### replicas.cpuThresholdPercentage

Deprecated: Use `spec.replicas.scalingStrategy.cpu.thresholdPercentage` instead.
Amount of CPU usage before the autoscaler kicks in.
If anything under ScalingStrategy is set, that takes precedence.

> **Deprecated**
> This feature is deprecated, preserved only for backwards compatibility.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     cpuThresholdPercentage: 50
> ```

### replicas.disableAutoScaling

Disable autoscaling

Type: `boolean`<br />
Required: `false`<br />
Default value: `false`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     disableAutoScaling: true
> ```

### replicas.max

The pod autoscaler will increase replicas when required up to the maximum.

Type: `integer`<br />
Required: `false`<br />
Default value: `4`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     max: 4
> ```

### replicas.min

The minimum amount of running replicas for a deployment.

Type: `integer`<br />
Required: `false`<br />
Default value: `2`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     min: 2
> ```

### replicas.scalingStrategy

ScalingStrategy configures how automatic scaling is performed.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/workloads/application/reference/automatic-scaling/](https://doc.dev-nais.cloud.nais.io/workloads/application/reference/automatic-scaling/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       cpu:
>         thresholdPercentage: 50
>       kafka:
>         consumerGroup: dev-gcp
>         threshold: 10
>         topic: nais-verification.kafka-canary-dev-gcp
>       scaleDownStabilizationWindowSeconds: 30
>       scaleUpStabilizationWindowSeconds: 30
> ```

#### replicas.scalingStrategy.cpu

Configures HPA based on CPU usage.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       cpu:
>         thresholdPercentage: 50
> ```

##### replicas.scalingStrategy.cpu.thresholdPercentage

Amount of CPU usage before the autoscaler kicks in.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       cpu:
>         thresholdPercentage: 50
> ```

#### replicas.scalingStrategy.kafka

Configures HPA based on Kafka lag.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       kafka:
>         consumerGroup: dev-gcp
>         threshold: 10
>         topic: nais-verification.kafka-canary-dev-gcp
> ```

##### replicas.scalingStrategy.kafka.consumerGroup

ConsumerGroup your application uses when consuming

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       kafka:
>         consumerGroup: dev-gcp
> ```

##### replicas.scalingStrategy.kafka.threshold

Threshold is the amount of lag allowed before the application should scale up

Type: `integer`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       kafka:
>         threshold: 10
> ```

##### replicas.scalingStrategy.kafka.topic

Topic your application is consuming

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       kafka:
>         topic: nais-verification.kafka-canary-dev-gcp
> ```

#### replicas.scalingStrategy.scaleDownStabilizationWindowSeconds

Configure stabilization window for scaling down, to avoid rapid scale down events. Defaults to 0 seconds.

Type: `integer`<br />
Required: `false`<br />
Default value: `0s`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       scaleDownStabilizationWindowSeconds: 30
> ```

#### replicas.scalingStrategy.scaleUpStabilizationWindowSeconds

Configure stabilization window for scaling up, to avoid cpu storms on startup. Defaults to 0 seconds.

Type: `integer`<br />
Required: `false`<br />
Default value: `0s`<br />

> **Example**
> ```yaml
> spec:
>   replicas:
>     scalingStrategy:
>       scaleUpStabilizationWindowSeconds: 30
> ```

## resources

When Containers have [resource requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) specified,
the Kubernetes scheduler can make better decisions about which nodes to place pods on.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/workloads/explanations/good-practices/#set-reasonable-resource-requests-and-limits](https://doc.dev-nais.cloud.nais.io/workloads/explanations/good-practices/#set-reasonable-resource-requests-and-limits)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   resources:
>     limits:
>       cpu: 500m
>       memory: 512Mi
>     requests:
>       cpu: 200m
>       memory: 256Mi
> ```

### resources.limits

Limit defines the maximum amount of resources a container can use before getting evicted.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   resources:
>     limits:
>       cpu: 500m
>       memory: 512Mi
> ```

#### resources.limits.cpu

Type: `string`<br />
Required: `false`<br />
Pattern: `^\d+m?$`<br />

> **Example**
> ```yaml
> spec:
>   resources:
>     limits:
>       cpu: 500m
> ```

#### resources.limits.memory

Type: `string`<br />
Required: `false`<br />
Default value: `512Mi`<br />
Pattern: `^\d+[KMG]i$`<br />

> **Example**
> ```yaml
> spec:
>   resources:
>     limits:
>       memory: 512Mi
> ```

### resources.requests

Request defines the amount of resources a container is allocated on startup.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   resources:
>     requests:
>       cpu: 200m
>       memory: 256Mi
> ```

#### resources.requests.cpu

Type: `string`<br />
Required: `false`<br />
Default value: `200m`<br />
Pattern: `^\d+m?$`<br />

> **Example**
> ```yaml
> spec:
>   resources:
>     requests:
>       cpu: 200m
> ```

#### resources.requests.memory

Type: `string`<br />
Required: `false`<br />
Default value: `256Mi`<br />
Pattern: `^\d+[KMG]i$`<br />

> **Example**
> ```yaml
> spec:
>   resources:
>     requests:
>       memory: 256Mi
> ```

## service

Specify which port and protocol is used to connect to the application in the container.
Defaults to HTTP on port 80.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   service:
>     port: 80
>     protocol: http
> ```

### service.port

Port for the default service. Default port is 80.

Type: `integer`<br />
Required: `true`<br />
Default value: `80`<br />
Value range: `1`-`65535`<br />

> **Example**
> ```yaml
> spec:
>   service:
>     port: 80
> ```

### service.protocol

At some point below valkey will start talking valkey protocol, they are
currently the same.
Which protocol the backend service runs on. Default is `http`.

Type: `enum`<br />
Required: `false`<br />
Default value: `http`<br />
Allowed values: `grpc`, `http`, `redis`, `tcp`, `valkey`<br />

> **Example**
> ```yaml
> spec:
>   service:
>     protocol: http
> ```

## skipCaBundle

Whether to skip injection of NAV certificate authority bundle or not. Defaults to false.

Type: `boolean`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   skipCaBundle: true
> ```

## startup

Kubernetes uses startup probes to know when a container application has started. If such a probe is configured,
it disables liveness and readiness checks until it succeeds, making sure those probes don't interfere with the
application startup. This can be used to adopt liveness checks on slow starting containers, avoiding them getting
killed by Kubernetes before they are up and running.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   startup:
>     failureThreshold: 10
>     initialDelay: 20
>     path: /started
>     periodSeconds: 5
>     port: 8080
>     timeout: 1
> ```

### startup.failureThreshold

When a Pod starts, and the probe fails, Kubernetes will try *failureThreshold* times before giving up.
Giving up in case of a startup probe means restarting the Pod.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   startup:
>     failureThreshold: 10
> ```

### startup.initialDelay

Number of seconds after the container has started before startup probes are initiated.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   startup:
>     initialDelay: 20
> ```

### startup.path

HTTP endpoint path that signals 200 OK if the application has started successfully.

Type: `string`<br />
Required: `true`<br />

> **Example**
> ```yaml
> spec:
>   startup:
>     path: /started
> ```

### startup.periodSeconds

How often (in seconds) to perform the probe.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   startup:
>     periodSeconds: 5
> ```

### startup.port

Port for the startup probe.
Defaults to application port, as defined in `.spec.port`.

Type: `integer`<br />
Required: `false`<br />
Default value: `.spec.port`<br />
Value range: `1`-`65535`<br />

> **Example**
> ```yaml
> spec:
>   startup:
>     port: 8080
> ```

### startup.timeout

Number of seconds after which the probe times out.

Type: `integer`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   startup:
>     timeout: 1
> ```

## strategy

Specifies the strategy used to replace old Pods by new ones.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   strategy:
>     rollingUpdate:
>       maxSurge: 25%
>       maxUnavailable: 0
>     type: RollingUpdate
> ```

### strategy.rollingUpdate

Spec to control the desired behavior of rolling update.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   strategy:
>     rollingUpdate:
>       maxSurge: 25%
>       maxUnavailable: 0
> ```

#### strategy.rollingUpdate.maxSurge

The maximum number of pods that can be scheduled above the desired number of
pods.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
This can not be 0 if MaxUnavailable is 0.
Absolute number is calculated from percentage by rounding up.
Defaults to 25%.
Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when
the rolling update starts, such that the total number of old and new pods do not exceed
130% of desired pods. Once old pods have been killed,
new ReplicaSet can be scaled up further, ensuring that total number of pods running
at any time during the update is at most 130% of desired pods.

Type: `integer` or `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   strategy:
>     rollingUpdate:
>       maxSurge: 25%
> ```

#### strategy.rollingUpdate.maxUnavailable

The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding down.
This can not be 0 if MaxSurge is 0.
Defaults to 25%.
Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods
immediately when the rolling update starts. Once new pods are ready, old ReplicaSet
can be scaled down further, followed by scaling up the new ReplicaSet, ensuring
that the total number of pods available at all times during the update is at
least 70% of desired pods.

Type: `integer` or `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   strategy:
>     rollingUpdate:
>       maxUnavailable: 0
> ```

### strategy.type

Specifies the strategy used to replace old Pods by new ones.
`RollingUpdate` is the default value.

Type: `enum`<br />
Required: `false`<br />
Default value: `RollingUpdate`<br />
Allowed values: `Recreate`, `RollingUpdate`<br />

> **Example**
> ```yaml
> spec:
>   strategy:
>     type: RollingUpdate
> ```

## terminationGracePeriodSeconds

The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal.
Set this value longer than the expected cleanup time for your process.
For most applications, the default is more than enough. Defaults to 30 seconds.

Type: `integer`<br />
Required: `false`<br />
Value range: `0`-`180`<br />

> **Example**
> ```yaml
> spec:
>   terminationGracePeriodSeconds: 60
> ```

## tokenx

Provisions and configures a TokenX client for your application.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/security/auth/tokenx/](https://doc.dev-nais.cloud.nais.io/security/auth/tokenx/)

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   tokenx:
>     enabled: true
> ```

### tokenx.enabled

If enabled, will provision and configure a TokenX client and inject an accompanying secret.

Type: `boolean`<br />
Required: `true`<br />
Default value: `false`<br />

> **Example**
> ```yaml
> spec:
>   tokenx:
>     enabled: true
> ```

## ttl

After the specified TTL, the application will be deleted.

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   ttl: 1h
> ```

## uses

Uses configures resources used by this application.

Type: `object`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   uses:
>     postgres:
>       - branch: main
>         envPrefix: MYDB_
>         name: my-postgres
>         role: readwrite
> ```

### uses.postgres

Postgres configures access to CloudNativePG Postgres instances in the workload namespace.
Each Postgres instance may occur only once. When more than one instance is configured,
all but one entry must set a unique envPrefix.

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   uses:
>     postgres:
>       - branch: main
>         envPrefix: MYDB_
>         name: my-postgres
>         role: readwrite
> ```

#### uses.postgres[].branch

Branch selects an existing local branch of this Postgres. When omitted,
access follows the observed active branch. An explicit branch never falls
back to another branch when the selected branch is unavailable.

Type: `string`<br />
Required: `false`<br />
Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`<br />

> **Example**
> ```yaml
> spec:
>   uses:
>     postgres:
>       - branch: main
>         envPrefix: MYDB_
>         name: my-postgres
>         role: readwrite
> ```

#### uses.postgres[].envPrefix

EnvPrefix is prepended verbatim to every environment variable for this Postgres instance.
Include a separator such as a trailing underscore when desired.

Type: `string`<br />
Required: `false`<br />
Pattern: `^[A-Za-z_][A-Za-z0-9_]*$`<br />

> **Example**
> ```yaml
> spec:
>   uses:
>     postgres:
>       - branch: main
>         envPrefix: MYDB_
>         name: my-postgres
>         role: readwrite
> ```

#### uses.postgres[].name

Name of the Postgres resource in the workload namespace.

Type: `string`<br />
Required: `true`<br />
Pattern: `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`<br />

> **Example**
> ```yaml
> spec:
>   uses:
>     postgres:
>       - branch: main
>         envPrefix: MYDB_
>         name: my-postgres
>         role: readwrite
> ```

#### uses.postgres[].role

Role controls the database privileges granted to the workload. Admin access also provisions
a separate readwrite credential for ordinary application traffic.

Type: `enum`<br />
Required: `false`<br />
Default value: `admin`<br />
Allowed values: `admin`, `read`, `readwrite`<br />

> **Example**
> ```yaml
> spec:
>   uses:
>     postgres:
>       - branch: main
>         envPrefix: MYDB_
>         name: my-postgres
>         role: readwrite
> ```

## valkey

List of Valkey instances this application needs credentials for.
Must be owned by same team.

Relevant information:

- [https://doc.dev-nais.cloud.nais.io/persistence/valkey/](https://doc.dev-nais.cloud.nais.io/persistence/valkey/)

Type: `array`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   valkey:
>     - access: readwrite
>       instance: cache
> ```

### valkey[].access

Access level for Valkey user

Type: `enum`<br />
Required: `false`<br />
Default value: `read`<br />
Allowed values: `admin`, `read`, `readwrite`, `write`<br />

> **Example**
> ```yaml
> spec:
>   valkey:
>     - access: readwrite
>       instance: cache
> ```

### valkey[].instance

The last part of the name used when creating the instance (ie. valkey-{team}-{instance})

Type: `string`<br />
Required: `false`<br />

> **Example**
> ```yaml
> spec:
>   valkey:
>     - access: readwrite
>       instance: cache
> ```
