Skip to content

Add device provisioning documentation - #530

Open
swagner-de wants to merge 1 commit into
mainfrom
docs/provisioning
Open

Add device provisioning documentation#530
swagner-de wants to merge 1 commit into
mainfrom
docs/provisioning

Conversation

@swagner-de

Copy link
Copy Markdown
Contributor

Document the platform-agnostic provisioning contract in
docs/concepts/provisioning.md: the Device resource, lifecycle phases,
HTTP endpoints, source validation, the ProvisioningProvider hook
interface, and password handling. Document Cisco NX-OS specifics
(POAP, install all, password hash formats) in docs/concepts/ztp-nxos.md,
with the reference POAP boot script at hack/ztp/nxos.py.

Signed-off-by: Sebastian Wagner sebastian.wagner02@sap.com

Document the platform-agnostic provisioning contract in
docs/concepts/provisioning.md: the Device resource, lifecycle phases,
HTTP endpoints, source validation, the ProvisioningProvider hook
interface, and password handling. Document Cisco NX-OS specifics
(POAP, install all, password hash formats) in docs/concepts/ztp-nxos.md,
with the reference POAP boot script at hack/ztp/nxos.py.

Signed-off-by: Sebastian Wagner <sebastian.wagner02@sap.com>
@swagner-de
swagner-de enabled auto-merge (rebase) August 28, 2026 13:42
@felix-kaestner felix-kaestner changed the title docs: add device provisioning documentation Add device provisioning documentation Aug 28, 2026
@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Aug 29, 2026
@hardikdr hardikdr added this to Roadmap Aug 29, 2026
{ text: 'Pausing Reconciliation', link: '/concepts/pausing' },
{ text: 'Numbered Resources', link: '/concepts/numbered-resources' },
{ text: 'Device Provisioning', link: '/concepts/provisioning' },
{ text: 'ZTP for Cisco NX-OS', link: '/concepts/ztp-nxos' },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't "ZTP for Cisco NX-OS" be a sub-section under the the "Device Provisioning"?

@@ -0,0 +1,212 @@
# Device Provisioning

The network operator can bootstrap a device automatically on first boot, from initial network configuration through OS image upgrade and final handoff to the operator. This page describes the platform-agnostic provisioning contract: the `Device` resource, the lifecycle phases, the HTTP endpoints a device talks to, and the provider hook interface a new platform must implement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lifecycle phases and the http endpoints were already documented in https://github.com/ironcore-dev/network-operator/blob/main/docs/tutorials/device-onboarding.md#device-lifecycle-phases. Please condense this information to a single location.


The `provisioning.image` section tells the operator which image the device should run. When the boot script contacts the operator, this is what gets returned in the config response.

The `provisioning.bootScript` holds the boot script the device runs, supplied inline or from a referenced Secret or ConfigMap. The operator ships an optional built-in TFTP server (beta) that serves this script directly: the device requests a filename encoding its serial (`serial-<serial>` or `<serial>.<ext>`), the server resolves the matching `Device`, reads `spec.provisioning.bootScript`, and returns its contents as-is. With source validation enabled it also checks that the client IP matches the device endpoint and the serial matches `status.serialNumber`. If you already run your own TFTP infrastructure, delivery can stay external to the operator instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where do we take the "beta" state of the built-in TFTP Server from?


### `GET /provisioning/mtls-client-ca` and `GET /provisioning/device-certificate`

Both are optional. They let the device fetch the operator's mTLS client CA and a per-device certificate so the operator can later connect over an authenticated channel. A device that does not need certificates can ignore these; the operator returns `404` when there is nothing to hand out, which the boot script treats as "skip".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"per-device" is nothing the operator does or enforces. It just serves what a user sets in the Device spec. How these server certificates are created, is up to the user.


## Provisioning provider interface

A platform plugs into provisioning by implementing `ProvisioningProvider` (`internal/provider/provider.go`):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Anything in /internal is intentionally private and no public API (ref/ https://github.com/golang-standards/project-layout/tree/master/internal). As such I'm not sure we want to document that in a public documentation. With code in /internal we reserve the possibility to change that interface at any time w/o external guarantees.


The operator never sends a plaintext password to the device over the provisioning channel. That channel may be unauthenticated or otherwise not fully trusted (the device has not yet been secured, and the operator does not verify the device's identity at this stage), so shipping a cleartext credential over it would be unsafe.

Instead the operator reads the admin credential from the device's endpoint Secret and passes the plaintext to the provider's `HashProvisioningPassword` hook. The hook returns two things: a hash in the device's native on-box format, and an algorithm label identifying which hash format it is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't have any "admin" semantics here. This is just a user account from the device spec from our perspective.


Both are placed in the config response as `userAccounts[].hashedPassword` and `userAccounts[].hashAlgorithm`. The boot script maps the algorithm label to the platform's corresponding on-device password type and configures the account with the pre-hashed value; the plaintext never leaves the operator.

## Observing provisioning progress

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This just shows normal kubectl usage, nothing specific to our network-operator. As such, do we even want to have that in our documentation. Users can also choose an GUI or any other way of looking at kubernetes resources.

Comment thread docs/concepts/ztp-nxos.md

## Boot script

The network operator ships its own POAP boot script at [`hack/ztp/nxos.py`](https://github.com/ironcore-dev/network-operator/blob/main/hack/ztp/nxos.py). It is not Cisco's reference POAP script; it talks to the operator's provisioning API and uses `install all` (see below). Site-specific values like the provisioning server URL have been replaced with placeholders and must be adapted to your environment before use.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't do that by default (like this sentence implies). This is just an example. Users might set their own version, however they desire.

This whole document is written in this way that the "network operator provides" which is not the case. We should rephrase this to state this as an example for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/XL

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants