# Getting "Read-only file system" error with Elasticsearch deployment on Kubernetes

**URL:** <https://discuss.elastic.co/t/getting-read-only-file-system-error-with-elasticsearch-deployment-on-kubernetes/358719>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [May 3, 2024, 2:17pm UTC](https://discuss.elastic.co/t/getting-read-only-file-system-error-with-elasticsearch-deployment-on-kubernetes/358719 "2024-05-03T14:17:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ascii](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@ascii](https://discuss.elastic.co/u/ascii)\
**Post date:** [May 3, 2024, 2:17pm UTC](https://discuss.elastic.co/t/getting-read-only-file-system-error-with-elasticsearch-deployment-on-kubernetes/358719/1 "2024-05-03T14:17:20Z")

</div>

Hi!

I'm trying to deploy Elasticsearch 7.12.0 on Kubernetes and have configured it to run as a single-node cluster.

But after deployment, I encountered the following error:

```auto
Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.FileSystemException: /usr/share/elasticsearch/config/elasticsearch.keystore.tmp: Read-only file system
Likely root cause: java.nio.file.FileSystemException: /usr/share/elasticsearch/config/elasticsearch.keystore.tmp: Read-only file system

```

Here are the relevant parts of my configurations:

**Deployment YAML:**

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: elasticsearch
  name: elasticsearch
spec:
  replicas: 1
  selector:
    matchLabels:
      app: elasticsearch
  template:
    metadata:
      labels:
        app: elasticsearch
    spec:
      containers:
        - image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
          name: elasticsearch
          env:
            - name: discovery.type
              value: single-node
          ports:
            - containerPort: 9200
            - containerPort: 9300
          volumeMounts:
            - mountPath: /usr/share/elasticsearch/config
              name: elasticsearch-config
            - mountPath: /usr/share/elasticsearch/data
              name: elasticsearch-data
          resources:
            limits:
              memory: 2Gi
              cpu: "1"
            requests:
              memory: 1Gi
              cpu: "1"
      volumes:
        - name: elasticsearch-config
          configMap:
            name: elasticsearch-config
        - name: elasticsearch-data
          persistentVolumeClaim:
            claimName: elasticsearch
      securityContext:
        fsGroup: 1000        
      restartPolicy: Always

```

**ConfigMap YAML:**

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: elasticsearch-config
data:
  elasticsearch.yml: |
    cluster.name: "docker-cluster"
    network.host: 0.0.0.0
    path.data: /usr/share/elasticsearch/data
  jvm.options: |
    -Xms512m
    -Xmx512m

```

**PersistentVolumeClaim YAML:**

```yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
    app: elasticsearch
  name: elasticsearch
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi

```

believe the issue might be related to how the volumes are mounted or permissions are set. How can I resolve this "Read-only file system" error for the Elasticsearch configuration in Kubernetes?
