nifikop icon indicating copy to clipboard operation
nifikop copied to clipboard

Override secret /configmap configuration files

Open tty47 opened this issue 4 years ago • 2 comments

Question

How can I update the config files (nifi.properties, state-management.xml, zookeeper.properties, bootstrap-notification-servces.xml, bootstrap.conf, logback.xml, login-identity-providers.xml)? I mean, with the latest update PR-87 it creates a secret with all the config files in base64, if I need to modify any value of that, how can I do it?

Question

What did you do? I need to being able to update the config files.

What did you expect to see? update the configmaps or secrets (I don't know exactly which one) and they will be update inside the pods next deploy.

What did you see instead? Under which circumstances? There is no change, it keeps the version inside the secrets.

Environment

  • nifikop version: v0.6.3-release

  • Kubernetes version information:

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.4", GitCommit:"3cce4a82b44f032d0cd1a1790e6d2f5a55d20aae", GitTreeState:"clean", BuildDate:"2021-08-13T15:45:10Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.10", GitCommit:"f3add640dbcd4f3c33a7749f38baaac0b3fe810d", GitTreeState:"clean", BuildDate:"2020-05-20T13:51:56Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.21) and server (1.16) exceeds the supported minor version skew of +/-1

tty47 avatar Aug 25 '21 12:08 tty47

Take a look on this page, you have the list of configurations that you can override : https://orange-opensource.github.io/nifikop/docs/5_references/1_nifi_cluster/2_read_only_config#readonlyconfig

For example for the nifi.properties you have three options :

  • Use directly in the NifiCluster resource the field overrideConfigs which expect a string like here : https://github.com/Orange-OpenSource/nifikop/blob/master/config/samples/nifi_v1alpha1_nificluster.yaml#L94
  • Define your configuration in a configmap and reference it using the field overrideConfigMap : https://github.com/Orange-OpenSource/nifikop/blob/master/config/samples/nifi_v1alpha1_nificluster.yaml#L76
  • Define your configuration in a secret and reference it using the field overrideSecretConfig : https://github.com/Orange-OpenSource/nifikop/blob/master/config/samples/nifi_v1alpha1_nificluster.yaml#L85

You can use some or all of them, they will be merged into a single nifi.properties file, if this is the case and the same property is defined several time, we will keep the one defined with the following priority Secret > ConfigMap > OverrideConfig.

erdrix avatar Aug 25 '21 12:08 erdrix

Hello @erdrix Thanks for your response.

As you said, I was using the second option (overrideConfigMap) using something like this:

  readOnlyConfig:
    nifiProperties:
      overrideConfigMap:
        data: nifi.properties
        name: nifi-config
        namespace: nifi

The thing is, I have created a ConfigMap with some data inside, one of the is nifi.properties. Once I update that configmap wih new config, I expect to have the new config reflected in the pod.

I realize that the secret which is generated: nifi-config-0 contains data in base64 but this data is not the data in the configmap...

I tried to delete the cm and created again, it has the data updated, I delete the secrets and automatically are created but, the data is not the same...

Do you know what can be the issue?

Thanks in advance

tty47 avatar Aug 25 '21 13:08 tty47