Skip to main content
EnterpriseAI Platform

Zarf Migration Guide

Use this guide to bring the existing hami component of a HAMi Enterprise or HAMi AI Platform deployment under Zarf management. The v0.1.0 delivery uses Zarf v0.86.0. Plan a full AI Platform migration separately.

Follow the HAMi Enterprise deployment guide or the HAMi AI Platform deployment guide to obtain, verify, and extract the archive, and to install Zarf. Keep PACKAGE set to the inner main package path for your architecture. If Zarf is not yet initialized on the target cluster, initialize it using the deployment guide.

Replace <VALUES_FILE> with the path to your migration values file, such as package-values.yaml.

Plan a full HAMi AI Platform migration​

Inventory the existing platform, Gateway, and Prometheus Helm releases and their configuration, and back up the platform configuration. If the cluster uses Metering or retains Metering data, record the Metering Helm release and settings, back up its database, and plan how to retain the PostgreSQL release, persistent volume, and credentials.

Bundled Metering is disabled by default in v0.1.0 Slim. If you plan to enable Metering in the target deployment, put database settings under the top-level postgresql key and Metering settings under hami-ai-platform.metering. The bundled PACKAGE-VALUES.md describes the configuration and Secret requirements for both hami-metering and kantaloupe-system.

Before migrating existing Metering data, test backup restoration, the data upgrade, and Flyway changes on a database copy, then use those results to plan production steps. Validate a full platform migration separately, including the Metering cutover if applicable.

First determine how HAMi Enterprise is currently installed:

--take-ownership and --force-conflicts are two important zarf package deploy parameters.

Current stateRecommended approachUse --take-ownership by default?Use --force-conflicts by default?
No HAMi Enterprise in the clusterDeploy directly with ZarfNoNo
Helm release with the same name already existsLet the Zarf package take over subsequent deployments and upgradesNoNo
Helm release with a different name already existsMigrate during a maintenance window; do not let two releases manage the same resourcesCase by caseNo
Resources created by Kustomize or kubectl applyUse --take-ownership to take over the resourcesYesOnly if field conflicts occur
Only some fields were changed by HPA or manual kubectlDeploy normally and handle SSA field conflicts if they occurNoAs needed

Do not leave the old Helm release and the Zarf-managed release managing the same objects for a long time. Subsequent upgrades, rollbacks, or uninstalls on either side may affect resources already taken over by the other side.

Limitations of Installing Components with Zarf​

Control the Image Rewrite Scope Explicitly with Labels​

We recommend initializing Zarf with zarf init --agent-mutation-policy=labeled. This policy rewrites only resources labeled zarf.dev/agent: mutate, or resources in a namespace with that label. An individual workload that must retain its original image reference can be labeled zarf.dev/agent: ignore, and a resource label takes precedence over the namespace label. This allows image rewriting to be controlled per resource, even within the same cluster or namespace, without having the Agent manage every application namespace by default. Only images included in the Zarf package can be rewritten and pulled in an offline environment. After changing labels, recreate existing Pods because they are not updated automatically.

Manage Each Set of Resources Through a Single Delivery Pipeline​

Zarf manages the chart releases in a package through Helm. Managing the same Kubernetes resources in parallel through another native Helm workflow can still cause release ownership, field ownership, and upgrade ordering conflicts. Continue routine upgrades with a newer Zarf package. If existing resources must be transferred to Zarf, review the release and resource scope before using --take-ownership. Use --force-conflicts only for Server-Side Apply field conflicts that you have confirmed may be overwritten; it should not be used as a routine installation option.

Pre-Migration Preparation​

Verify Tool Availability​

kubectl version
kubectl get nodes
zarf version

If Helm is not installed separately in the target environment, you can use the Helm bundled with Zarf:

zarf tools helm version
zarf tools helm list -A

Confirm the Current Installation Method​

Check the current Helm release:

zarf tools helm list -A

If a release corresponding to HAMi Enterprise is found, record its namespace and release name. A common scenario is:

namespace: hami-system
release: hami

Check HAMi-related resources:

kubectl get ns hami-system
kubectl -n hami-system get pods,deploy,ds,svc,cm,secret

Check Helm ownership information on resources:

kubectl -n hami-system get deploy,ds,svc,cm,secret,sa,role,rolebinding \
-o custom-columns='KIND:.kind,NAME:.metadata.name,MANAGED_BY:.metadata.labels.app\.kubernetes\.io/managed-by,RELEASE:.metadata.annotations.meta\.helm\.sh/release-name,RELEASE_NS:.metadata.annotations.meta\.helm\.sh/release-namespace'

Check HAMi-related cluster-scoped resources:

kubectl get clusterrole,clusterrolebinding,mutatingwebhookconfiguration,validatingwebhookconfiguration \
-o name | grep -i hami

Back Up the Current Configuration and State​

