<p>I have a fdb cluster using <a href="https://github.com/FoundationDB/fdb-kubernetes-operator" rel="nofollow noreferrer">https://github.com/FoundationDB/fdb-kubernetes-operator</a>  and now trying to raise a pod with <a href="https://github.com/FoundationDB/fdb-document-layer" rel="nofollow noreferrer">https://github.com/FoundationDB/fdb-document-layer</a></p>
<p>The result is CrashLoopBackOff of the pod</p>
<p>The description of the pod:</p>
<pre><code>  Name:         fdb-doc-layer-84c4b84595-9rv8c
Namespace:    default
Priority:     0
Node:         faraday/5.188.158.233
Start Time:   Sat, 21 Nov 2020 03:10:06 +0300
Labels:       app=fdb-doc-layer
              pod-template-hash=84c4b84595
Annotations:  cni.projectcalico.org/podIP: 10.1.80.235/32
              cni.projectcalico.org/podIPs: 10.1.80.235/32
Status:       Running
IP:           10.1.80.235
IPs:
  IP:           10.1.80.235
Controlled By:  ReplicaSet/fdb-doc-layer-84c4b84595
Containers:
  fdb-doc-layer:
    Container ID:   containerd://86f599ef8bd0684023a093f0e725fde02ac60f3899681053857e411b7c8c4b3b
    Image:          foundationdb/fdb-document-layer-build:latest
    Image ID:       docker.io/foundationdb/fdb-document-layer-build@sha256:5d1e84c5954141ce67be3fa28a428f572c3d8bbff1541ec8588fe82da600cb97
    Port:           27017/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Sat, 21 Nov 2020 03:36:23 +0300
      Finished:     Sat, 21 Nov 2020 03:36:23 +0300
    Ready:          False
    Restart Count:  10
    Limits:
      cpu:     200m
      memory:  128Mi
    Requests:
      cpu:     200m
      memory:  128Mi
    Environment:
      FDB_CLUSTER_FILE:  /etc/foundationdb/fdb.cluster
    Mounts:
      /etc/foundationdb from config-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-mf8pp (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      sample-cluster-config
    Optional:  false
  default-token-mf8pp:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-mf8pp
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                   From               Message
  ----     ------     ----                  ----               -------
  Normal   Scheduled  28m                   default-scheduler  Successfully assigned default/fdb-doc-layer-84c4b84595-9rv8c to faraday
  Normal   Pulled     28m                   kubelet            Successfully pulled image &quot;foundationdb/fdb-document-layer-build:latest&quot; in 1.421941982s
  Normal   Pulled     28m                   kubelet            Successfully pulled image &quot;foundationdb/fdb-document-layer-build:latest&quot; in 1.223503462s
  Normal   Pulled     27m                   kubelet            Successfully pulled image &quot;foundationdb/fdb-document-layer-build:latest&quot; in 1.253710381s
  Normal   Pulled     27m                   kubelet            Successfully pulled image &quot;foundationdb/fdb-document-layer-build:latest&quot; in 1.672481437s
  Normal   Created    27m (x4 over 28m)     kubelet            Created container fdb-doc-layer
  Normal   Started    27m (x4 over 28m)     kubelet            Started container fdb-doc-layer
  Normal   Pulling    26m (x5 over 28m)     kubelet            Pulling image &quot;foundationdb/fdb-document-layer-build:latest&quot;
  Normal   Pulled     26m                   kubelet            Successfully pulled image &quot;foundationdb/fdb-document-layer-build:latest&quot; in 1.270867366s
  Warning  BackOff    3m2s (x116 over 28m)  kubelet            Back-off restarting failed container
</code></pre>
<p>My deployment.yaml:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: fdb-doc-layer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fdb-doc-layer
  template:
    metadata:
      labels:
        app: fdb-doc-layer
    spec:
      containers:
      - name: fdb-doc-layer
        image: foundationdb/fdb-document-layer-build:latest
        env:
        - name: FDB_CLUSTER_FILE
          value: /etc/foundationdb/fdb.cluster
        volumeMounts:
        - name: config-volume
          mountPath: /etc/foundationdb
        resources:
          limits:
            memory: &quot;128Mi&quot;
            cpu: &quot;200m&quot;
        ports:
        - containerPort: 27017
      volumes:
       - name: config-volume
         configMap:
           name: sample-cluster-config  
</code></pre>
<p>How to make fdb-document-layer work with kubernetes?</p>

<p>There are two issues:</p>
<ol>
<li>You are using the wrong image instead of <code>foundationdb/fdb-document-layer-build:latest</code> you should use <code>foundationdb/fdb-document-layer:latest</code>. The first image is only used to build the document layer.</li>
<li>The ConfigMap contains the <code>fdb.cluster</code> file under the key <code>cluster-file</code> so you need to remap this or adjust the env variable.</li>
</ol>
<p>The following config works:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: fdb-doc-layer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fdb-doc-layer
  template:
    metadata:
      labels:
        app: fdb-doc-layer
    spec:
      containers:
      - name: fdb-doc-layer
        image: foundationdb/fdb-document-layer:latest
        env:
        - name: FDB_CLUSTER_FILE
          value: /etc/foundationdb/fdb.cluster
        volumeMounts:
        - name: config-volume
          mountPath: /etc/foundationdb
        resources:
          limits:
            memory: &quot;128Mi&quot;
            cpu: &quot;200m&quot;
        ports:
        - containerPort: 27017
      volumes:
       - name: config-volume
         configMap:
           name: sample-cluster-config
           items:
           - key: cluster-file
             path: fdb.cluster
</code></pre>
