<p>I am new to Kubernetes I am trying to mimic a behavior a bit like what I do with <code>docker-compose</code> when I serve a Couchbase database in a docker container.</p>
<pre class="lang-yaml prettyprint-override"><code>  couchbase:
    image: couchbase
    volumes:
      - ./couchbase:/opt/couchbase/var
    ports:
      - 8091-8096:8091-8096
      - 11210-11211:11210-11211
</code></pre>
<p>I managed to create a cluster in my localhost using a tool called &quot;<a href="https://kind.sigs.k8s.io/docs/user/quick-start/#creating-a-cluster" rel="nofollow noreferrer">kind</a>&quot;</p>
<pre class="lang-sh prettyprint-override"><code>kind create cluster --name my-cluster
kubectl config use-context my-cluster
</code></pre>
<p>Then I am trying to use that cluster to deploy a Couchbase service</p>
<p>I created a file named <code>couchbase.yaml</code> with the following content (I am trying to mimic what I do with my docker-compose file).</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: couchbase
  namespace: my-project
  labels:
    platform: couchbase
spec:
  replicas: 1
  selector:
    matchLabels:
      platform: couchbase
  template:
    metadata:
      labels:
        platform: couchbase
    spec:
      volumes:
      - name: couchbase-data
        hostPath:
          # directory location on host
          path: /home/me/my-project/couchbase
          # this field is optional
          type: Directory
      containers:
      - name: couchbase
        image: couchbase
        volumeMounts:
        - mountPath: /opt/couchbase/var
          name: couchbase-data
</code></pre>
<p>Then I start the deployment like this:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl create namespace my-project
kubectl apply -f couchbase.yaml
kubectl expose deployment -n my-project couchbase --type=LoadBalancer --port=8091
</code></pre>
<p>However my deployment never actually start:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get deployments -n my-project couchbase
NAME        READY   UP-TO-DATE   AVAILABLE   AGE
couchbase   0/1     1            0           6m14s
</code></pre>
<p>And when I look for the logs I see this:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl logs -n my-project -lplatform=couchbase --all-containers=true
Error from server (BadRequest): container &quot;couchbase&quot; in pod &quot;couchbase-589f7fc4c7-th2r2&quot; is waiting to start: ContainerCreating
</code></pre>

mpsido
<p>As OP mentioned in a comment, issue was solved using extra mount as explained in documentation: <a href="https://kind.sigs.k8s.io/docs/user/configuration/#extra-mounts" rel="nofollow noreferrer">https://kind.sigs.k8s.io/docs/user/configuration/#extra-mounts</a></p>
<p>Here is OP's comment but formated so it's more readable:</p>
<hr />
<p>the error shows up when I run this command:</p>
<pre><code>kubectl describe pods -n my-project couchbase
</code></pre>
<p>I could fix it by creating a new kind cluster:</p>
<pre><code>kind create cluster --config cluster.yaml 
</code></pre>
<p>Passing this content in <code>cluster.yaml</code>:</p>
<pre><code>kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: inf
nodes:
- role: control-plane
  extraMounts:
  - hostPath: /home/me/my-project/couchbase
    containerPath: /couchbase
</code></pre>
<p>In <code>couchbase.yaml</code> the path becomes path: <code>/couchbase</code> of course.</p>