Store backups in an access-controlled location and retain the license Secrets, storage information, and existing release details needed for restoration.

If the current deployment is a Helm release:

zarf tools helm -n hami-system get values <OLD_RELEASE> -o yaml > hami-current-values.yaml
zarf tools helm -n hami-system get manifest <OLD_RELEASE> > hami-current-manifest.yaml
zarf tools helm -n hami-system status <OLD_RELEASE> > hami-current-status.txt

If the current deployment is not managed by Helm, it is still recommended to export the existing YAML:

kubectl -n hami-system get deploy,ds,svc,cm,secret,sa,role,rolebinding -o yaml > hami-current-resources.yaml

Save the current runtime state:

kubectl -n hami-system get pods -o wide
kubectl get nodes --show-labels
kubectl get events -A --sort-by=.lastTimestamp | tail -100

If the cluster already has HAMi license Secrets or customer-specific custom configurations, back those up as well.

Prepare Migration Values​

Check how the existing values are structured. Wrap native Helm values and root-level settings such as scheduler or nodeSelector under the matching component key. If values are already grouped by component, check the keys and values against the bundled Charts. To convert reviewed native HAMi values, wrap them under hami:

zarf tools yq '{"hami": .}' hami-current-values.yaml > <VALUES_FILE>

This command converts only HAMi values. For an AI Platform migration, place Kantaloupe Chart values under the top-level hami-ai-platform key.

In v0.1.0, hami enables its bundled RPM and resource pool CRDs by default, which requires Kubernetes 1.30 or later. On Kubernetes 1.18 through 1.29, set hami.resourcePoolManager.enabled and hami.resourcePoolCRDs.enabled to false.

If the cluster has a separate resource pool CRD release, keep CRD ownership with that release. Before deploying hami, upgrade the separate CRD Chart to 0.4.3 and set hami.resourcePoolCRDs.enabled: false.

If standalone RPM is also running, back up its policy ConfigMap and validate retiring the old manager, reusing the policy, and workload admission in a migration environment. Retire the old manager before enabling bundled RPM so that only one RPM admission webhook is registered. The bundled PACKAGE-VALUES.md explains how to reuse the policy.

Verify the following items:

  • Whether DRA is enabled.

  • Whether the hami-scheduler replica count is suitable for the cluster scale.

  • Whether scheduler leader election is enabled.

  • Whether the kube-scheduler image version matches the target Kubernetes version.

  • Whether GPU nodes use the gpu=on label.

  • Whether to keep the names of existing webhooks, RBAC, Services, and ConfigMaps.

Offline Pre-Deployment Checks​

These steps apply only to the HAMi component (--components=hami).

Before deployment, it is recommended to inspect the merged values result:

zarf package inspect values-files "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE>

Then inspect the manifests that the Zarf package will deploy:

zarf package inspect manifests "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
> hami-zarf-rendered.yaml

Key items to check:

  • Whether the target namespace is correct.

  • Whether the target release name matches the migration plan.

  • Whether resource names correspond to existing resources.

  • Whether images all come from the offline package or a registry accessible to the target environment.

  • Whether values correctly cover the configurations required by the current cluster.

Scenario 1: Existing Helm Release with the Same Name​

These steps apply only to the HAMi component (--components=hami).

Applicable conditions:

  • HAMi Enterprise is currently installed by Helm.

  • The old release name matches the HAMi release name in the Zarf package.

  • The namespace matches.

  • Going forward, deployments and upgrades will be managed uniformly through the Zarf package.

In this case, migration is usually performed as a Helm upgrade. Do not add --take-ownership or --force-conflicts by default.

Perform the migration:

zarf package deploy "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
--confirm

Post-migration checks:

zarf package list
zarf tools helm -n hami-system status hami
kubectl -n hami-system get pods
kubectl -n hami-system rollout status deploy/hami-scheduler

After the migration, switch the routine upgrade entry point to the Zarf package. Unless you are executing a clearly defined rollback plan, do not use the old Helm workflow to directly upgrade the same release again.

Scenario 2: Existing Helm Release with a Different Name​

These steps apply only to the HAMi component (--components=hami).

If the old release name differs from the release name in the Zarf package, this is a high-risk migration. Do not directly deploy a new Zarf release over the same set of resources.

It is recommended to choose one of the following approaches during a maintenance window:

ApproachApplicable situationDescription
Use a Zarf package whose release name matches the old onePrefer in-place migrationConfirm that the release name in the delivery package matches the old environment
Uninstall the old release before deploying ZarfShort downtime or rebuild is acceptableCleanest lifecycle
Use --take-ownership to take overResources must be retained and cannot be rebuiltRequires item-by-item verification of resource ownership; higher risk

If you choose to uninstall the old release and then deploy Zarf, first confirm that values, manifests, license Secrets, and necessary configurations have been backed up. Then execute during the maintenance window:

