How to deploy Answer in kubernetes?

Viewed 206

The official documentation mentions that how to deploy Answer via docker and binary. So how to deploy Answer in k8s?

1 Answers

There are two issues that need to be resolved if you need to deploy answer to k8s.

install

The first time you deploy answer you need to install, we need to automate the installation by setting environment variables.

FYI: https://answer.dev/docs/env#for-auto-install

Depending on your situation, configure the correct environment variables to complete the installation.

storage

By default without the plugin, Answer saves configuration files, cache, and image files in a local directory. So the data directory needs to be persisted.

So you need to use StatefulSet and PersistentVolume. Configure volume and mount it in the appropriate directory.

For example

          volumeMounts:
            - name: data
              mountPath: "/data/"
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        name: data
      spec:
        accessModes:
          - ReadWriteMany
        resources:
          requests:
            storage: 2Gi
        storageClassName: nfs-client
        volumeMode: Filesystem