Okay. I tried on kubernetes using the mounted volumes, following are a few things to consider. 1. Are you using a deployment or a statefulset, from kubernetes perspective I would suggest you to deploy using statefulset. 2. You need to use securitycontext and following might help you to get access to the mounted filesystems.
securityContext: runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 3. conf is a special directory which has prepopulated config files, so if you want to mount a volume to conf directory then you would need to get those pre-existing files to the mounted volumes using some way for eg. confgmap as suggested in https://issues.apache.org/jira/browse/NIFI-6484 Let me know if this helps or if you have any other questions. On Mon, Nov 9, 2020 at 10:46 AM Sushil Kumar <[email protected]> wrote: > It would be really helpful if you can send in your spec that you used and > has got issues. > > I am gonna give it a try myself also with all the disks as the mounted > volumes to see if issue exists. > > On Mon, Nov 9, 2020 at 4:11 AM muhyid72 <[email protected]> wrote: > >> Hi Sushil, >> Thanks for support >> I am trying to run standalone NiFi 1.12.1 (not cluster) on Kubernetes. I >> am >> planning to migrate my NiFi instance from VM to Kubernetes. >> I deployed official image to Kubernetes (standalone one replica, not >> cluster). I used Persistent Volume and Persistent Volume Claim for >> persistency requirements. >> I tried that scenario on my virtual test environment (with NFS) and Azure >> AKS (with standard Azure Disk): >> I mounted all folders which are required for persistency (conf, state, >> flowfile_repository etc.) one by one with PersistentVolumeClaim on the pod >> (I used only one pod). >> I didn't encounter any problem (I saw related files in the mounted >> folders, >> they were successfully redirected to mounted disks) till try to conf >> folder. >> When I mount conf folder to Kubernetes (on my virtual test environment and >> Azure AKS ) through volumeMounts in the yaml file I saw those errors: >> "replacing target file /opt/nifi/nifi-current/conf/nifi.properties" >> "sed: can't read /opt/nifi/nifi-current/conf/nifi.properties: No such file >> or directory" >> It seems when container creates it doesn't see the mounted volume for conf >> folder (nifi.properties file) because nifi.properties file is creating by >> application before VolumeMounts >> When I investigated more deeply I encountered that bug record Apache >> NiFi / NIFI-6484 (https://issues.apache.org/jira/browse/NIFI-6484) >> >> Shortly I would like to use persistent disk for not losing any important >> data (nifi.properties, users.xml, authorizations.xml etc.). I did all >> persistency required folders with VolumeMount and PersistentVolumeClaim >> except the conf folder >> >> My PoC Environment: >> Apache Nifi 1.12.1 Official Image (https://hub.docker.com/r/apache/nifi/) >> 1 master 2 worker nodes (on VirtualBox and on Azure Kubernetes Services >> (AKS)) >> Deployment is standalone not cluster therefore I am using standard >> deployment yaml with single replica. >> >> Kind Regards >> >> >> >> -- >> Sent from: http://apache-nifi-users-list.2361937.n4.nabble.com/ >> >
