From 21eebc3f6b5cc8bda89fdf0fc2008702a17a4bf7 Mon Sep 17 00:00:00 2001 From: Eddy Moulton Date: Mon, 15 Dec 2025 11:34:35 +1100 Subject: [PATCH] KLOS support for script steps --- .../kubernetes/live-object-status/index.md | 55 +++++++++++++++++-- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/src/pages/docs/kubernetes/live-object-status/index.md b/src/pages/docs/kubernetes/live-object-status/index.md index 09278082b2..afdb865833 100644 --- a/src/pages/docs/kubernetes/live-object-status/index.md +++ b/src/pages/docs/kubernetes/live-object-status/index.md @@ -23,7 +23,6 @@ Using Kubernetes Live Object Status requires the following: - Octopus Deploy 2025.3+ - A [Kubernetes Agent](/docs/kubernetes/targets/kubernetes-agent) target - A project with a deployment process containing Kubernetes steps - - The kubectl script step is currently unsupported ## How to use Live Status @@ -45,7 +44,7 @@ Octopus display individual status at an object level as well as summarized statu | :---------- | :------------------------------------------------: | :-------------------------------------------------------------------------- | | Progressing | | Objects in your application are currently in a progressing state | | Healthy | | The objects in your cluster match what was specified in the last deployment | -| Unknown | | We’re having trouble getting live status updates for this application | +| Unknown | | We're having trouble getting live status updates for this application | | Degraded | | Your objects experienced errors after the deployment completed | | Out of Sync | | The objects on your cluster no longer match what you last deployed | | Missing | | Objects in your application are currently in a missing state | @@ -116,6 +115,54 @@ The Kubernetes Agent has a new component called the Kubernetes monitor which als During a deployment, Octopus will capture any applied Kubernetes manifests and send them to the monitor. The monitor uses these manifests to track the deployed objects in the cluster, keeping track of their synchronization and health. +### Script steps + +The built in Kubernetes steps will automatically report the applied manifests for deployments, however Octopus needs a bit of help when you're making changes using plain script steps. + +To notify Octopus which Kubernetes resources you want tracked, we have bash and powershell helper functions available to use. You can choose between passing the manifest as a variable, or passing the file path directly instead. + +:::div{.info} +You still need to apply the Kubernetes manifests to your cluster. These functions only notify Octopus that you expect the resources to be created. +::: + +#### Bash + +```bash +read -r -d '' manifest << EOM +apiVersion: v1 +kind: Namespace +metadata: + name: "example" +labels: + name: "example" +EOM + +report_kubernetes_manifest "$manifest" +``` + +```bash +report_kubernetes_manifest_file "$ManifestFilePath" +``` + +#### Powershell + +```pwsh +$manifest = @" +apiVersion: v1 +kind: Namespace +metadata: + name: "example" +labels: + name: "example" +"@ + +Report-KubernetesManifest -manifest $manifest +``` + +```pwsh +Report-KubernetesManifestFile -path $ManifestFilePath +``` + ## User permissions Viewing the data returned from the Kubernetes monitor from within Octopus requires `DeploymentView` permissions. @@ -169,10 +216,6 @@ The desired object list is compiled from objects that were applied during the la Please avoid skipping steps that deploy Kubernetes objects. -### Script steps are not supported - -Objects modified by script steps directly are not monitored. Support for script steps is planned for a future release. - ### Runbooks are not supported Objects modified by Runbooks are not monitored. Please deploy the objects via a Deployment if you want them to be monitored.