question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.16/candidate - Cluster volume permssion problems on non-master nodes

See original GitHub issue

I have a 3 node cluster. I have set the --allow-privileged flag in /args/kube-apiserver (unsure if that’s related). Addons enabled: dns, storage.

I setup the elasticsearch operator (1.0 beta) and setup a cluster just fine - eventually turns green (healthy). I try setting up a strimzi operator (0.14.0) to manage kafka cluster and it only gets as far as creating the zookeeper pods and only the pod on the master node succeeds. Pod logs complains about permission denied accessing /var/lib/zookeeper/

After much fussing around I tracked down the issue to be permissions of the files on disk on the nodes themselves in /var/snap/microk8s/common/default-storage On master:

drwxr-xr-x  5 root     root     4096 Oct 18 17:24 ..
drwxrwxrwx  2 root     root     4096 Oct 18 17:53 dev-data-ws-zookeeper-0-pvc-f9ad9e3b-4a82-4e33-99be-e4c1d0ac7c72
drwxrwxrwx  2 root     root     4096 Oct 18 17:53 dev-data-ws-zookeeper-1-pvc-6fcb6136-73f5-4102-a215-53f452b8f2fe
drwxrwxrwx  4 root     root     4096 Oct 18 17:53 dev-data-ws-zookeeper-2-pvc-adeeebcd-2470-413e-ab9d-0b99bb18025d
drwxrwxrwx  2 root     root     4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-coordinating-nodes-0-pvc-4edf829e-f42a-4ab1-958c-7efe7beb7774
drwxrwxrwx  2 root     root     4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-coordinating-nodes-1-pvc-79529357-0f6d-495b-a1b2-e83be0085016
drwxrwxrwx  3 rsiadmin rsiadmin 4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-data-nodes-0-pvc-0303c3c6-4e9c-4704-b4b3-91383de91c62
drwxrwxrwx  2 root     root     4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-data-nodes-1-pvc-1bfde038-4f42-4502-b4f8-cd57de3c0e86
drwxrwxrwx  2 root     root     4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-data-nodes-2-pvc-4b12de2e-be02-44d2-861f-06325bbaa28c
drwxrwxrwx  2 root     root     4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-master-nodes-0-pvc-dce03d45-736f-4b2d-8c2d-72bc85794dbf
drwxrwxrwx  2 root     root     4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-master-nodes-1-pvc-f84aae88-ef12-4a1a-9628-8ddd6212723b
drwxrwxrwx  3 rsiadmin rsiadmin 4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-master-nodes-2-pvc-420137ef-9049-43d3-9dba-72a322c5a41b

On the non-master nodes:

drwxr-xr-x  2 root     root     4096 Oct 18 17:53 dev-data-ws-zookeeper-0-pvc-f9ad9e3b-4a82-4e33-99be-e4c1d0ac7c72
drwxr-xr-x  2 root     root     4096 Oct 18 17:14 dev-data-ws-zookeeper-1-pvc-2c53768b-0341-443f-838f-dadf70308308
drwxr-xr-x  3 rsiadmin rsiadmin 4096 Oct 18 17:27 dev-elasticsearch-data-ws-es-coordinating-nodes-0-pvc-d77e0102-74c3-4dcd-a0dd-9d9fddbf93ca
drwxr-xr-x  3 rsiadmin rsiadmin 4096 Oct 18 17:33 dev-elasticsearch-data-ws-es-coordinating-nodes-1-pvc-79529357-0f6d-495b-a1b2-e83be0085016
drwxr-xr-x  3 rsiadmin rsiadmin 4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-data-nodes-1-pvc-1bfde038-4f42-4502-b4f8-cd57de3c0e86
drwxr-xr-x  3 rsiadmin rsiadmin 4096 Oct 18 17:27 dev-elasticsearch-data-ws-es-data-nodes-2-pvc-7446c823-b16e-4101-a309-d6c441e5841e
drwxr-xr-x  3 rsiadmin rsiadmin 4096 Oct 18 17:27 dev-elasticsearch-data-ws-es-master-nodes-1-pvc-52e9b807-ec8e-49bf-894f-9881140b24de
drwxr-xr-x  3 rsiadmin rsiadmin 4096 Oct 18 17:32 dev-elasticsearch-data-ws-es-master-nodes-1-pvc-f84aae88-ef12-4a1a-9628-8ddd6212723b

I changed the folder permissions to be 777 on the non-master nodes and the zookeeper pods finally restarted successfully. I had to apply this again as the kafka and entity-operator pods were subsequently deployed.

Note: I suspect that the difference in behaviour between elasticsearch and strimzi/kafka is that the strimzi image runs as a kafka user: https://github.com/strimzi/strimzi-kafka-operator/blob/master/docker-images/kafka/Dockerfile#L10-L12 This appears to be related: https://github.com/strimzi/strimzi-kafka-operator/issues/1720

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
strigona-worksightcommented, Jan 13, 2020

@DallanQ Yes. I logged into each node and changed the folder permissions sudo chmod 777 *.

Switching from hostpath to something like Rook would be a better solution though.

0reactions
masus04commented, May 6, 2021

@strigona-worksight And which folder would that be? Thx a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
1.16/candidate - Cluster volume permssion problems on non-master ... I changed the folder permissions to be 777 on the non-master nodes and ...
Read more >
Microk8s单机安装_明训的博客
microk8s默认启用了高可用插件ha-cluster,单机安装时需要禁用此插件,单机安装时使用的网络是flannel。
Read more >
Netkiller Container 札
use-context. 3.2. 如何从docker 过渡到kubectl 命令. 3.3. 查看信息 api-versions. 节点 nodes. 查询集群状态 config use-context cluster-info.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found