{{- $internalTlsEnabled := include "managed-agent.internalTlsEnabled" . -}}
Managed Agent exposes a signed API on Service {{ .Release.Name }} (port 8080).
{{- if $internalTlsEnabled }}
Control-plane replicas run in Deployment {{ .Release.Name }} ({{ .Values.server.replicas }} replica(s)) and pull-only Hosted Harnesses run independently in Deployment {{ .Release.Name }}-harness ({{ .Values.harness.replicas }} replica(s)), communicating over internal HTTPS Service {{ .Release.Name }}-internal (port 8081) using TLS Secret {{ include "managed-agent.internalTlsSecret" . }}.
{{- if and .Values.internalTls.existingSecret (empty (lookup "v1" "Secret" .Release.Namespace (include "managed-agent.internalTlsSecret" .))) }}
Note: Helm could not inspect external TLS Secret {{ .Values.internalTls.existingSecret }} during rendering; ensure it exists in namespace {{ .Release.Namespace }} with ca.crt, tls.crt, and tls.key valid for {{ .Release.Name }}-internal.
{{- end }}
{{- else }}
Control-plane replicas run in Deployment {{ .Release.Name }} ({{ .Values.server.replicas }} replica(s)) and pull-only Hosted Harnesses run independently in Deployment {{ .Release.Name }}-harness ({{ .Values.harness.replicas }} replica(s)), communicating over internal plaintext HTTP Service {{ .Release.Name }}-internal (port 8081) with internalTls.enabled=false.
Note: internal TLS is disabled; ensure the cluster network or service mesh protects internal traffic and tokens on {{ .Release.Name }}-internal:8081.
{{- end }}
{{ if .Values.runtime.enabled }}
Trusted single-node Workspace files and foreground Shell are enabled (server pinned to 1 replica with Recreate).
Close every tool Session and confirm physical holders are clear before replacing the server Pod.
{{ else }}
Workspace tools are disabled.
{{ end }}

Connect locally:
  kubectl -n {{ .Release.Namespace }} port-forward service/{{ .Release.Name }} 8080:8080

Run deploy/kubernetes/smoke.mjs with the signing key from Secret {{ include "managed-agent.secret" . }}.
See deploy/kubernetes/README.md for the command and upgrade procedure.
{{ if .Values.web.enabled }}

Connect to WebShell:
  kubectl -n {{ .Release.Namespace }} port-forward service/{{ .Release.Name }} 4171:4171
Authenticate using web-token from Secret {{ include "managed-agent.secret" . }}.
The fixed browser identity is {{ .Values.web.tenantId }}/{{ .Values.web.actorId }}.
{{ end }}

Uninstall retains the managed Secrets, MySQL PVC and any Runtime/Workspace PVCs. Back them up before upgrades.
Do not use automatic Helm rollback across database migrations.
