Orange-OpenSource / nifikop

The NiFiKop NiFi Kubernetes operator makes it easy to run Apache NiFi on Kubernetes. Apache NiFI is a free, open-source solution that support powerful and scalable directed graphs of data routing, transformation, and system mediation logic.
https://orange-opensource.github.io/nifikop/
Apache License 2.0
128 stars 34 forks source link

adding env varibales to nifi cluster pods #177

Open yossisht9876 opened 2 years ago

yossisht9876 commented 2 years ago

Hi Guys is there add way to TAG the nifi cluster pods ? or add ENV variables to the nifi pods like env = dev\prod ?

here is my conf:


metadata:
  name: nificluster
spec:
  service:
    headlessEnabled: true
  zkAddress: "zookeeper:2181"
  zkPath: "/nifi"
  clusterImage: "apache/nifi:1.13.2"
  oneNifiNodePerNode: false
  managedAdminUsers:
    -  identity: "nidddha.com"
       name: "ndd.s"
    -  identity: "yodddusddha.dd"
       name: "yddi.s"
  propagateLabels: true
  nifiClusterTaskSpec:
    retryDurationMinutes: 10
  readOnlyConfig:
    logbackConfig:
      # logback.xml configuration that will replace the one produced based on template
      replaceConfigMap:
        # The key of the value,in data content, that we want use.
        data: logback.xml
        # Name of the configmap that we want to refer.
        name: nifi-configs
        # Namespace where is located the secret that we want to refer.
        namespace: nifi
    nifiProperties:
      webProxyHosts:
        - nifi.dddv.ludddsha.co
      # Additionnals nifi.properties configuration that will override the one produced based
      # on template and configurations.
      overrideConfigs: |
        xxxxxxxxxxxx
  nodeConfigGroups:
    default_group:
      serviceAccountName: "default"
      runAsUser: 1000
      fsGroup: 1000
      isNode: true
      storageConfigs:
        - mountPath: "/opt/nifi/nifi-current/logs"
          name: logs
          pvcSpec:
            accessModes:
              - ReadWriteOnce
            storageClassName: "gp2"
            resources:
              requests:
                storage: 20Gi
        - mountPath: "/opt/nifi/data"
          name: data
          pvcSpec:
            accessModes:
              - ReadWriteOnce
            storageClassName: "gp2"
            resources:
              requests:
                storage: 50Gi
        - mountPath: "/opt/nifi/flowfile_repository"
          name: flowfile-repository
          pvcSpec:
            accessModes:
              - ReadWriteOnce
            storageClassName: "gp2"
            resources:
              requests:
                storage: 50Gi
        - mountPath: "/opt/nifi/nifi-current/conf"
          name: conf
          pvcSpec:
            accessModes:
              - ReadWriteOnce
            storageClassName: "gp2"
            resources:
              requests:
                storage: 10Gi
        - mountPath: "/opt/nifi/content_repository"
          name: content-repository
          pvcSpec:
            accessModes:
              - ReadWriteOnce
            storageClassName: "gp2"
            resources:
              requests:
                storage: 50Gi
        - mountPath: "/opt/nifi/provenance_repository"
          name: provenance-repository
          pvcSpec:
            accessModes:
              - ReadWriteOnce
            storageClassName: "gp2"
            resources:
              requests:
                storage: 50Gi
      resourcesRequirements:
        limits:
          cpu: "2"
          memory: 2Gi
        requests:
          cpu: "1"
          memory: 1Gi
  nodes:
    - id: 0
      nodeConfigGroup: "default_group"
    - id: 1
      nodeConfigGroup: "default_group"
    - id: 2
      nodeConfigGroup: "default_group"
  listenersConfig:
    internalListeners:
      - type: "https"
        name: "https"
        containerPort: 8443
      - type: "cluster"
        name: "cluster"
        containerPort: 6007
      - type: "s2s"
        name: "s2s"
        containerPort: 10000
      - type: "prometheus"
        name: "prometheus"
        containerPort: 9090
    sslSecrets:
      tlsSecretName: "nifi-sdds"
      create: true
  externalServices:
    - name: "nifi-clds"
      spec:
        type: ClusterIP
        portConfigs:
          - port: 8443
            internalListenerName: "https"
mh013370 commented 2 years ago

I raised #150 to be able to add custom labels to nifi pods, but it hasn't been merged yet. You can already add custom pod annotations if that would suit: https://orange-opensource.github.io/nifikop/docs/5_references/1_nifi_cluster/1_nifi_cluster#podpolicy

And you can add additional env variables to the nifi pods this way: https://orange-opensource.github.io/nifikop/docs/5_references/1_nifi_cluster/2_read_only_config#readonlyconfig

yossisht9876 commented 2 years ago

@michael81877 thanks but maybe i missing something - where i should put it :