Skip to content

refactor: Flatten ConfigMaps and introduce RoleBuilder - #827

Open
adwk67 wants to merge 15 commits into
mainfrom
refactor/flatten-config-maps
Open

adwk67 wants to merge 15 commits into
mainfrom
refactor/flatten-config-maps

Conversation

@adwk67

@adwk67 adwk67 commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Description

Part of https://github.com/stackabletech/internal-issues/issues/167

--- PASS: kuttl (2434.99s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/resources_hbase-latest-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (680.25s)
        --- PASS: kuttl/harness/orphaned_resources_hbase-latest-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (684.37s)
        --- PASS: kuttl/harness/opa_hbase-opa-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_krb5-1.21.1_opa-latest-1.20.2_openshift-false (551.17s)
        --- PASS: kuttl/harness/kerberos_hbase-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_krb5-1.21.1_listener-class-external-unstable_kerberos-realm-PROD.MYCORP_kerberos-backend-mit_openshift-false (560.98s)
        --- PASS: kuttl/harness/logging_hbase-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (190.86s)
        --- PASS: kuttl/harness/profiling_hbase-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (211.61s)
        --- PASS: kuttl/harness/overrides_hbase-latest-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (209.43s)
        --- PASS: kuttl/harness/shutdown_hbase-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (381.71s)
        --- PASS: kuttl/harness/external-access_hbase-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (198.18s)
        --- PASS: kuttl/harness/omid_hbase-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false_omid-1.1.3 (299.99s)
        --- PASS: kuttl/harness/smoke_hbase-3.0.0_hdfs-3.5.0_zookeeper-3.9.6_listener-class-external-unstable_openshift-false (240.92s)
        --- PASS: kuttl/harness/cluster-operation_hbase-latest-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (247.43s)
        --- PASS: kuttl/harness/snapshot-export_hbase-3.0.0_hdfs-latest-3.5.0_zookeeper-latest-3.9.6_openshift-false (329.50s)
PASS
%%{init: {"flowchart": {"wrappingWidth": 900, "htmlLabels": true}}}%%
flowchart TB
    START["`**build()** mod.rs:104`"]
    START --> LM
    START --> LR
    START --> LS

    subgraph master_track["Master"]
        direction TB
        LM["`**loop** over master_role_group_configs · mod.rs:111
        **build_pdb()** :120`"]
        RM["`**master::build()** role_group/master.rs:30
        **build_listener_volume()** :51 · ListenerPlacement::PodVolume
        **RoleGroupInputs { .. }** :55 · master_entries() :80 · HBASE_MASTER_OPTS :79 · TTL 5 :27 · no region mover :68`"]
        LM --> RM
    end

    subgraph region_server_track["RegionServer"]
        direction TB
        LR["`**loop** over region_server_role_group_configs · mod.rs:124
        **build_pdb()** :133`"]
        RR["`**region_server::build()** role_group/region_server.rs:27
        **build_listener_volume()** :48 · ListenerPlacement::PodVolume
        **RoleGroupInputs { .. }** :52 · region_server_entries() :77 · HBASE_REGIONSERVER_OPTS :76 · TTL 10 :24
        **region_mover_args()** :65 · run_before_shutdown :66`"]
        LR --> RR
    end

    subgraph rest_server_track["RestServer"]
        direction TB
        LS["`**loop** over rest_server_role_group_configs · mod.rs:141
        **build_pdb()** :151 · only if the role is present`"]
        RS["`**rest_server::build()** role_group/rest_server.rs:27
        **build_listener_pvc()** :46 · ListenerPlacement::ClaimTemplate, unversioned labels
        **RoleGroupInputs { .. }** :51 · rest_server_entries() :76 · HBASE_REST_OPTS :75 · TTL 30 :24 · no region mover :64`"]
        LS --> RS
    end

    RM --> NEW
    RR --> NEW
    RS --> NEW

    NEW["`**RoleGroupBuilder::new(inputs)** role_group/mod.rs:142 · resolve, same for every role
    **config_map_data()** resource/config_map.rs:71 · hbase-site.xml :75 (role entries, client_bootstrap_servers :83) · hbase-env.sh :87 (OPTS variable, validated overrides) · security.properties :105 (TTL) · ssl-*.xml · log4j2 · vector.yaml
    **containers_and_volumes()** container.rs:93 · hbase container with probes and env · pod_volumes :200 (hbase-config, hdfs-discovery, log, log-config) · Kerberos + TLS :237 · listener volume or claim template :247 · Vector sidecar :259`"]

    NEW --> ADD["`**RoleGroupResources::add()** mod.rs:91 · emit
    **build_services()** role_group/mod.rs:167 · headless + metrics Service
    **build_config_map()** resource/config_map.rs:38 · wraps builder.config_map_data
    **build_statefulset()** resource/statefulset.rs:38 · add_volumes :60 · grace period :78 · containers :82 · pod overrides :88 · volume_claim_templates :109`"]

    ADD --> OUT["`**KubernetesResources { .. }** mod.rs:166
    PDBs from the role level above · **build_discovery_config_map()** :164 · **build_service_account()** · **build_role_binding()**`"]
    OUT --> APPLY["`**apply()** apply.rs:69 · outside build/`"]

    classDef master fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef region_server fill:#fde68a,stroke:#b45309,color:#78350f
    classDef rest_server fill:#bbf7d0,stroke:#15803d,color:#14532d
    classDef shared fill:#e5e7eb,stroke:#4b5563,color:#111827
    classDef edge fill:#ffffff,stroke:#6b7280,color:#111827,stroke-dasharray:4 2
    class LM,RM master
    class LR,RR region_server
    class LS,RS rest_server
    class NEW,ADD,OUT shared
    class START,APPLY edge
    style master_track fill:#eff6ff,stroke:#93c5fd
    style region_server_track fill:#fffbeb,stroke:#fcd34d
    style rest_server_track fill:#f0fdf4,stroke:#86efac
Loading

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@adwk67 adwk67 self-assigned this Oct 19, 2026
@adwk67
adwk67 marked this pull request as ready for review October 20, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant