Skip to main content

Maintain the execution provider

Use these procedures for an existing execution provider. Preserve retained authority and workspace state during every lifecycle operation.

Rotate execution-provider authority​

Client authorization policy and TLS materials rotate independently. Publish a higher provider.securityManifest generation for changed client URI, owner, or template scope. A policy update is durable only after provider replicas agree on the new generation; a lagging replica fails closed. For provider/client certificates, the provider's executor client certificate, and CA bundles, use platform PKI and projected Secrets. Stage trust overlap, renew identities, and withdraw old trust only after the new chain is accepted. Valid TLS renewals need no policy-generation increment; expiry or trust withdrawal refuses new calls and closes file and command calls in progress within provider.policyRecheckInterval (default 10s, from 1s to 1m). A shorter interval withdraws access sooner at the cost of more Kubernetes API reads: each recheck reads every environment with calls in progress and the security authority once. Do not reuse a policy generation for different policy bytes or reset the authority ConfigMap to bypass a failed check. Verify readiness and a known authorized operation after each change without logging private keys or credential values.

Upgrade, uninstall, and reinstall the execution provider​

The supported lifecycle keeps the same Helm release name, namespace, resource names, retained template definitions, network policy configuration, and security Secret source mode. Keep both values files in your operator configuration store:

  • execution-values.yaml owns provider settings, the nonsecret client-policy manifest, network policy, and namespace resource budgets.
  • template-values.yaml owns templates, including ID quotas, defaults, retained execution recipes, and revision policy.

Pass both files to every install or upgrade. Keep operator-owned Secrets and TLS trust overlap independently; the chart neither owns nor reads Secret contents. The provider creates and deletes only its per-executor certificate Secrets.

Upgrade the provider and mecak8s together, from the same release.

Finish and verify any external authority rotation before starting a chart upgrade. Do not rotate the authority ConfigMap while Helm is writing chart resources. Each Helm lifecycle command below initializes HELM_APPLY_MODE for the current shell. Helm 4 selects client-side field ownership, while Helm 3.16 leaves the value empty. Continue to use reviewed current values and the quiescence procedure below. Do not use --force-conflicts or --take-ownership as a blanket takeover.

Before upgrading, verify that the retained templates ConfigMap contains a nonempty data["lifetime.json"], the policy authority and per-template-ID capacity ledgers are intact, and the release still owns its retained executor ServiceAccount. That account must have token automount disabled and no inherited pull Secrets. Stop if any check fails; do not synthesize missing history or reset authority. templates.<ID>.maxEnvironments and explicit namespace resourceGovernance budgets can change with reviewed values without changing recipe digests; shrinking an ID quota below current use prevents only new reservations. Capacity reservations are retained authority: preserve each ID's ledger and recover trusted state if it is missing or inconsistent. slots.json must contain an array of unique allocation names valid as Kubernetes DNS subdomains. An empty array ([]) is valid; null, non-array values, and invalid or duplicate names block reservations, releases, and Helm rendering without rewriting the ledger. Never reset or copy reservations to make an upgrade pass.

Upgrade a compatible release​

Upgrading from v0.0.52 or earlier deletes every environment

Don't use this procedure for an upgrade from v0.0.52 or earlier. Follow Upgrade from v0.0.52 or earlier instead.

For a compatible provider upgrade:

  1. Stop new client traffic and finish or explicitly fence active work, including any executor replacement or retirement in progress. Stop all provider replicas before Helm reads the ledgers:

    kubectl --namespace <NAMESPACE> scale deployment/mecatl-execution --replicas=0
    kubectl --namespace <NAMESPACE> wait --for=delete pod \
    --selector app.kubernetes.io/name=mecatl-execution --timeout=2m
  2. Apply the reviewed CRD schema before starting the upgraded provider. Helm does not upgrade existing CRDs:

    helm show crds oci://ghcr.io/stacklok/mecatl/charts/mecatl-execution \
    --version <VERSION> > execution-crds.yaml
    kubectl apply -f execution-crds.yaml
    kubectl wait --for=condition=Established \
    crd/executionenvironments.execution.mecatl.dev --timeout=60s
  3. Upgrade with the preserved lifetime configuration and current authority manifest. Helm reads the existing ConfigMaps and includes their actual ledger data, rather than empty bootstrap data, in the new release:

    HELM_APPLY_MODE=
    case "$(helm version --template '{{.Version}}')" in
    v4.*) HELM_APPLY_MODE=--server-side=false ;;
    esac
    helm upgrade mecatl-execution oci://ghcr.io/stacklok/mecatl/charts/mecatl-execution \
    --version <VERSION> \
    --namespace <NAMESPACE> --values execution-values.yaml \
    --values template-values.yaml \
    --wait --timeout=4m $HELM_APPLY_MODE
  4. Verify readiness, exact environment/PVC UIDs, data, and network confinement before resuming traffic. Every environment requires schema version 3 in spec and status. Preserve rejected objects and their data while diagnosing a mismatch; do not reset or delete them to bypass validation. Run the same provider version on all replicas.

Upgrade from v0.0.52 or earlier​

This upgrade deletes every workspace

Releases after v0.0.52 store execution environments at schema version 3 and can't use an earlier environment. Retire and delete every environment through the old provider before you upgrade. This deletes their PVCs, so copy out any workspace data you need first.

The new workload image carries a new executor, so every template revision changes, and mecak8s must come from the same release as the provider.

  1. While the old mecak8s and provider are still running, delete every session that uses an execution environment, including forks. The provider can't retire an environment that a session still references. status.references lists the ID of every session that holds each environment, with the state of its reference:

    kubectl --namespace <NAMESPACE> get executionenvironments \
    -o custom-columns='NAME:.metadata.name,SESSIONS:.status.references[*].bindingID,STATES:.status.references[*].state,OPERATIONS:.status.references[*].operationID'

    Each owner deletes their sessions permanently with POST /v1/sessions/<SESSION_ID>/delete or the gRPC DeleteSession call, which releases the session's reference. Closing a session with DELETE /v1/sessions/<SESSION_ID> keeps its reference.

    Keep mecak8s running until every remaining reference is Published. It settles pending references once a minute, and the provider can't release a pending one after mecak8s stops. A PendingDelete reference that stays means its session still exists: delete the session again. A PendingCreate reference whose session doesn't exist stays until you abort it in step 3.

  2. Stop mecak8s:

    kubectl --namespace <MECAK8S_NAMESPACE> scale deployment/<MECAK8S_DEPLOYMENT> --replicas=0
  3. For each environment, capture its identity, then run RetireEnvironment and DeleteRetiredEnvironment against the old provider as in Replace or retire an executor, using contracts/proto from the old release's tag. If a run claim left by the stopped mecak8s blocks retirement, retry the same request with the same operation ID after it expires. Retirement also fails with conflict while status.references is nonempty.

    When a remaining reference doesn't belong to a session you can delete, remove it with the mecak8s client identity: the provider accepts these calls only from the client that created the environment, with mayAttestOwner: true in its policy. The administration Pod can't present that identity, and mecak8s is stopped. Run the calls from a temporary Pod in <MECAK8S_NAMESPACE> with the Pod labels that your mecak8s entry in provider.clientIngressSelectors matches, with the Secret named by execution.tlsSecret in the mecak8s values mounted read-only. Delete the Pod when you finish. Keep the administration identity in CERT_FILE and KEY_FILE for the retirement calls, and point separate variables at the mecak8s certificate:

    MECAK8S_CERT_FILE=<MECAK8S_TLS_MOUNT>/tls.crt
    MECAK8S_KEY_FILE=<MECAK8S_TLS_MOUNT>/tls.key

    Release a Published reference with ReleaseReference:

    grpcurl -cacert "$CA_FILE" -cert "$MECAK8S_CERT_FILE" -key "$MECAK8S_KEY_FILE" \
    -import-path contracts/proto -proto "$PROTO" \
    -d '{"context":{"environment":{"id":"<ENVIRONMENT_ID>","revision":"<REVISION>"},"owner":{"issuer":"<OWNER_ISSUER>","subject":"<OWNER_SUBJECT>"},"bindingId":"<BINDING_ID>"}}' \
    "$EXECUTION_ENDPOINT" mecatl.execution.v1.ExecutionProviderService/ReleaseReference

    Abort a PendingCreate reference with AbortReference, passing the reference's operationID from step 1. ReleaseReference returns conflict for a pending reference.

    grpcurl -cacert "$CA_FILE" -cert "$MECAK8S_CERT_FILE" -key "$MECAK8S_KEY_FILE" \
    -import-path contracts/proto -proto "$PROTO" \
    -d '{"environment":{"id":"<ENVIRONMENT_ID>","revision":"<REVISION>"},"owner":{"issuer":"<OWNER_ISSUER>","subject":"<OWNER_SUBJECT>"},"bindingId":"<BINDING_ID>","operationId":"<OPERATION_ID>"}' \
    "$EXECUTION_ENDPOINT" mecatl.execution.v1.ExecutionProviderService/AbortReference

    Both calls succeed without changing anything when no reference matches <BINDING_ID>, so rerun the step 1 query and confirm the reference is gone before retrying retirement.

    Continue when the namespace has no ExecutionEnvironment left:

    kubectl --namespace <NAMESPACE> get executionenvironments
  4. Rebuild each derivative workload image from the new release's mecatl-execution-workload image, as in Build a downstream workload image. Regenerate each recipe with the new image digest using the new release's deploy/execution-templates. Replace template-values.yaml with the generated file rather than merging it: no environment uses an old revision, and the generated file sets each template ID's default to its new revision.

  5. Stop the provider and apply the new CRD as in steps 1 and 2 of Upgrade a compatible release. The old revisions leave retained history in this upgrade, which the chart allows only with explicit consent for every removed revision of every template ID. Build that consent from the retained history, then upgrade:

    kubectl --namespace <NAMESPACE> get configmap mecatl-execution-templates \
    -o jsonpath='{.data.lifetime\.json}' |
    jq '{maintenance: {pruneRevisions: (.definitions | map_values(keys))}}' \
    > prune-values.yaml
    HELM_APPLY_MODE=
    case "$(helm version --template '{{.Version}}')" in
    v4.*) HELM_APPLY_MODE=--server-side=false ;;
    esac
    helm upgrade mecatl-execution oci://ghcr.io/stacklok/mecatl/charts/mecatl-execution \
    --version <VERSION> \
    --namespace <NAMESPACE> --values execution-values.yaml \
    --values template-values.yaml --values prune-values.yaml \
    --wait --timeout=4m $HELM_APPLY_MODE

    Steps 1 to 3 of this procedure already did the pruning procedure's retirement step. Its inspection step is optional here: the chart repeats those checks and fails if the provider Deployment hasn't observed zero replicas, a capacity ledger still lists a reservation, or an execution Pod or PVC remains. Omit prune-values.yaml from later upgrades.

  6. Set execution.templateRevision in the mecak8s values to the regenerated key, then upgrade mecak8s to the same release. Helm restores the replica count from replicaCount in your values. kubectl scale in step 2 took ownership of the replica count, so keep client-side field ownership for Helm 4:

    HELM_APPLY_MODE=
    case "$(helm version --template '{{.Version}}')" in
    v4.*) HELM_APPLY_MODE=--server-side=false ;;
    esac
    helm upgrade <MECAK8S_RELEASE> oci://ghcr.io/stacklok/mecatl/charts/mecak8s \
    --version <VERSION> --namespace <MECAK8S_NAMESPACE> \
    --values <MECAK8S_VALUES_FILE> $HELM_APPLY_MODE

    Check that the provider is ready and mecak8s starts, then run the deployed-image smoke test.

Prune an unused retained revision​

The selectable catalog holds at most 64 ID/revision entries; retained-only historical definitions do not consume those slots. The combined ConfigMap data limit, rather than an arbitrary history count, bounds retained definitions. To publish beyond that physical limit, remove an unused historical definition in the same upgrade that adds the next revision. Keep every definition still used by an environment. The chart requires explicit maintenance.pruneRevisions consent for each removed ID/revision pair; ordinary upgrades reject any removal. The combined rendered templates.yaml and lifetime.json must also fit within Kubernetes's 1 MiB ConfigMap data limit. This procedure requires storage deletion for allocations of the revision being pruned. If that data must remain, keep the definition instead.

  1. While the provider is running, finish RetireEnvironment and DeleteRetiredEnvironment for every allocation of the specific revision being removed. Keep unrelated workspaces, including surviving revisions of the same ID. Stop client traffic and scale the provider to zero as in the upgrade procedure; keep it stopped through Helm apply. Lookup and apply do not form a transaction.

  2. Verify that the existing Deployment has observed its zero-replica generation. For each affected template ID, inspect the retained per-ID mecatl-exec-alloc-<first 32 hex of SHA-256 of ID> ConfigMap. Its slots.json must be a canonical JSON array; each entry must resolve to an environment with a surviving revision. An unresolved pending reservation, missing ledger, orphan executor/PVC without an identifiable allocation, or reference to the removed revision blocks pruning. A Pod or PVC with execution labels or an ExecutionEnvironment owner reference must have a nonempty execution.mecatl.dev/environment label and verifiable allocation identity. Ordinary resources without execution evidence and verified allocations of other IDs do not block pruning. Inspect the live resources before continuing:

    kubectl --namespace <NAMESPACE> get deployment mecatl-execution \
    -o jsonpath='{.metadata.generation}{" "}{.status.observedGeneration}{" "}{.spec.replicas}{" "}{.status.replicas}{"\n"}'
    kubectl --namespace <NAMESPACE> get executionenvironments,pods,pvc
    kubectl --namespace <NAMESPACE> get configmap <AFFECTED_ID_LEDGER_NAME> \
    -o jsonpath='{.data.slots\.json}{"\n"}'

    If an affected check fails, finish supported lifecycle operations or recover trusted state; do not reset or delete retained resources.

  3. Back up the existing data["lifetime.json"] and reviewed Helm values in your operator configuration store. Remove only the selected retired revision from templates.<ID>.revisions in template-values.yaml, add the next revision, and select an eligible default. Preserve the remaining recipes and network policy configuration. Validate the complete candidate template file before applying it:

    go run ./deploy/execution-templates -validate template-values.yaml

    For the single upgrade that removes it, pass the exact removed revision as consent:

    helm upgrade mecatl-execution oci://ghcr.io/stacklok/mecatl/charts/mecatl-execution \
    --version <VERSION> --namespace <NAMESPACE> --values execution-values.yaml \
    --values template-values.yaml \
    --set-json 'maintenance.pruneRevisions.<ID>=["<RETIRED_TEMPLATE_REVISION>"]' \
    --wait --timeout=4m $HELM_APPLY_MODE

    Set HELM_APPLY_MODE as in the compatible-upgrade procedure. Omit the prune setting on subsequent upgrades; it is valid only when the named definition exists in retained history and is absent from the candidate values. Verify the new lifetime.json and provider readiness before resuming traffic. If the upgrade fails, keep writers stopped and restore the trusted values/history or resolve the reported state mismatch before retrying. Do not use a rollback that would reintroduce a pruned definition in place of a subsequently published revision.

Uninstall and reinstall with retained state​

Default uninstall removes the provider but keeps runtime CRs, PVCs, surviving executors, workload default-deny and profile NetworkPolicies, security authority and per-template-ID capacity ledgers, and the template/security-manifest ConfigMaps. Uninstall is not executor termination proof or storage disposal:

helm uninstall mecatl-execution --namespace <NAMESPACE>

Reinstall with the same identity and preserved values:

HELM_APPLY_MODE=
case "$(helm version --template '{{.Version}}')" in
v4.*) HELM_APPLY_MODE=--server-side=false ;;
esac
helm install mecatl-execution oci://ghcr.io/stacklok/mecatl/charts/mecatl-execution \
--version <VERSION> \
--namespace <NAMESPACE> --values execution-values.yaml \
--values template-values.yaml \
--wait --timeout=4m $HELM_APPLY_MODE

Helm adopts retained resources only when their managed-by label and release-name and release-namespace annotations match. The chart rejects missing or empty ledgers while allocations or capacity reservations survive, and rejects unconsented changes to retained execution definitions. Use the pruning procedure for a retired definition. Template removal or egress edits require careful retention and quiescence: retained allow policies are additive, so leaving an obsolete policy could widen access. The provider rejects an older policy manifest against the retained high-water generation; never reset that ledger to make readiness pass.

Use live Helm install/upgrade for this lifecycle. Offline helm template cannot perform ownership or history lookups and is not an adoption mechanism. Keep provider writers stopped for upgrades; lookup plus apply is not a cross-resource transaction. Rendering rejects a nonzero existing provider Deployment or any remaining provider Pod, including a terminating Pod. Changed release/namespace adoption, chart rollback, --force-conflicts, --take-ownership, CRD or namespace deletion with retained resources, and force-finalizer cleanup are unsupported.

Preserve state when decommissioning​

Final infrastructure decommission is not automated by this provider. Supported RetireEnvironment and DeleteRetiredEnvironment operations can terminate and dispose of eligible individual environments; they do not remove the retained NetworkPolicies, configuration, ledgers, or CRD. There is no supported final infrastructure-cleanup procedure here. Manual destructive cleanup is outside the supported lifecycle. Keep retention defaults and authority history, and never reset ledgers or remove finalizers to bypass a failed safety check.

Run an administrative lifecycle operation​

Administrative RPCs require administrator: true. For a distinct operations identity, set its administratorFor list to the canonical URI of each client that created the environments it may administer, as in the setup values. An absent or empty list permits only self-administration. Keep mayAttestOwner: false for an operations-only identity; administrative scope confers no filesystem, Shell, attach, run, or reference access. See the scope constraints.

Publish administrator scope changes in a reviewed manifest with a higher generation, preserve the authority high-water ConfigMap, and verify provider readiness. All provider replicas must use the same version.

Run the RPC examples from an operator-managed administration Pod inside the cluster, not from an executor Pod. In execution-values.yaml, include an ingress selector for its namespace and Pod labels alongside the mecak8s selector:

provider:
clientIngressSelectors:
- namespaceLabels: { kubernetes.io/metadata.name: <CLIENT_NAMESPACE> }
podLabels: { app.kubernetes.io/name: mecak8s }
- namespaceLabels: { kubernetes.io/metadata.name: <ADMIN_NAMESPACE> }
podLabels: { app.kubernetes.io/name: execution-admin }

Provision the administration Pod with that label, grpcurl, version-matched protocol source, and a read-only mount of its client mTLS Secret. Its namespace must permit DNS resolution and egress to the provider Service on TCP 8443 (or your configured service.port). Apply these selectors through the quiesced upgrade procedure with both values files. A certificate alone does not grant network access, and a network selector alone does not authorize an RPC. Keep execution workloads default-deny; do not give them administration credentials.

The kubectl inventory commands can run from a separate authorized operator workstation with access to the execution namespace. The in-cluster RPC examples use Service DNS and need no Kubernetes API token.

Every administrative request still requires the original exact owner and revision plus the operation's epoch, UID, or generation preconditions. The scope names creators, not owners; it can include a creator whose login has been removed. After maintenance, remove its scope entry and increase generation again. Subsequent requests, including receipt retries on established connections, are denied; already admitted lifecycle operations may finish safe reconciliation.

An administrative not_found response deliberately does not distinguish a missing environment from a wrong owner, revision, or creator scope. Check the exact environment ID/revision and original owner against your authorized operations record, then check that administratorFor names the original creator's exact canonical client URI. If the scope is wrong, publish a reviewed manifest at a higher generation and verify readiness before retrying. The RPC will not disclose another creator's data to diagnose a scope mismatch.

Capture the exact environment identity​

First capture the private identity while the environment exists. Its spec keeps the owner fields after the last reference is released:

kubectl --namespace <NAMESPACE> get executionenvironment <ENVIRONMENT_ID> \
-o jsonpath='{.spec.revision}{"\n"}{.spec.ownerIssuer}{"\n"}{.spec.ownerSubject}{"\n"}{.status.epoch}{"\n"}{.status.pod.uid}{"\n"}{.status.pvc.uid}{"\n"}{.status.grantGeneration}{"\n"}'

Record those seven lines as <REVISION>, <OWNER_ISSUER>, <OWNER_SUBJECT>, <EPOCH>, <POD_UID>, <PVC_UID>, and <GRANT_GENERATION>. The owner hash is not reversible, so retain the bounded spec.ownerIssuer and spec.ownerSubject attestation in your authorized operations record before deleting the environment.

Obtain contracts/proto from the Mecatl source at the same release tag as the provider. Run the RPC examples from that checkout root with grpcurl installed.

Set file references to trusted, mounted mTLS material. Keep private-key bytes out of shell arguments and manifests:

EXECUTION_ENDPOINT=mecatl-execution.<NAMESPACE>.svc:8443
CA_FILE=/var/run/secrets/mecatl-admin/ca.crt
CERT_FILE=/var/run/secrets/mecatl-admin/tls.crt
KEY_FILE=/var/run/secrets/mecatl-admin/tls.key
PROTO=contracts/proto/mecatl/execution/v1/execution.proto

Replace or retire an executor​

Replace one executor by reusing the same operation ID for every retry:

grpcurl -cacert "$CA_FILE" -cert "$CERT_FILE" -key "$KEY_FILE" \
-import-path contracts/proto -proto "$PROTO" \
-d '{"environment":{"id":"<ENVIRONMENT_ID>","revision":"<REVISION>"},"owner":{"issuer":"<OWNER_ISSUER>","subject":"<OWNER_SUBJECT>"},"expectedExecutionEpoch":"<EPOCH>","expectedPodUid":"<POD_UID>","expectedPvcUid":"<PVC_UID>","operationId":"replace-<STABLE_UUID>"}' \
"$EXECUTION_ENDPOINT" mecatl.execution.v1.ExecutionProviderService/ReplaceExecutor

