Skip to content

add standard/portworx-labels host-label examples - #555

Open
aditya-kumar-ships-it wants to merge 6 commits into
Wind-River:masterfrom
aditya-kumar-ships-it:master
Open

add standard/portworx-labels host-label examples#555
aditya-kumar-ships-it wants to merge 6 commits into
Wind-River:masterfrom
aditya-kumar-ships-it:master

Conversation

@aditya-kumar-ships-it

@aditya-kumar-ships-it aditya-kumar-ships-it commented Jul 27, 2026

Copy link
Copy Markdown

This change adds a new Deployment Manager example configuration demonstrating
declarative Portworx node-placement labels via HostProfile on a Standard 2+5
system with mixed worker roles (storage, storageless, and pure compute).

The example uses HostProfile.spec.labels to assign two Portworx-consumed labels:

  • px-node: "true" — shared gate for KMM px-fuse module loading
  • portworx.io/node-type: "storage" | "storageless" — PX storage role selector

Three worker profiles are defined:

  • px-storage-worker-profile (3 workers, inherits from worker-profile, adds PX labels)
  • px-storageless-worker-profile (1 worker, inherits from worker-profile, adds PX labels)
  • worker-profile (1 pure-compute worker, no Portworx)

This is a standalone example (not a Kustomize overlay on standard/default)
because it targets dynamically provisioned hosts via spec.match.bootMAC,
whereas the default base uses static provisioning via spec.overrides.bootMAC.

Files added:

  • examples/standard/portworx-labels/config.yaml
  • examples/standard/portworx-labels/kustomization.yaml
  • examples/standard/portworx-labels/README.md

Signed-off-by: Aditya Kumar aditya.kumar@windriver.com

Demonstrates Deployment Manager HostProfile labels for declarative
Portworx node placement on a Standard 2+5 system with mixed worker
roles (storage, storageless, and pure compute).

Signed-off-by: Aditya Kumar <aditya.kumar@windriver.com>
@wasnio
wasnio requested review from wasnio and yjian118 July 27, 2026 13:57
ptpRole: none
uuid: ""
- class: platform
dataNetworks: []

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect to remove the none values from the interfaces, e.g.:

  1. dataNetworks: []
  2. maxRxRate: 0
  3. maxTxRate: 0
  4. ptpInterfaces: []
  5. ptpRole: none
  6. uuid: ""

it applies to all the interfaces in this file

@wasnio
wasnio requested a review from enzocandotti July 27, 2026 14:29
Remove dataNetworks, maxRxRate, maxTxRate, ptpInterfaces, ptpRole, and uuid defaults from all interface definitions per review feedback.

Signed-off-by: Aditya Kumar <aditya.kumar@windriver.com>
Signed-off-by: Aditya Kumar <aditya.kumar@windriver.com>
px-node is a custom label defined by us (not an official Portworx label).
Using the portworx.io/ prefix implied it was an upstream Portworx label,
which could cause confusion. Rename to the short-form 'px-node' in both
px-storage-worker-profile and px-storageless-worker-profile.

Signed-off-by: Aditya Kumar <aditya.kumar@windriver.com>
powerOn: true
provisioningMode: static
rootDevice: /dev/disk/by-path/pci-0000:00:1f.2-ata-1.0
storage:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the whole storage section as irrelevant to the new labels and specific to severs

powerOn: true
provisioningMode: static
rootDevice: /dev/disk/by-path/pci-0000:00:1f.2-ata-1.0
storage:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


| Label | Purpose |
|---|---|
| `portworx.io/px-node: "true"` | Shared gate — KMM loads `px.ko` on any node with this label |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README says portworx.io/px-node but config.yaml defines the label as just px-node (no portworx.io/ prefix). The PR description also says portworx.io/px-node.

Which is the actual label consumed by KMM?

  • If px-node → update README line 13, line 29, and PR description
  • If portworx.io/px-node → update config.yaml lines 289 and 397

As-is, a user following the README won't match what DM actually applies.

metadata:
labels:
controller-tools.k8s.io: "1.0"
name: controller-0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The System CR name should describe the system/cluster, not a host. Existing examples use descriptive names (e.g., vbox). Consider something like portworx-standard or px-cluster to avoid confusion with the Host CR also named controller-0 on line 106.

name: px-storage-worker-profile
namespace: deployment
spec:
administrativeState: unlocked

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using base: worker-profile here instead of repeating the full spec. This is the pattern used by existing examples (e.g., controller-profile uses base: common-profile). The px-* profiles would reduce to just:

spec:
  base: worker-profile
  labels:
    px-node: "true"
    portworx.io/node-type: "storage"

This also naturally addresses @yjian118's request to remove the storage section — inherited fields come from the base, so only label-specific additions remain. The example then clearly demonstrates only the label feature.

installOutput: graphical
interfaces:
ethernet:
- class: platform

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

px-storageless-worker-profile puts both mgmt and cluster-host on a single NIC (enp2s2), while worker-profile (line 164) and px-storage-worker-profile (line 278) split them across two NICs (enp2s2 + enp3s0).

Is this intentional for storageless nodes (fewer NICs needed since no storage traffic)? If so, a brief comment explaining why would help. If not, this may be a copy-paste issue.

This example demonstrates how to use Deployment Manager `HostProfile` labels
to declaratively assign Portworx placement labels on a Standard system with
mixed worker roles (storage, storageless, and pure compute).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a Prerequisites section here noting the minimum topology:

  • 2 controllers (HA)
  • 3 storage workers (Portworx quorum minimum)
  • 0+ storageless/pure-compute workers (optional)

Users who reduce storage workers below 3 will get a non-functional PX cluster with no obvious error. A one-line callout like:

Note: Portworx requires a minimum of 3 storage nodes for quorum.

...would save significant debugging time.

# CONTROLLER0MAC, CONTROLLER1MAC, WORKER0MAC, WORKER1MAC, WORKER2MAC, WORKER3MAC, WORKER4MAC
# CHANGEME_BASE64 (base64-encoded admin password)
# OS_REGION_NAME value (from: system show | grep region_name)
---

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broader question: every other examples/standard/* subdirectory is a Kustomize
overlay on standard/default. This example is standalone (~411 lines).

I see this uses spec.match.bootMAC with dynamic provisioning (DM discovers
existing hosts by MAC), while the existing standard/default base uses
spec.overrides.bootMAC with static provisioning (DM creates hosts with that MAC).

These are fundamentally different provisioning approaches, which makes overlaying
the existing base impractical.

Consider adding a brief note in the README explaining this is a standalone example (not an overlay on standard/default) because it targets dynamically provisioned hosts rather than statically provisioned ones.

OR align with the existing patterns

- Fix px-node label: use short-form 'px-node' in README (matches config.yaml)
- Refactor px-* profiles to use base: worker-profile (removes spec duplication)
- Remove storage sections from worker profiles (irrelevant to label example)
- Remove storage section from System CR
- Rename System CR from 'controller-0' to 'px-standard'
- Fix NIC inconsistency: storageless profile now inherits 2-NIC split from base
- Add Prerequisites section to README (3-node PX quorum requirement)
- Add Standalone Example section explaining why this is not a Kustomize overlay

Signed-off-by: Aditya Kumar <aditya.kumar@windriver.com>
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.

3 participants