title: Changing configuration in running Kubernetes Pod
body: <p>I have written the <code>nifi.properties</code> into a <code>Kubernetes ConfigMap</code>. When I deploy NiFi (as a <code>StatefulSet</code>) I want to have this <code>nifi.properties</code> file to be used by the NiFi I just deployed. To do so I added a volume for the <code>ConfigMap</code> and mounted it in the Container. The associated <code>statefulset.yaml</code> looks like this:</p>
  
  <pre><code>...
  containers:
  - name: 'myName'
    image: 'apache/nifi:latest'
    ports:
      - name: http
        containerPort: 8080
        protocol: TCP
      - name: http-2
        containerPort: 1337
        protocol: TCP
    volumeMounts:
      - name: 'nifi-config'
        mountPath: /opt/nifi/nifi-1.6.0/conf/nifi.properties
  volumes:
  - name: 'nifi-config'
    configMap:
      name: 'nifi-config'
  ...
  </code></pre>
  
  <p>This doesn't work, I think it is, because NiFi is already running and the <code>nifi.properties</code> file is locked by the service. The pod cannot be created, I get an error: <code>...Device or resource is busy</code>. I also tried that with the <code>bootstrap.conf</code> file, which works, but I don't think that changes in there are recognized by the NiFi service because it would have to be restarted.  </p>
  
  <p>I already had the same issue with NiFi deployed on pure Docker, where I worked around by stopping the container, copying the files and starting the container; not very pretty, but working. </p>
  
  <p>Using environment variables to change values in NiFi as stated <a href="https://github.com/apache/nifi/tree/master/nifi-docker/dockerhub" rel="nofollow noreferrer">here</a> is also not an option, because the possibility of changing parameters there are very limited.</p>
  
  <p>This problem doesn't occurs for NiFi only. I think that there are many situations where someone want's to change the configuration for a system running within <code>Kubernetes</code>, so I hope there is any solution to handle this issue.</p>