To retire and then delete retained storage, call RetireEnvironment with the same identity fields and a new stable operation ID. Poll until .status.conditions[?(@.type=="Retired")].status is True, then call DeleteRetiredEnvironment with the retained PVC UID and another stable operation ID. The provider refuses either request while references, claims, identity proof, or UID checks are incomplete.

grpcurl -cacert "$CA_FILE" -cert "$CERT_FILE" -key "$KEY_FILE" \
-import-path contracts/proto -proto "$PROTO" \
-d '{"environment":{"id":"<ENVIRONMENT_ID>","revision":"<REVISION>"},"owner":{"issuer":"<OWNER_ISSUER>","subject":"<OWNER_SUBJECT>"},"expectedExecutionEpoch":"<EPOCH>","expectedPodUid":"<POD_UID>","expectedPvcUid":"<PVC_UID>","operationId":"retire-<STABLE_UUID>"}' \
"$EXECUTION_ENDPOINT" mecatl.execution.v1.ExecutionProviderService/RetireEnvironment
kubectl --namespace <NAMESPACE> wait executionenvironment/<ENVIRONMENT_ID> \
--for='jsonpath={.status.conditions[?(@.type=="Retired")].status}=True' \
--timeout=10m
grpcurl -cacert "$CA_FILE" -cert "$CERT_FILE" -key "$KEY_FILE" \
-import-path contracts/proto -proto "$PROTO" \
-d '{"environment":{"id":"<ENVIRONMENT_ID>","revision":"<REVISION>"},"owner":{"issuer":"<OWNER_ISSUER>","subject":"<OWNER_SUBJECT>"},"expectedPvcUid":"<PVC_UID>","operationId":"delete-<STABLE_UUID>"}' \
"$EXECUTION_ENDPOINT" mecatl.execution.v1.ExecutionProviderService/DeleteRetiredEnvironment

Revoke an environment​

Revoke an environment using its durable grantGeneration fence (the wire name), not a signed grant. Supply the current generation and a stable operation ID. The response returns the new generation; retrying the identical request returns the same receipt. After this CAS succeeds, the provider refuses new calls under the earlier generation and closes the environment's file and command calls in progress: at once on the replica that served the request, and within provider.policyRecheckInterval on the others.

grpcurl -cacert "$CA_FILE" -cert "$CERT_FILE" -key "$KEY_FILE" \
-import-path contracts/proto -proto "$PROTO" \
-d '{"environment":{"id":"<ENVIRONMENT_ID>","revision":"<REVISION>"},"owner":{"issuer":"<OWNER_ISSUER>","subject":"<OWNER_SUBJECT>"},"expectedGrantGeneration":"<GRANT_GENERATION>","operationId":"revoke-<STABLE_UUID>"}' \
"$EXECUTION_ENDPOINT" mecatl.execution.v1.ExecutionProviderService/RevokeEnvironment

Foreground command cancellation is cooperative and bounded. The executor kills the command's process group and reports the result. If it cannot confirm that every process the command started has ended, or the provider's stream to the executor breaks after the command started and before its result, the provider fences the environment. Recover it once the executor Pod is terminal. There is no detached command status or cancellation API for this deployment.

Recover a fenced environment​

Use the mTLS file references and version-matched protocol source configured above.

The built-in recovery RPC requires the same exact identity and an independently stable operation ID. It does not read a Secret and has no force or acknowledgement field:

grpcurl -cacert "$CA_FILE" -cert "$CERT_FILE" -key "$KEY_FILE" \
-import-path contracts/proto -proto "$PROTO" \
-d '{"environment":{"id":"<ENVIRONMENT_ID>","revision":"<REVISION>"},"owner":{"issuer":"<OWNER_ISSUER>","subject":"<OWNER_SUBJECT>"},"expectedExecutionEpoch":"<EPOCH>","expectedPodUid":"<POD_UID>","expectedPvcUid":"<PVC_UID>","operationId":"recover-<STABLE_UUID>"}' \
"$EXECUTION_ENDPOINT" mecatl.execution.v1.ExecutionProviderService/RecoverEnvironment

An environment fenced because its PVC is Lost stays healthy after recovery while the recovered executor is the current one, so you can then retire it and delete its storage. Replacing its executor fences it again.

Next steps​