Upgrade the Kubernetes operator¶
An upgrade is one helm upgrade, which updates the CRDs along with the
operator. A cluster whose CRDs came from an older chart's crds/ directory
needs one extra step the first time, and this page shows it.
The Kubernetes integration has its own version, separate from Pacto core: the operator image, Helm chart, Go module and these docs move together.
Upgrade with Helm¶
The currently published chart:
helm upgrade pacto-operator \
oci://ghcr.io/trianalab/pacto/charts/pacto-operator \
--version 6.6.0 \
--namespace pacto-operator-system
An upgrade reverts hand-patched controller flags
helm upgrade rebuilds the Deployment's args from the chart, so a flag
you patched in by hand disappears without an error. Set opt-in features
through chart values such as controller.probing,
controller.metricsObservation, controller.interfaceNameMatchDiscovery
and nodeAgent.enabled, which survive an upgrade. Each operator flag
has a chart value or a documented reason to stay off the chart; see
Limitations: opt-in features.
Deprecated observation keys¶
controller.enableProbing and controller.enableMetricsObservation still
work. Their replacements, controller.probing and
controller.metricsObservation, default to auto, which turns each feature on
only in namespaces labelled pacto.trianalab.io/observe.
An upgrade that keeps the previous release's values renders the same
arguments; set the new key, or reset the values, to move to auto. The
new key wins, even auto over a deprecated true:
controller.kernelEvidence.enabled: false still follows nodeAgent.enabled;
the quoted "off" refuses kernel evidence while the node agent runs.
Hand older CRDs to Helm¶
A CRD (CustomResourceDefinition) tells Kubernetes what a Pacto object looks
like. The chart renders its CRDs as part of the release, so helm upgrade
updates a changed CRD and adds a new one, and helm uninstall keeps them
(helm.sh/resource-policy: keep). Older charts installed the operator CRDs
from a crds/ directory that Helm never upgrades and never records as part
of the release.
If your CRDs came from such a chart, helm upgrade stops with invalid
ownership metadata. Label and annotate them for your release once, then run
the upgrade. Change the release name and namespace if yours differ:
for crd in $(kubectl get crd -o name | grep -E '/[a-z]+\.pacto\.trianalab\.io$'); do
kubectl label "$crd" app.kubernetes.io/managed-by=Helm --overwrite
kubectl annotate "$crd" --overwrite \
meta.helm.sh/release-name=pacto-operator \
meta.helm.sh/release-namespace=pacto-operator-system
done
The loop runs the same in bash and zsh. The grep matches only the operator CRDs. The delivery CRDs, group
delivery.pacto.trianalab.io, were already part of the release.
Image values¶
The chart builds each image from global.imageRegistry (default ghcr.io)
and a repository without a registry, such as trianalab/pacto/operator.
An image's own registry value replaces the global one for that image.
Values from older charts set the whole reference in image.repository or
delivery.image.repository, such as
ghcr.io/trianalab/pacto-operator/pacto-controller. The chart keeps such a
repository as the whole reference and adds no registry, so these values
upgrade unchanged. The chart treats a repository as already carrying a
registry host when its first path segment holds a . or : or is
localhost. The Helm reference lists every
image value.
Upgrading across a major version (CRD migration)¶
Helm applies the new CRDs ahead of the new operator, so a major upgrade is the same command as any other:
helm upgrade pacto-operator \
oci://ghcr.io/trianalab/pacto/charts/pacto-operator \
--version 6.6.0 \
--namespace pacto-operator-system
The API version stays v1alpha1 across the major bump and the stored version is
unchanged. Every existing Pacto resource therefore remains stored and readable
under the new CRD, with no conversion webhook and no decode error, and the upgraded
operator reconciles it in place. That holds because spec is additive: v5 adds
spec.target.configBindings and spec.target.interfaceBindings and removes
nothing, so a contract resource written for v4 still validates unchanged.
Status is redesigned¶
The upgrade drops v4 status observations on sight
v5 redesigns status: it removes 51 status paths and adds 35.
status.runtime, status.endpoints, status.ports, status.scaling,
status.readiness.checks, status.contract.imageRef and
status.summary.{passed,failed,total} are gone, replaced by
status.findings, status.evaluationCoverage and
status.summary.{errorCount,warningCount,infoCount,unknownCount}. That is
why the printer columns change from PASSED/FAILED to
ERRORS/WARNINGS.
The apiserver stops serving the removed fields the moment the new CRD
lands. A kubectl get pacto -o yaml taken before the new operator writes
status therefore shows a resource whose spec is intact and whose
status looks half-empty.
The CRD causes this. The old values are still in etcd and are lost for
good only once something writes status again, so that window is a normal
part of the migration.
Confirming the migration¶
Before and after the upgrade:
kubectl get crd pactos.pacto.trianalab.io \
-o jsonpath='{.spec.versions[0].additionalPrinterColumns[*].name}' # reflects the new schema
kubectl get pacto -A # existing resources still list + reconcile
If a future release ever ships an incompatible schema change, the upgrade or the resource read fails with an error, so no resource disappears silently. See the CRD reference for the current field set.
This exact flow is exercised against a real cluster by
tests/acceptance/kind/upgrade-v4-v5.sh, the upgrade leg of CI's
ci-e2e-kind job. It installs the real v4 chart with its v4 CRDs, hands them to
Helm as above, then helm upgrades to the current
chart and asserts the CRDs migrate and the pre-existing resource survives and
reconciles.
Upgrading to v6¶
v6 adds the NodeRuntimeObservation CRD, which helm upgrade creates. Hand
the older CRDs to Helm first as above, then check
these before helm upgrade:
- Removed flags and values.
--webhook-cert-path,--webhook-cert-name,--webhook-cert-keyand--dashboard-oci-secretare gone; the operator refuses to start with an unknown flag. Replacedashboard.ociSecret: <name>withdashboard.ociSecrets: [<name>]: the chart schema rejects the old key. - The node agent has its own namespace. It runs in
nodeAgent.namespace(pacto-node-agentby default), which the chart creates privileged for Pod Security. Drop thepod-security.kubernetes.io/enforce=privilegedlabel you may have put on the release namespace for it. At its first sync the operator deletes the agent it ran in the release namespace. A private pull secret for the agent image must exist in the agent namespace too. - RBAC is split by namespace. The managed components' lifecycle permissions moved from the ClusterRole to a Role in the release namespace and, with the node agent, a Role in the agent namespace. The chart renders both. An operator installed without the chart needs them added by hand (RBAC lists every rule).
- Kernel evidence namespace.
controller.kernelEvidence.namespacedefaults to the agent namespace instead of the operator's.
Delivery approvers need update rights¶
Whoever may update a Stage's workload decides its held changes. Owner
teams narrow who may answer only when delivery.identities.teamGroupPrefix is
set, and requireOwnerTeam defaults to false. To keep the earlier behaviour, set teamGroupPrefix: "" and
requireOwnerTeam: true before you upgrade
(upgrading).
Delivery always installs its admission policies¶
Delivery no longer runs without its admission policies. The chart refuses
delivery.admissionPolicies.enabled and
delivery.admissionPolicies.allowUnguarded whatever their value, and names
the replacement. Before helm upgrade:
- Delete both keys from your values.
- If you set
allowUnguardedto skip the Kubernetes 1.30 andValidatingAdmissionPolicyAPI check forhelm lintorhelm template, setdelivery.admissionPolicies.skipCapabilityCheck=trueinstead. The policies still render. - An upgrade that reuses the earlier release's values carries
enabled: trueover from the earlier chart's defaults, so it fails. Reuse them with--reset-then-reuse-values.
A promoter started without --admission-policies admits no operation and
counts no approval.
Delivery records work on every registry¶
- Stages gain
status.stream.registryMode(nativeorwrite-once-tags), which only the recorder may write.helm upgradeinstalls the new field with the CRDs. A Stage that was ready before the upgrade shows the mode after the recorder writes its next record. - A streams repository on a registry without the OCI Referrers API, such as
GHCR, now holds records as
write-once tags and reports the
RecordStoreReadyreasonWriteOnceTags. The earlier reason for such a registry is gone: alerts or scripts that match it match nothing. - A Stage that recorded
native, or that was ready before the upgrade, and then sees no Referrers API staysRegistryUnavailableinstead of switching to tags.
Approvals are signed records¶
- With the recorder on, it signs every Approval into the registry, and the promoter counts an Approval only once its record is written. Operation records then name each approval's record, which an earlier CLI or promoter cannot read. Upgrade the CLIs and every promoter that follows these streams first, then the recorder (details).
- The recorder signs no Approval made before it first saw the approval admission policy. Such an Approval on a held operation waits and does not count, so its author approves again.
- Before you set
delivery.identities.signers, create the approvals repository (delivery.recorder.approvalsRepository, default<streamsRepository>-approvals) where a registry needs it, such as ECR, and let the recorder push there. The recorder anchors it only once a signer is set. Until it can, keyless approvals wait and operation records keep flowing. - Approvals gain a status subresource and the recorder-only fields
spec.recordandspec.signedAt;helm upgradeinstalls them with the CRDs.
Signatures are checked against publishers¶
- A revision's signature
status(pacto_fleet_get, the dashboard andpacto fleet) isverifiedonly when a publisher rule, a person's pin, a signed policy or an external system's release signer accepts the signer. A signer the contract's ownpublish.signdeclares is no longer enough: scripts that relied on it readunknownorunverifieduntil the installation setsdelivery.publishers. The newsourcefield says what decided. - New chart values:
delivery.publishers.registry,defaultBranch,policy,policySignersandtrustedRoot, anddelivery.recorder.signing.publicKey. Reused values without adelivery.publishersblock render the promoter arguments they had. - Stages gain
spec.candidates.registryand the promoter-onlystatus.publisher, and Operations gain the typedelivery.pacto.trianalab.io/trustwithspec.params.publisher;helm upgradeinstalls them with the CRDs. ExistingociRepositoryRefand upstream Stages keep working unchanged (publishers).
Delivery grants Argo CD and Flux access by itself¶
delivery.argocd.enabledanddelivery.flux.enablednow default toauto.- An upgrade that takes the new chart's defaults, such as
--reset-then-reuse-values, on a cluster that serves Argo CD Applications grants the promoterpatchon Applications. Admission limits that write tospec.source.targetRevisionof Applications labelleddelivery.pacto.trianalab.io/apply-ref. Setdelivery.argocd.enabled=falseto keep it off. - Flux access renders as before. On a cluster that serves Flux HelmReleases
the promoter also gains HelmRelease read, the
--flux-helmflag and theapplier-helmreleaseadmission policy. - An upgrade that keeps the earlier chart's defaults keeps
enabled: falsefor Argo CD, and Flux access as it was. autoreads the APIs at install and upgrade: runhelm upgradeafter you install Argo CD or Flux.
The dashboard asks people to sign in¶
After every upgrade, one that reuses the earlier release's values included, the dashboard asks people to sign in (token sign-in):
- The new value
dashboard.auth.tokenSignIn.enableddefaults totrue, and no earlier release has it, so reused values keep it on. dashboard.auth.allowAnonymousdefaults tofalse. To keep serving without sign-in, setdashboard.auth.tokenSignIn.enabled=falseanddashboard.auth.allowAnonymous=true. The install notes say so when the previous release served without sign-in.- The earlier value that turned token sign-in on is deprecated and ignored. It still validates, so reused values keep working.
- A ServiceAccount token signs in only when minted with
--audience pacto-dashboard, and its session reads the fleet only. A person's own token signs in as before and may now approve. - The dashboard's ServiceAccount gains
createontokenreviewsthrough the ClusterRole<fullname>-<namespace>-dashboard-tokenreview, also withcontroller.watchNamespaces.
A dashboard you run yourself beyond loopback still needs --token-login,
--oidc-issuer-url or --allow-anonymous.
Pull secrets outside granted namespaces¶
The operator no longer reads Secrets across the cluster. It reads a pull
secret in the release namespace, in each of controller.watchNamespaces and
wherever controller.secretGrants names it. Any other pull secret sets
ContractValid=Unknown with reason PullSecretNotGranted, and the condition
message names the grant to add. Before helm upgrade, list the pull secrets
in use:
kubectl get pactos -A \
-o jsonpath='{range .items[*]}{.metadata.namespace}/{.spec.contractRef.pullSecretRef}{"\n"}{end}'
- A cluster-wide install lists each one as
namespace/nameincontroller.secretGrants. - A namespace-list install already reads pull secrets in each listed namespace. There the message points at the chart's watch Role and RoleBinding in that namespace.
A rotated pull secret is read within one check interval.
controller.watchNamespace still works and joins controller.watchNamespaces,
also when an upgrade reuses earlier values.
Moving from a cluster-wide install to a namespace list leaves the
pacto-dashboard ClusterRole and ClusterRoleBinding behind: the
operator may no longer delete them. The helm upgrade notes and a
StaleClusterRBAC Warning event on the dashboard Deployment report them.
Delete them:
Rolling back¶
Within a major, helm rollback pacto-operator reverts what the chart owns
and leaves your Pacto resources untouched; re-apply any
hand-patched controller flags afterwards. Across a
major it takes more work. A chart from before the CRDs moved into the release
does not carry them, so rolling back to it leaves the new CRDs in place. The old
controller then writes status fields the new schema lacks, which the API server
drops while still reporting success. A real return to that major means rolling
the chart back and server-side applying the previous release's CRDs from its
config/crd/bases.
Turning on the Evidence Server during an upgrade¶
The Evidence Server arrived in chart 5.2.0 and is off by default, so an upgrade
changes nothing until you set evidence.enabled. Its requirements, a subject
list and a registry serving the native Referrers API, are on
The Evidence Server. Turning it back off later removes the
whole footprint and loses nothing: every accepted record already lives in your
contract registry.
Version compatibility¶
The Kubernetes integration is versioned independently from Pacto core. The table below is generated from integration.yaml and release/release-manifest.json.
| Integration artifact | Version | Supported Pacto core |
|---|---|---|
| Operator image | 6.6.0 |
>=4.0.0 |
| Operator chart | 6.6.0 |
>=4.0.0 |
| Delivery image | 6.6.0 |
>=4.0.0 |
| Go module | 6.6.0 |
>=4.0.0 |
| Integration docs | 6.6.0 |
>=4.0.0 |
Contracts with pactoVersion: "2.1" need Pacto core 4.1.0 or later and operator 6.1.0 or later. Contracts with pactoVersion: "2.2" need Pacto core 4.3.0 or later and operator 6.3.0 or later. Contracts with pactoVersion: "2.3" need Pacto core 4.4.0 or later and operator 6.4.0 or later.
This documentation set corresponds to Pacto core 4.6.1. The integration's own version (currently operator/chart 6.6.0, docs 6.6.0) advances on its own release cadence.
Version selector¶
The site version selector (top of the page) tracks Pacto core releases. Because the Kubernetes integration ships on its own cadence, a Kubernetes-only release does NOT add a new core version entry to the selector: it republishes the current core version in place with regenerated integration docs, and this compatibility table shows the integration version those docs describe. Pick a core version from the selector to read the integration docs that shipped with it.