Skip to main content
logoTetrate Service BridgeVersion: 1.12.x

Managing Gateways during Upgrades

When you upgrade your TSB ControlPlane, the new operator may regenerate gateway manifests with updated values — a new proxy image, new environment variables, a new injection template. Applying those changes restarts the gateway pods, and during a large upgrade many gateways restarting at once can mean unplanned downtime.

Platform Operators have three controls to manage this:

ControlWhat it does
gatewayReconciliation in the ControlPlane CRPauses reconciliation for an entire revision, or for specific namespaces.
xcp.tetrate.io/gateway-reconcile label on a gateway install CRPauses (or explicitly enables) reconciliation for a single gateway. Highest precedence.
/debug/gateway-reconcile-diff endpoint on xcp-operator-edgeDry-run preview of exactly what would change for each gateway if it were reconciled.

Together they let you pause gateways before an upgrade, preview what the upgrade would change, and release each batch of gateways into a maintenance window of your choosing.

What "reconciliation" means here

A gateway is reconciled when the operator (re)applies its generated manifests. A reconcile only restarts the gateway's pods when the new manifests change the pod template — for example, a different proxy image or new environment variables.

Follow these steps for every cluster where you want to control when gateways restart.

  1. Pause gateway reconciliation before the upgrade​

    You have two ways to pause reconciliation. Use whichever fits the scope you need:

    • The gatewayReconciliation setting in the ControlPlane CR is the bulk control. Pause an entire revision in one edit, and selectively allow specific namespaces through (for example, a staging namespace where you want to validate the upgrade first).
    • The xcp.tetrate.io/gateway-reconcile label on a single gateway is the surgical override. It always wins over the API setting — handy for protecting one business-critical gateway, or for un-pausing one gateway out of a namespace that is otherwise paused.

    The example below pauses every gateway under the default revision except those in envoy-staging and envoy-test:

    kubectl edit -n istio-system controlplane controlplane
    apiVersion: install.tetrate.io/v1alpha1
    kind: ControlPlane
    metadata:
    name: controlplane
    namespace: istio-system
    spec:
    xcp:
    isolationBoundaries:
    - name: global
    revisions:
    - name: default
    istio:
    tsbVersion: 1.12.16
    # Pause all gateways in this revision during the upgrade
    gatewayReconciliation:
    enabled: false
    namespaceOverrides:
    # Allow staging/test namespaces to reconcile for canary verification
    - namespace: envoy-staging
    enabled: true
    - namespace: envoy-test
    enabled: true

    To pause an individual gateway, label its install CR:

    Pause one gateway by name
    kubectl label gateways.install.tetrate.io -n bookinfo bookinfo-gw \
    xcp.tetrate.io/gateway-reconcile=false --overwrite

    Confirm the gateways are paused:

    List gateway phases
    kubectl get gatewaydeployments -A \
    -o custom-columns='NAMESPACE:.metadata.namespace,NAME:.metadata.name,PHASE:.status.phase'

    # Expected output: gateways covered by your pause settings show RECONCILIATION_PAUSED.
    # NAMESPACE NAME PHASE
    # bookinfo bookinfo-gw RECONCILIATION_PAUSED
    # istio-system tier1-gw RECONCILIATION_PAUSED
    # envoy-staging staging-gw READY
  2. Upgrade the ControlPlane​

    Follow your normal TSB upgrade procedure. Gateways that are paused will continue running on their current configuration and will not be modified.

  3. Preview what the upgrade would change​

    Before releasing any gateway, query the dry-run diff endpoint to see exactly what reconciliation would do. The endpoint is read-only — it never modifies cluster state.

    Port-forward to the edge operator:

    Port-forward to xcp-operator-edge
    kubectl port-forward -n istio-system deployment/xcp-operator-edge 8090:8090

    Then query the diff endpoint:

    http://localhost:8090/debug/gateway-reconcile-diff

    To narrow the diff to a single gateway, pass namespace (and optionally name, which requires namespace):

    http://localhost:8090/debug/gateway-reconcile-diff?namespace=bookinfo&name=bookinfo-gw

    These filters match the rendered Kubernetes Deployment's name and namespace, not the gateway install CR's own metadata.name/metadata.namespace — the two can differ (the install CR usually lives in the operator namespace, while its Deployment is created in the configured target namespace). Each diff entry reports both identities, as name/namespace (the install CR) and deploymentName/deploymentNamespace (the Deployment):

    {
    "gateways": [
    {
    "name": "bookinfo-gw",
    "namespace": "bookinfo",
    "deploymentName": "bookinfo-gw",
    "deploymentNamespace": "bookinfo",
    "kind": "GatewayDeployment",
    "revision": "default",
    "reconcileEnabled": false,
    "reconcileDisabledReason": "RevisionApiDisabled",
    "diff": {
    "deployment": {
    "hasChanges": true,
    "summary": "pod template changed (will cause restart): ...",
    "willCauseRestart": true
    },
    "service": { "hasChanges": false },
    "serviceAccount": { "hasChanges": false },
    "hpa": { "hasChanges": false }
    }
    }
    ],
    "summary": {
    "total": 47,
    "withChanges": 3,
    "willCauseRestart": 2,
    "paused": 45,
    "enabled": 2
    }
    }
    Filtering by name when in-place gateway upgrade is disabled

    When in-place gateway upgrade is disabled, the Deployment name carries the revision suffix (for example my-gateway-stable rather than my-gateway). Use the exact deploymentName value — visible in an unfiltered response — when filtering by name.

    Use jq to quickly list the gateways that would restart:

    List gateways whose pods would restart on reconcile
    curl -s "http://localhost:8090/debug/gateway-reconcile-diff" \
    | jq -r '.gateways[]
    | select([.diff // {} | .[]? | select(. != null) | .willCauseRestart == true] | any)
    | "\(.namespace)/\(.name)"'

    # bookinfo/bookinfo-gw
    # istio-system/tier1-gw

    Or get a per-resource summary of the changes:

    Per-resource change summary
    curl -s "http://localhost:8090/debug/gateway-reconcile-diff" \
    | jq -r '.gateways[] | . as $g | (.diff // {}) | to_entries[]
    | select(.value != null and .value.hasChanges == true)
    | "\($g.namespace)/\($g.name)\t\(.key)\t\(.value.summary // "")"'
    Slow on large clusters?

    On clusters with many gateways the cluster-wide diff can take time. Increase the worker concurrency:

    http://localhost:8090/debug/gateway-reconcile-diff?concurrency=5

    The endpoint is for debugging only — for very large responses, consider raising the memory limit on the xcp-operator-edge pod before requesting a cluster-wide diff.

  4. Release gateways during your maintenance window​

    When you are ready to allow gateways to update, release them in batches so you can validate each batch before moving on.

    Release a namespace by adding (or updating) an override in the ControlPlane CR:

    gatewayReconciliation:
    enabled: false
    namespaceOverrides:
    - namespace: envoy-staging
    enabled: true
    - namespace: envoy-prod-us-east # newly released batch
    enabled: true

    Release a single gateway that you paused via the label by removing it:

    kubectl label gateways.install.tetrate.io -n bookinfo bookinfo-gw \
    xcp.tetrate.io/gateway-reconcile-

    Release everything by re-enabling reconciliation globally:

    gatewayReconciliation:
    enabled: true
    # namespaceOverrides no longer needed; can be removed

    Watch the gateway phases transition back to READY as each batch is released:

    kubectl get gatewaydeployments -A \
    -o custom-columns='NAMESPACE:.metadata.namespace,NAME:.metadata.name,PHASE:.status.phase'

    If any released gateway reports RECONCILIATION_DIRTY instead of READY, see Troubleshooting: a gateway is stuck in RECONCILIATION_DIRTY.

  5. Confirm gateways are healthy and on the new proxy version​

    After release, check the rollout completed and all pods are running. In the kubectl get deployments output, the READY column should show n/n (every replica ready); in kubectl get pods, every pod should be Running and 1/1.

    kubectl get deployments -n bookinfo
    kubectl get pods -n bookinfo

    Then confirm the istio-proxy container is running the image that ships with the new ControlPlane. Each gateway's deployment carries an app: tsb-gateway-... label whose exact value depends on the gateway and namespace — discover it with kubectl get deploy -n <namespace> --show-labels, then use it to select the pods:

    Show the running proxy image for a gateway
    kubectl get pods -n bookinfo -l app=tsb-gateway-bookinfo \
    -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[?(@.name=="istio-proxy")].image}{"\n"}{end}'

    # bookinfo-gw-7c8b9d5f4-abc12 docker.io/istio/proxyv2:1.24.4
    # bookinfo-gw-7c8b9d5f4-def34 docker.io/istio/proxyv2:1.24.4
    Gateways with no pod-template change won't restart on their own

    If a TSB upgrade does not change a gateway's pod template — for example, the proxy image tag is unchanged — the gateway will be marked reconciled but its pods will keep running the previous image until you restart them yourself.

    To pick up a new image on those gateways, do a rolling restart of the underlying Kubernetes Deployment during your maintenance window:

    Force-restart a gateway's pods
    kubectl rollout restart deployment <gateway-deployment-name> -n <namespace>

Troubleshooting: a gateway is stuck in RECONCILIATION_DIRTY​

A released gateway normally moves from RECONCILIATION_PAUSED back to READY once the operator reconciles it. RECONCILIATION_DIRTY means the operator detected pending changes for the gateway but the regular reconcile loop has not applied them — the gateway keeps running on its existing configuration in the meantime.

From TSB 1.12.16, the gateway's install.tetrate.io Gateway resource also reports this state as a Stalled condition with reason GatewayReconciliationDirty. See Gateway status for GitOps tools.

Inspect the DirtyStateDetected condition to see which resources differ:

kubectl describe gatewaydeployment <name> -n <namespace>

To apply the pending changes, force-reconcile the gateway by setting the install.tetrate.io/reconcile-before label to a near-future timestamp. The value is a compact ISO 8601 UTC timestamp in the format YYYYMMDDThhmmssZ — for example, 20260601T120000Z means 1 June 2026, 12:00 UTC.

Force a reconcile within the next hour
kubectl label gateways.install.tetrate.io <name> -n <namespace> \
install.tetrate.io/reconcile-before=20260601T120000Z --overwrite

While the current time is before the timestamp, the operator performs a full reconcile and restarts the pods if the pod template changed. Once the timestamp passes, the label has no further effect — it is safe to leave in place, including in GitOps-managed manifests, and does not affect future upgrades.

Confirm the gateway is back to READY:

kubectl get gatewaydeployment <name> -n <namespace> -o jsonpath='{.status.phase}'

Gateway status for GitOps tools​

From TSB 1.12.16, the TSB Operator copies each gateway's reconciliation status from its GatewayDeployment in istio-system onto the gateway's install.tetrate.io Gateway resource. Application teams that deploy gateways with Flux or Argo CD can then see when a gateway is held back, has drifted, or failed, without needing access to the GatewayDeployment.

The status has two parts:

  • status.observedGeneration is the generation of the Gateway that XCP has processed. After you change the Gateway, this value stays at the previous generation until XCP has processed the change.
  • status.conditions reports the gateway's reconciliation state using the Stalled, Reconciling and ReconciliationPaused conditions.

For example, after a TSB upgrade, a gateway that is still running the previous proxy image reports:

kubectl get gateways.install.tetrate.io <name> -n <namespace> -o yaml
status:
observedGeneration: 6
conditions:
- type: Stalled
status: "True"
reason: GatewayReconciliationDirty
message: "The gateway runs a configuration that differs from the one this TSB version generates (Dirty resources: Deployment/bookinfo-gw). It is applied with the next change to this Gateway, or by setting the install.tetrate.io/reconcile-before label to a future time in the format 20060102T150405Z; applying it may restart the gateway pods"

To list a gateway's conditions:

kubectl get gateways.install.tetrate.io <name> -n <namespace> \
-o jsonpath='{range .status.conditions[*]}{.type}{"\t"}{.status}{"\t"}{.reason}{"\n"}{end}'

How the status maps to Flux and Argo CD​

Gateway stateCondition (reason)observedGenerationFluxArgo CD (with the health check below)
The GatewayDeployment has not yet been generated from the latest changeReconciling (GatewayDeploymentPending)UnchangedIn progressProgressing
XCP has not yet processed the latest changeReconciling (GatewayReconciling)UnchangedIn progressProgressing
RECONCILIATION_PAUSEDReconciliationPaused (GatewayReconciliationPaused)Updated once XCP has processed the changeHealthy, or in progress if a change is waitingSuspended
TRANSLATION_FAILEDStalled (GatewayTranslationFailed)UpdatedFailedDegraded
RECONCILIATION_DIRTYStalled (GatewayReconciliationDirty)UpdatedFailedDegraded
PENDINGReconciling (GatewayWorkloadNotReady)UpdatedIn progressProgressing
WAITING_FOR_LOAD_BALANCERReconciling (GatewayWaitingForLoadBalancer)UpdatedIn progressProgressing
READYNoneUpdatedHealthyHealthy

If TSB GitOps has recorded its own Stalled condition on the Gateway (reason TSBApplyNonRetriableError), that condition takes precedence, and the operator doesn't add a Stalled or Reconciling condition.

Flux​

Flux reads this status with its default health checks, so a Kustomization with wait: true, or with the Gateway listed in healthChecks, reports a Stalled gateway as unhealthy. When you push a change to fix a stalled gateway, observedGeneration is behind the new generation until XCP has processed it. Flux treats the gateway as in progress during that time and ignores the old Stalled condition, so the fix isn't reported as failed.

Argo CD​

Argo CD needs a custom health check for install.tetrate.io Gateway resources. Add it to the argocd-cm ConfigMap:

argocd-cm
data:
resource.customizations.health.install.tetrate.io_Gateway: |
local hs = { status = "Healthy", message = "Gateway is reconciled" }
if obj.status == nil then return hs end
local conditions = obj.status.conditions or {}
for _, c in ipairs(conditions) do
if c.type == "ReconciliationPaused" and c.status == "True" then
return { status = "Suspended", message = c.message }
end
end
local observed = tonumber(obj.status.observedGeneration)
local generation = tonumber(obj.metadata.generation)
if observed ~= nil and generation ~= nil and observed < generation then
return { status = "Progressing", message = "Waiting for the gateway to process the latest change" }
end
for _, c in ipairs(conditions) do
if c.type == "Stalled" and c.status == "True" then
return { status = "Degraded", message = c.message }
end
end
for _, c in ipairs(conditions) do
if (c.type == "Reconciling" and c.status == "True") or (c.type == "Ready" and c.status == "False") then
return { status = "Progressing", message = c.message }
end
end
return hs

After a TSB upgrade​

If a TSB upgrade changes a gateway's generated configuration, for example with a new proxy image, the gateway reports Stalled with reason GatewayReconciliationDirty until it is reconciled. Flux Kustomizations and Argo CD applications that include the gateway report it as unhealthy or degraded until then. This is expected: it shows that the gateway hasn't yet picked up the upgrade. Release the gateway during your maintenance window, as described in Troubleshooting: a gateway is stuck in RECONCILIATION_DIRTY.

Turning off the gateway status​

The status is on by default. To turn it off, set the ENABLE_GATEWAY_INSTALL_STATUS environment variable to false on the TSB control plane operator. For example, in the control plane Helm values:

operator:
deployment:
env:
- name: ENABLE_GATEWAY_INSTALL_STATUS
value: "false"

When you turn the status off, or roll back to an earlier TSB version, the last status stays on each Gateway. Because observedGeneration is no longer updated, Flux waits on the next change to the gateway until it times out. After turning off the status or rolling back, remove the stale status from every Gateway:

for gw in $(kubectl get gateways.install.tetrate.io -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\n"}{end}'); do
kubectl get gateways.install.tetrate.io -n "${gw%/*}" "${gw#*/}" -o json \
| jq 'del(.status.observedGeneration) | .status.conditions = ((.status.conditions // []) | map(select((.reason // "") | startswith("Gateway") | not)))' \
| kubectl replace --subresource=status -f -
done

Limitations​

  • A newly created Gateway has no status for a short time, which Flux and Argo CD treat as healthy. The first health check can therefore pass before the gateway is deployed. Later changes report Reconciling correctly.
TSB GitOps and resource conditions

From TSB 1.12.16, when TSB GitOps records its own condition on a resource, it keeps conditions written by other controllers, such as the gateway status conditions, instead of replacing them.

Reference​

Gateway phases​

GatewayDeployment.status.phase reports the overall state of a gateway:

PhaseMeaning
READYThe gateway is reconciled and the workload is healthy.
PENDINGThe gateway is being created or its workload is still coming up.
WAITING_FOR_LOAD_BALANCERThe service has been created and is waiting for the cloud load balancer to be assigned.
RECONCILIATION_PAUSEDReconciliation is paused for this gateway (by API setting or label). The workload continues running on its existing configuration.
RECONCILIATION_DIRTYThe operator detected pending changes for the gateway but the regular reconcile loop has not applied them. See Troubleshooting: a gateway is stuck in RECONCILIATION_DIRTY.
TRANSLATION_FAILEDTSB could not translate the gateway's configuration into Istio resources.

Pause precedence​

When multiple controls disagree, the operator resolves them in this order (highest to lowest):

  1. Object label on the gateway install CR (xcp.tetrate.io/gateway-reconcile: "true"|"false").
  2. Namespace override in gatewayReconciliation.namespaceOverrides, matched against the gateway's application namespace.
  3. Revision-level setting gatewayReconciliation.enabled.
  4. Default: reconciliation is enabled.

Pause reasons​

When a gateway is paused, the ReconciliationPaused condition reports the reason:

ReasonSourceHow to release
ObjectLabelDisabledThe xcp.tetrate.io/gateway-reconcile=false label on the gateway install CRRemove the label, or set it to true
NamespaceApiDisabledA namespaceOverrides entry with enabled: falseRemove or update the override in the ControlPlane CR
RevisionApiDisabledgatewayReconciliation.enabled: false at the revision levelSet enabled: true, or add a namespace override

Inspect the condition on a gateway:

kubectl get gatewaydeployment <name> -n <namespace> -o yaml
status:
phase: RECONCILIATION_PAUSED
conditions:
- type: ReconciliationPaused
status: "True"
reason: ObjectLabelDisabled
message: 'Reconciliation paused: ObjectLabelDisabled'
lastTransitionTime: "2026-03-23T16:45:51Z"

Observability​

The edge operator exposes Prometheus metrics for gateway reconciliation. Scrape them from the operator service or port-forward locally:

kubectl port-forward -n istio-system service/xcp-operator-edge 8084:8080
curl -s http://localhost:8084/metrics | grep gateway_reconcile

All gateway metrics carry the labels gateway_type, gateway_namespace, and gateway_name. The most useful ones for upgrade workflows:

MetricTypeDescription
gateway_reconcile_pausedGauge1 when a gateway is currently paused, 0 when active.
gateway_reconcile_skipped_totalCounterIncremented each time a gateway reconcile is skipped because of pause settings. The reason label is one of object_label_disabled, namespace_api_disabled, revision_api_disabled.
gateway_force_reconcile_totalCounterIncremented each time the install.tetrate.io/reconcile-before label triggers a force-reconcile (used to unstick a RECONCILIATION_DIRTY gateway).

Example alert rules:

AlertPromQLForSeverity
GatewayReconcilePausedTooLonggateway_reconcile_paused == 17dWarning — a pause was likely forgotten after an upgrade.
AllGatewaysFrozencount(gateway_reconcile_paused == 1) == count(gateway_reconcile_paused)1hWarning — every gateway is paused; no gateway is being actively managed.

Grafana Dashboard​

As an alternative to querying these metrics directly, you can use the XCP Edge Operator Grafana dashboard (uid xcp-edge-operator). Its Gateway Upgrades row is built specifically for this workflow, so you can watch a rollout progress without leaving Grafana.

How to install and operate TSB internal dashboards

The process to install and operate TSB internal dashboards is explained in the Telemetry documentation.

Two template variables scope every panel on the dashboard:

  • cluster — the XCP Edge cluster to inspect.
  • namespace — the gateway namespace to inspect (supports the panels that break results out per-gateway).

The Gateway Upgrades row surfaces:

PanelWhat it tells you
Installed GatewaysGateways actively managed by the current Istio revision, by gateway type.
Gateways Ignored (Revision Mismatch)Gateways belonging to a different Istio revision. Non-zero means an upgrade is in progress.
Paused GatewaysGateways with reconciliation currently paused. A lingering non-zero value can mean a pause was forgotten after an upgrade.
Gateways in Dirty StateGateways whose desired state doesn't match their applied state; a dirty gateway blocks reconciliation for later gateways in the same namespace. See Troubleshooting: a gateway is stuck in RECONCILIATION_DIRTY.
Gateway Reconcile Rate (Success vs Failure)Reconcile throughput by gateway type. Failures during an upgrade can indicate incompatible configuration or image-pull issues.
Gateway Reconcile Time (p50/p95/p99)Reconcile latency percentiles. Elevated latency during an upgrade can indicate resource contention or slow image pulls.
Skipped Reconciliations by ReasonSkip rate broken out by already_reconciled, dirty_skipped, revision_api_disabled, namespace_api_disabled, and object_label_disabled. already_reconciled is expected to dominate at steady state.
Force Reconcile TriggersRate of force-reconciles via the install.tetrate.io/reconcile-before label — typically used to manually push a stuck gateway forward.
Time Since Last Gateway ReconcileAge of the last reconcile per gateway. A large value can mean a gateway is stuck mid-upgrade.
Paused Gateways / Gateways in Dirty State (tables)Per-gateway lists (filtered by namespace) so you can identify exactly which gateways need attention, not just the aggregate count.

A practical way to use the dashboard during a rollout: set namespace to the batch you just released, watch Gateways Ignored (Revision Mismatch) fall to zero and Installed Gateways rise as gateways pick up the new revision, and confirm Paused Gateways and Gateways in Dirty State stay at zero throughout.