NiFiKop Kubernetes Operator

repository·master·Indexed 42 days ago

https://github.com/konpyutaika/nifikop

A Kubernetes operator for automating the lifecycle of Apache NiFi clusters, including provisioning, scaling, and secure operations. It provides Custom Resource Definitions (CRDs) for managing NiFi clusters, users, user groups, registry clients, parameter contexts, and dataflows. The operator supports OIDC integration with Keycloak, path normalization via NGINX proxies for custom context paths, and native NiFi TLS auto-reload.

Tokens
85.1K
Snippets
208
Records
296
Agent score
53%

What's inside NiFiKop

  1. Overview of NiFiKop Helm Chart

    master

    NiFiKop is a Helm chart used to install the Konpyūtāika Nifi Kubernetes operator. The operator is designed to create, configure, and manage Apache NiFi clusters within a Kubernetes Namespace.

    Upon installation, the chart manages several Custom Resource Definitions (CRDs) that allow you to define NiFi-specific resources as Kubernetes objects.

  2. What is NiFiKop

    master
    NiFiKop is a Kubernetes operator designed to automate the provisioning, management, autoscaling, and operations of Apache NiFi clusters on Kubernetes. It provides a way to manage NiFi clusters using Custom Resource Definitions (CRDs) for advanced dataflow and user management.
  3. Overview of NiFiKop capabilities

    master

    NiFiKop is a Kubernetes operator designed to automate the provisioning, management, autoscaling, and operations of Apache NiFi clusters on Kubernetes.

    Key features include:

    • Fine-grained node configuration: Support for specific settings at the node level.
    • Graceful operations: Supports graceful rolling upgrades and graceful NiFi cluster scaling.
    • Autoscaling: Automated scaling of NiFi clusters based on demand.
    • Security: Provisioning of secure NiFi clusters with encrypted communication using SSL.
    • Management via CRD: Advanced Dataflow and user management handled through Custom Resource Definitions (CRDs).
  4. Choose a ComponentUpdateStrategy for data handling

    master

    When updating a dataflow, you must specify an updateStrategy to define how the operator handles existing data in the flow.

    • drain (DrainStrategy): Shuts down only input components (e.g., Input processors, remote input process groups) and waits for the dataflow to be fully drained before proceeding.
    • drop (DropStrategy): Shuts down all components and immediately drops all flowfiles currently in the flow.
    spec:
      updateStrategy: drain # or 'drop'
  5. Understand the design principles of NiFi cluster auto-scaling

    master

    NiFiKop implements auto-scaling by mimicking the Kubernetes Horizontal Pod Autoscaler (HPA) pattern. Instead of scaling pods directly, NiFiKop introduces a separation of concerns between the cluster definition and the scaling management.

    Key Concepts

    • Separation of Concerns: The NiFiCluster resource manages the pods, while a new resource, NifiNodeGroupAutoScaler, manages the scaling of the NiFiCluster.
    • Hybrid Scaling Models: This design allows you to mix fixed node groups and auto-scaled node groups within the same cluster. You can start with no scaling, add scaling to a subset of nodes, or disable autoscaling without impacting the existing cluster configuration.
    • Sub-resource Scaling: The implementation follows official Kubernetes guidelines by using the scale sub-resource in the Custom Resource Definition (CRD). This allows standard Kubernetes tools (like HPA) to manage the scale.spec.replicas field of the resource.
  6. Configure NiFi node identity and controller templates

    master

    When defining a NifiClusterSpec, you must specify templates for naming node identities and controllers.

    Warning: Once these values are defined, do not change them. Changing these values will prevent the operator from being able to manage the cluster.

    • nodeUserIdentityTemplate: A template for naming the node user identity (e.g., node-%d-mysuffix). Defaults to node-%d-<cluster-name>.
    • nifiControllerTemplate: A template for naming the node controller (e.g., %s-mysuffix). Defaults to %s-controller.
    • controllerUserIdentity: Specifies the identity for the static admin user.
  7. How versioned documentation works

    master

    The website uses versioning to allow users to access API references for specific React Native releases.

    • Versioned files: When a new version is created, changes from docs and website/sidebars.json are copied to website/versioned_docs and website/versioned_sidebars.
    • Warning: Do not manually edit files in versioned_docs or versioned_sidebars unless absolutely necessary, as edits to older versions do not propagate to newer ones.
    • Version tracking: The website/versions.json file tracks all available versions in reverse chronological order.
    • Cutting a new version: To release a new version of the documentation, use the Docusaurus CLI command from the website directory.
    cd react-native-website
    cd website
    yarn run docusaurus docs:version <newVersion>
  8. Use managed groups to simplify user and access management

    master

    To avoid creating numerous .yaml files for users and groups across multiple NiFi clusters, NiFiKop provides two built-in managed groups:

    • Admins: A group providing full access to the NiFi Cluster.
    • Readers: A group providing viewer-only access to the NiFi Cluster.

    You can define the users belonging to these groups directly within the NifiCluster.Spec field using managedAdminUsers and managedReaderUsers. The operator will automatically create the corresponding NifiUser resources and manage the group memberships.

    In addition to these, the operator automatically manages a managed-nodes group, which contains a NifiUser for each node in the cluster to ensure correct access permissions.

    apiVersion: nifi.konpyutaika.com/v1
    kind: NifiCluster
    metadata:
      name: mynifi
    spec:
      ...
      managedAdminUsers:
        -  identity: "alexandre.guitton@konpyutaika.com"
           name: "aguitton"
        -  identity: "nifiuser@konpyutaika.com"
           name: "nifiuser"
      managedReaderUsers:
        -  identity: "toto@konpyutaika.com"
           name: "toto"
  9. Manage NiFi users and access policies

    master

    NiFiKop provides automated user and group management to support fully automated cluster setups, including node scaling and operator administrative rights.

    Core Resources

    • NifiUser: Creates or binds a user in the NiFi cluster and applies managed access policies that are continuously synced by the operator.
    • NifiUserGroup: Creates groups in the NiFi cluster, applies access policies, and manages a list of NifiUser resources.

    Default Groups

    For simpler use cases where creating individual Kubernetes resources is unnecessary, you can use two built-in default groups:

    • Admins: A group providing full access to the entire NiFi Cluster.
    • Readers: A group providing viewer-only access to the NiFi Cluster.
  10. Manage NiFi Dataflow lifecycle via CRDs

    master

    NiFiKop allows you to manage the entire lifecycle of NiFi applications using a cloud-native approach. Instead of manual configuration, you describe your desired state using Custom Resources (CRDs), and the operator uses the NiFi REST API to ensure the cluster stays in sync with your definitions.

    Key capabilities include:

    • Automated Deployment: Deploy NiFiDataflow resources based on a NiFi Registry.
    • Portability: Describe registry clients, parameter contexts, and dataflows as YAML files to redeploy the same application across different namespaces or clusters.
    • State Management: The operator continuously reconciles the cluster state, correcting manual changes made directly in the NiFi UI.
    • Environment-specific Configurations: Use Parameter Contexts to associate different configurations with a Dataflow depending on the target environment.
  11. Core features of NiFiKop

    master

    NiFiKop provides several key capabilities for managing Apache NiFi on Kubernetes:

    • Fine grained node configuration: Support for specific node settings.
    • Graceful rolling upgrades: Update NiFi versions without downtime.
    • Graceful cluster scaling: Scale the NiFi cluster up or down safely.
    • Secure provisioning: Provisioning of secure NiFi clusters with encrypted communication using SSL.
    • CRD-based management: Advanced Dataflow and user management via Custom Resource Definitions.