aki0000 / k8s-myplayground

0 stars 0 forks source link

Clashloopbackoff of grafana #27

Closed aki0000 closed 3 years ago

aki0000 commented 3 years ago
monitoring       grafana-0                         0/1     CrashLoopBackOff   3          74s
root@ras01:~# k logs -n monitoring grafana-0
GF_PATHS_DATA='/var/lib/grafana' is not writable.
You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later
mkdir: can't create directory '/var/lib/grafana/plugins': Read-only file system
aki0000 commented 3 years ago

It seems that issue on NFS destination.

root@ras01:/mnt/data# sudo touch test.txt
touch: cannot touch 'test.txt': Read-only file system
aki0000 commented 3 years ago

First of all. NFS server need to be mounted a ssd.

vim /etc/fstab
cat /etc/fstab
LABEL=writable  /        ext4   defaults        0 0
LABEL=system-boot       /boot/firmware  vfat    defaults        0       1
/dev/sda1 /mnt/nfs ext4 defaults 1 2

refered for that below https://www.infraeye.com/study/linuxz24.html

aki0000 commented 3 years ago

Each NFS client needs to be configured like below

root@ras01:~# cat /etc/fstab
LABEL=writable  /        ext4   defaults        0 0
LABEL=system-boot       /boot/firmware  vfat    defaults        0       1
192.168.100.109:/mnt/nfs /mnt/data nfs rw,hard,intr 0 0
root@ras01:~# mount -a

After that, reboot

aki0000 commented 3 years ago

It can be mounted by PVC, and Pods running

# Helm 
 helm install grafana -n monitoring grafana/
# Verify pods running status
 k get pods  -n monitoring
NAME                          READY   STATUS    RESTARTS   AGE
grafana-0                     1/1     Running   0          53s
prometheus-55f56d699d-p4b9m   1/1     Running   3          44h