<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 Topic 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 `Topic` spec, commonly known as the `topic.yaml` file.

## acl

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

> **Example**
> ```yaml
> spec:
>   acl:
>     - access: read
>       application: consumer
>       team: otherteam
>     - access: write
>       application: producer
>       team: myteam
>     - access: readwrite
>       application: processor
>       team: myteam
> ```

### acl[].access

Access type granted for a application.
Defaults to `readwrite`.

Type: `enum`<br />
Required: `true`<br />
Allowed values: `read`, `readwrite`, `write`<br />

> **Example**
> ```yaml
> spec:
>   acl:
>     - access: read
>       application: consumer
>       team: otherteam
>     - access: write
>       application: producer
>       team: myteam
>     - access: readwrite
>       application: processor
>       team: myteam
> ```

### acl[].application

The name of the specified AivenApplication.aiven.nais.io

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

> **Example**
> ```yaml
> spec:
>   acl:
>     - access: read
>       application: consumer
>       team: otherteam
>     - access: write
>       application: producer
>       team: myteam
>     - access: readwrite
>       application: processor
>       team: myteam
> ```

### acl[].team

The team of the specified application

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

> **Example**
> ```yaml
> spec:
>   acl:
>     - access: read
>       application: consumer
>       team: otherteam
>     - access: write
>       application: producer
>       team: myteam
>     - access: readwrite
>       application: processor
>       team: myteam
> ```

## config

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

> **Example**
> ```yaml
> spec:
>   config:
>     cleanupPolicy: delete
>     deleteRetentionHours: 24
>     localRetentionBytes: 1000
>     localRetentionHours: 68
>     maxCompactionLagMs: 60000
>     maxMessageBytes: 1.048588e+06
>     minCompactionLagMs: 10000
>     minimumInSyncReplicas: 2
>     partitions: 1
>     replication: 3
>     retentionBytes: 6000
>     retentionHours: 168
>     segmentHours: 168
> ```

### config.cleanupPolicy

CleanupPolicy is either "delete" or "compact" or both.
This designates the retention policy to use on old log segments.

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_cleanup.policy](https://kafka.apache.org/documentation.html#topicconfigs_cleanup.policy)

Type: `enum`<br />
Required: `false`<br />
Default value: `delete`<br />
Allowed values: `compact`, `compact,delete`, `delete`<br />

> **Example**
> ```yaml
> spec:
>   config:
>     cleanupPolicy: delete
> ```

### config.deleteRetentionHours

The amount of time to retain delete tombstone markers for log compacted topics.
This setting also gives a bound on the time in which a consumer must complete a read if they begin from offset 0 to ensure that they get a valid snapshot of the final stage (otherwise delete tombstones may be collected before they complete their scan).

Relevant information:

- [https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms)

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

> **Example**
> ```yaml
> spec:
>   config:
>     deleteRetentionHours: 24
> ```

### config.localRetentionBytes

When set, remote storage will be used to store log segments.
This value controls the size of the log that is kept before it is moved to remote storage.
Must be less than RetentionBytes
Not supported when CleanupPolicy is set to "compact"

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_local.retention.bytes](https://kafka.apache.org/documentation.html#topicconfigs_local.retention.bytes)

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

> **Example**
> ```yaml
> spec:
>   config:
>     localRetentionBytes: 1000
> ```

### config.localRetentionHours

When set, remote storage will be used to store log segments.
This value controls the number of hours to keep before it is moved to remote storage.
Must be less than RetentionHours.
Not supported when CleanupPolicy is set to "compact"

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_local.retention.ms](https://kafka.apache.org/documentation.html#topicconfigs_local.retention.ms)

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

> **Example**
> ```yaml
> spec:
>   config:
>     localRetentionHours: 68
> ```

### config.maxCompactionLagMs

MaxCompactionLagMs indicates the maximum time a message will remain ineligible for compaction in the log

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_max.compaction.lag.ms](https://kafka.apache.org/documentation.html#topicconfigs_max.compaction.lag.ms)

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

> **Example**
> ```yaml
> spec:
>   config:
>     maxCompactionLagMs: 60000
> ```

### config.maxMessageBytes

The largest record batch size allowed by Kafka (after compression if compression is enabled).
If this is increased and there are consumers older than 0.10.2, the consumers' fetch size must also be increased
so that they can fetch record batches this large. In the latest message format version, records are always grouped
into batches for efficiency. In previous message format versions, uncompressed records are not grouped into
batches and this limit only applies to a single record in that case.

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_max.message.bytes](https://kafka.apache.org/documentation.html#topicconfigs_max.message.bytes)

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

> **Example**
> ```yaml
> spec:
>   config:
>     maxMessageBytes: 1.048588e+06
> ```

### config.minCleanableDirtyRatioPercent

MinCleanableDirtyRatio indicates the minimum ratio of dirty log to retention size to initiate log compaction

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_min.cleanable.dirty.ratio](https://kafka.apache.org/documentation.html#topicconfigs_min.cleanable.dirty.ratio)

Type: `integer` or `string`<br />
Required: `false`<br />
Default value: `50%`<br />

### config.minCompactionLagMs

MinCompactionLagMs indicates the minimum time a message will remain uncompacted in the log

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_min.compaction.lag.ms](https://kafka.apache.org/documentation.html#topicconfigs_min.compaction.lag.ms)

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

> **Example**
> ```yaml
> spec:
>   config:
>     minCompactionLagMs: 10000
> ```

### config.minimumInSyncReplicas

When a producer sets acks to "all" (or "-1"), `min.insync.replicas` specifies the minimum number of replicas
that must acknowledge a write for the write to be considered successful.

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_min.insync.replicas](https://kafka.apache.org/documentation.html#topicconfigs_min.insync.replicas)

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

> **Example**
> ```yaml
> spec:
>   config:
>     minimumInSyncReplicas: 2
> ```

### config.partitions

The default number of log partitions per topic.

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

> **Example**
> ```yaml
> spec:
>   config:
>     partitions: 1
> ```

### config.replication

The default replication factor for created topics.

Relevant information:

- [https://kafka.apache.org/documentation.html#replication](https://kafka.apache.org/documentation.html#replication)

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

> **Example**
> ```yaml
> spec:
>   config:
>     replication: 3
> ```

### config.retentionBytes

Configuration controls the maximum size a partition can grow to before we will discard old log segments
to free up space if we are using the "delete" retention policy. By default there is no size limit only a time limit.
Since this limit is enforced at the partition level, multiply it by the number of partitions to compute the topic retention in bytes.

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_retention.bytes](https://kafka.apache.org/documentation.html#topicconfigs_retention.bytes)

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

> **Example**
> ```yaml
> spec:
>   config:
>     retentionBytes: 6000
> ```

### config.retentionHours

The number of hours to keep a log file before deleting it.

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_retention.ms](https://kafka.apache.org/documentation.html#topicconfigs_retention.ms)

Type: `integer`<br />
Required: `false`<br />
Default value: `168`<br />
Maximum value: `2147483648`<br />

> **Example**
> ```yaml
> spec:
>   config:
>     retentionHours: 168
> ```

### config.segmentHours

The number of hours after which Kafka will force the log to roll even if the segment file isn't full to ensure
that retention can delete or compact old data.

Relevant information:

- [https://kafka.apache.org/documentation.html#topicconfigs_segment.ms](https://kafka.apache.org/documentation.html#topicconfigs_segment.ms)

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

> **Example**
> ```yaml
> spec:
>   config:
>     segmentHours: 168
> ```

## pool

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

> **Example**
> ```yaml
> spec:
>   pool: dev-nais-dev
> ```
