---
title: "YAML configuration mapping for Aerospike on Kubernetes"
description: "Mapping guide for converting Kubernetes YAML configurations to the Aerospike aerospike.conf format using Aerospike Kubernetes Operator (AKO)."
---

# YAML configuration mapping for Aerospike on Kubernetes

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

## Mapping between YAML and Aerospike configuration

Kubernetes uses YAML configuration files, while Aerospike Database uses `aerospike.conf`. Aerospike Kubernetes Operator (AKO) translates `spec.aerospikeConfig` from YAML into that format.

## Applies to

This reference applies to AKO-managed Aerospike Database Enterprise Edition and Federal Edition 6.0 and later. It is intended for Kubernetes users who configure `spec.aerospikeConfig` in an `AerospikeCluster` custom resource (CR).

AKO validates the configuration against the schema for the Database version specified by `spec.image`. Check the [Database configuration reference](https://aerospike.com/docs/database/reference/config) for each parameter’s type, unit, allowed values, constraints, and version availability. See [AKO limitations](https://aerospike.com/docs/kubernetes/4.5.0/install/limitations) for restrictions on AKO-managed clusters.

## Translation conventions

AKO uses the following conventions to translate YAML into the Database `aerospike.conf` format.

### Integer values

In `spec.aerospikeConfig`, numeric parameters with units must be plain integers. Specify size parameters as byte counts in binary units, such as `1073741824` for 1 GiB. Specify time parameters in the unit documented for each parameter.

For example, `default-ttl` and `nsup-period` use seconds. The following configuration sets `default-ttl` to one day and `nsup-period` to two minutes:

```yaml
namespaces:

  - name: test

    default-ttl: 86400

    nsup-period: 120
```

Set `filesize: 1073741824` for 1 GiB:

```yaml
namespaces:

  - name: test

    storage-engine:

      type: memory

      files:

        - /opt/aerospike/data/test.dat

      filesize: 1073741824
```

### Simple key-value pairs

Most simple key-value pairs translate directly, as shown in the following examples.

#### YAML

```yaml
replication-factor: 2
```

#### `aerospike.conf`

```text
replication-factor 2
```

### Storage sizes

File and device sizes in YAML must be plain integers that represent byte counts in binary units. When AKO writes `aerospike.conf`, it preserves those values as integers. Outside an AKO-managed deployment, a directly authored `aerospike.conf` file can use `K`, `M`, `G`, or `T` suffixes for binary units.

#### YAML

```yaml
filesize: 4294967296 # 4 GiB
```

#### `aerospike.conf`

```text
filesize 4294967296
```

### Lists of simple values

For a list of simple values, use the plural key and a YAML list. AKO writes each item to `aerospike.conf` by repeating the same configuration key multiple times.

#### YAML

```yaml
addresses:

  - 192.168.1.1

  - 192.168.5.1

files:

  - /opt/aerospike/ns1.dat

  - /opt/aerospike/ns2.dat
```

#### `aerospike.conf`

```text
address 192.168.1.1

address 192.168.5.1

file /opt/aerospike/ns1.dat

file /opt/aerospike/ns2.dat
```

### Fixed sections

Aerospike configuration groups related settings into fixed sections. In YAML, represent each fixed section as a map of key-value pairs.

#### YAML

```yaml
service:

  service-threads: 4

  proto-fd-max: 15000
```

#### `aerospike.conf`

```text
service {

    proto-fd-max 15000

    service-threads 4

}
```

### Named sections

`aerospike.conf` can contain multiple named sections, such as `namespace`, `dc`, and `set`. In YAML, represent them as a list of maps under the plural section name.

#### YAML

```yaml
namespaces:

  - name: test

    replication-factor: 2

    storage-engine:

      type: memory

      files:

        - /opt/aerospike/data/test1.dat

        - /opt/aerospike/data/test2.dat

      filesize: 4294967296

  - name: bar

    replication-factor: 2

    storage-engine:

      type: memory

      data-size: 4294967296
```

#### `aerospike.conf`

```text
namespace test {

    replication-factor 2

    storage-engine memory {

        filesize 4294967296

        file /opt/aerospike/data/test1.dat

        file /opt/aerospike/data/test2.dat

    }

}

namespace bar {

    replication-factor 2

    storage-engine memory {

        data-size 4294967296

    }

}
```

### Typed sections

Some `aerospike.conf` sections, such as `storage-engine` and `index-type`, accept one value from a fixed set. In YAML, represent each typed section as a map with a `type` property. Use the same allowed values as the corresponding `aerospike.conf` section.

#### YAML

```yaml
namespaces:

  - name: test

    storage-engine:

      type: memory

      files:

        - /opt/aerospike/data/test1.dat

        - /opt/aerospike/data/test2.dat

      filesize: 4294967296
```

#### `aerospike.conf`

```text
namespace test {

    storage-engine memory {

        filesize 4294967296

        file /opt/aerospike/data/test1.dat

        file /opt/aerospike/data/test2.dat

    }

}
```

### Aerospike logging section

Aerospike Database supports three log destinations, or sinks: `file`, `console`, and `syslog`. Database 6.3.0 introduced the `syslog` sink. Set `name` to `console` or `syslog`. For a file sink, set `name` to the filename. Add logging contexts and levels as key-value pairs. For more information, see [Log management](https://aerospike.com/docs/database/manage/logging/logs).

#### YAML

```yaml
logging:

  - name: console

    any: info

  - name: /var/log/aerospike/aerospike.log

    any: info

    tls: debug

  - name: syslog

    audit: info

    facility: local0

    tag: aerospike-audit

    path: /dev/log
```

#### `aerospike.conf`

```text
logging {

    console {

        context any    info

    }

    file /var/log/aerospike/aerospike.log {

        context any    info

        context tls    debug

    }

    syslog {

        context audit    info

        facility local0

        path /dev/log

        tag aerospike-audit

    }

}
```

## Complete `spec.aerospikeConfig` example

The following YAML is the value of `spec.aerospikeConfig`, not a complete `AerospikeCluster` CR. The example assumes a dedicated cross-datacenter replication (XDR) user named `xdr-user` with permissions for the `test` destination namespace.

AKO generates equivalent `aerospike.conf` content. Whitespace and key ordering can differ between AKO releases.

### YAML

```yaml
service:

  proto-fd-max: 15000

security: {}

logging:

  - name: console

    any: info

  - name: /var/log/aerospike/aerospike.log

    any: info

xdr:

  dcs:

    - name: dc1

      node-address-ports:

        - aeroclusterdst-0-0 3000

      auth-user: xdr-user

      auth-password-file: /etc/aerospike/secret/password_xdr-user.txt

      auth-mode: internal

      namespaces:

        - name: test

namespaces:

  - name: test

    replication-factor: 2

    storage-engine:

      type: memory

      files:

        - /opt/aerospike/data/test.dat

      filesize: 4294967296

mod-lua:

  user-path: /opt/aerospike/usr/udf/lua
```

### `aerospike.conf`

```text
logging {

    console {

        context any    info

    }

    file /var/log/aerospike/aerospike.log {

        context any    info

    }

}

mod-lua {

    user-path    /opt/aerospike/usr/udf/lua

}

namespace test {

    replication-factor    2

    storage-engine memory {

        filesize    4294967296

        file    /opt/aerospike/data/test.dat

    }

}

security {

}

service {

    proto-fd-max    15000

}

xdr {

    dc dc1 {

        auth-mode    internal

        auth-password-file    /etc/aerospike/secret/password_xdr-user.txt

        auth-user    xdr-user

        node-address-port    aeroclusterdst-0-0 3000

        namespace test {

        }

    }

}
```

## Related pages

-   [Configure Aerospike on Kubernetes with AKO](https://aerospike.com/docs/kubernetes/4.5.0/manage/configure/overview)
-   [Dynamic configuration for Aerospike on Kubernetes](https://aerospike.com/docs/kubernetes/4.5.0/manage/configure/dynamic-config)
-   [Configuration parameters for Aerospike Kubernetes Operator](https://aerospike.com/docs/kubernetes/4.5.0/reference/config-reference)