zarf tools helm -n hami-system uninstall <OLD_RELEASE>

zarf package deploy "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
--confirm

If you choose to take over existing resources, confirm at least the following:

  • The old Helm release will not be upgraded, rolled back, or uninstalled afterward.

  • The resource names rendered by Zarf correspond to the existing resources.

  • The resource namespace does not contain resources with the same or similar names belonging to other systems.

  • A full backup exists and a maintenance window is available.

Example takeover command:

zarf package deploy "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
--take-ownership \
--confirm

Only consider adding --force-conflicts when the deployment log clearly shows Server-Side Apply field conflicts and you have confirmed that those fields should be managed by Zarf/Helm:

zarf package deploy "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
--take-ownership \
--force-conflicts \
--confirm

This is not the default migration command; use it only after the takeover scope and the source of field conflicts have been confirmed.

Scenario 3: Existing Resources Managed by Kustomize or kubectl apply​

These steps apply only to the HAMi component (--components=hami).

If the existing HAMi Enterprise resources are not a Helm release but were created by Kustomize or kubectl apply, the migration focus is to bring those resources under the Zarf-managed Helm chart.

Recommended process:

  1. Export the existing YAML.

  2. Render the target manifests with Zarf.

  3. Compare resource names, namespaces, labels, annotations, and key spec fields.

  4. Use --take-ownership to take over.

  5. Use --force-conflicts only when Server-Side Apply field conflicts are encountered.

Takeover command:

zarf package deploy "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
--take-ownership \
--confirm

If the failure message clearly indicates a field ownership conflict, execute:

zarf package deploy "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
--take-ownership \
--force-conflicts \
--confirm

Prometheus and GPU Operator​

Migrating HAMi Enterprise does not mean you must also take over Prometheus or NVIDIA GPU Operator at the same time.

If Prometheus or GPU Operator already exists in the cluster, it is recommended to migrate only HAMi first:

zarf package deploy "$PACKAGE" \
--components=hami \
--values=<VALUES_FILE> \
--confirm

When Prometheus or GPU Operator also needs to be migrated, evaluate them separately based on their own releases, namespaces, values, and resource ownership.

Special notes:

  • If GPU Operator already exists in the cluster, usually do not deploy the gpu-operator component from the Zarf package again.

  • If the default NVIDIA device-plugin from GPU Operator conflicts with the HAMi device-plugin, disable the default device-plugin via GPU Operator values.

  • --force-conflicts cannot resolve runtime conflicts caused by two device-plugins running simultaneously.

Post-Migration Acceptance​

These steps apply only to the HAMi component (--components=hami).

Check the Zarf package status:

zarf package list

Check the Helm release:

zarf tools helm -n hami-system status hami
zarf tools helm -n hami-system get values hami

Check core components:

kubectl -n hami-system get pods -o wide
kubectl -n hami-system rollout status deploy/hami-scheduler
kubectl get nodes --show-labels | grep gpu=on

Check the license and the GPU scheduling chain:

bash collect-hami-license-info.sh
kubectl describe node <GPU_NODE_NAME>

Run a test workload with an image available to the target cluster. Confirm that the Pod lands on the intended node, receives the requested device, and can access it from the container.

Rollback Recommendations​

The rollback approach depends on the migration method:

Migration methodRollback approach
Same-name Helm release migrationUse the values and manifest saved before migration and follow the established Helm/Zarf rollback procedure
Uninstalled old release and redeployed with ZarfReinstall using the old release values and the original Helm chart
--take-ownership takeoverBefore rolling back, confirm resource ownership to avoid the old release's uninstall deleting resources in use
Kustomize / kubectl apply takeoverRestore using the exported YAML and change records from before migration

Any rollback should be performed in a maintenance window. Do not delete a release or namespace without confirming resource ownership.

Common Issue Handling​

SymptomPossible causeResolution
invalid ownership metadataThe resource already exists but Helm release ownership does not match or is missingDecide whether --take-ownership is needed, or clean up conflicting resources during a maintenance window
field manager conflict / SSA conflictSome fields are managed by another managerAfter confirming that the fields should be managed by Zarf/Helm, use --force-conflicts
Resources are deleted after uninstalling the old Helm releaseThe old release still considers itself the owner of those resourcesDo not let two releases manage the same resources; confirm ownership before rollback
hami-device-plugin in CrashLoopBackOffMay conflict with the NVIDIA default device-pluginDisable the built-in device-plugin of GPU Operator and check the GPU driver
Workload stays PendingLicense not activated, GPU nodes not labeled, or insufficient GPUsCheck license, gpu=on labels, and kubectl describe pod events
Scheduler startup abnormalValues, image version, or leader election configuration mismatchVerify <VALUES_FILE> and the target Kubernetes version

References​