<p>i am running kafka on kubernetes (deployed on Azure) using strimzi for development environment and would prefer to use internal kubernetes node storage. if i use persistant-claim or jbod, it creates standard disks on azure storage. however i prefer to use internal node storage as i have 16 gb available there. i do not want to use ephemeral as i want the data to be persisted atleast on kubernetes nodes.
folllowing is my deployment.yml</p>
<pre><code>apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: kafka-cluster
spec:
  kafka:
    version: 3.1.0
    replicas: 2
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
      - name: tls
        port: 9093
        type: internal
        tls: true
      - name: external
        type: loadbalancer
        tls: false
        port: 9094
      
    config:
      offsets.topic.replication.factor: 2
      transaction.state.log.replication.factor: 2
      transaction.state.log.min.isr: 2
      default.replication.factor: 2
      min.insync.replicas: 2
      inter.broker.protocol.version: &quot;3.1&quot;
    storage:
      type: persistent-claim
      size : 2Gi
      deleteClaim: false
  zookeeper:
    replicas: 2
    storage:
      type: persistent-claim
      size: 2Gi
      deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}
</code></pre>

Faheem Sultan
<p>The <code>persistent-claim</code> storage as you use it will provision the storage using the default storage class which in your case I guess creates <em>standard storage</em>.</p>
<p>You have two options how to use local disk space of the worker node:</p>
<ul>
<li>You can use the <code>ephemeral</code> type storage. But keep in mind that this is like a temporary directory, it will be lost in every rolling update. Also if you for example delete all the pods at the same time, you will loose all data. As such it is something recommended only for some short-lived clusters in CI, maybe some short development etc. But for sure not for anything where you need reliability.</li>
<li>You can use Local Persistent Volumes which are persistent volumes which are bound to a particular node. These are persistent, so the pods will re-use the volume between restarts and rolling udpates. However, it bounds the pod to the particular worker node the storage is on -&gt; so you cannot easily reschedule it to another worker node. But apart from these limitation, it is something what can be (unlike the <code>ephemeral</code> storage) used with reliability and availability when done right. The local persistent volumes are normally provisioned through StorageClass as well -&gt; so in the <code>Kafka</code> custom resource in Strimzi it will still use the <code>persistent-claim</code> type storage, just with different storage class.</li>
</ul>
<p>You should really thing what exactly you want to use and why. From my experience, the local persistent volumes are great option when</p>
<ul>
<li>You run on bare metal / on-premise clusters where often good shared block storage is not available</li>
<li>When you require maximum performance (local storage does not depend on network, so it can be often faster)</li>
</ul>
<p>But in public clouds with good support for high quality for networked block storage such as Amazon EBS volumes and their Azure or Google counterparts, local storage often brings more problems than advantages because of how it bounds your Kafka brokers to a particular worker node.</p>
<p>Some more details about the local persistent volumes can be found here: <a href="https://kubernetes.io/docs/concepts/storage/volumes/#local" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/volumes/#local</a> ... there are also different provisioners which can help you use it. I'm not sure if Azure supports anything out of the box.</p>
<p><em>Sidenote: 2Gi of space is very small for Kafka. Not sure how much you will be able to do before running out of disk space. Even 16Gi would be quite small. If you know what are you doing, then fine. But if not, you should be careful.</em></p>
