Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ pkg/
cmd/ # contains sub-packages for each cobra command
account/ # contains commands related to accounts
environment/ # contains commands related to environments
kubernetes/ # contains commands related to Kubernetes observability (live status)
... # more commands
constants/ # constant values to avoid duplicated strings, ints, etc
errors/ # internal error objects
Expand Down
26 changes: 26 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,32 @@ octopus deployment-target ssh create \

Note: The `--role` flag continues to work for backwards compatibility but will be deprecated in favor of `--tag` once target tag sets are widely adopted.

# View Kubernetes live object status

Check the live status of Kubernetes resources deployed to an environment:

```
octopus kubernetes live-status --project "K8s Smoke Test Demo" --environment Development --no-prompt
```

Get a summary of the overall health status:

```
octopus kubernetes live-status --project "K8s Smoke Test Demo" --environment Development --summary-only --no-prompt
```

For tenanted deployments:

```
octopus kubernetes live-status --project "K8s Smoke Test Demo" --environment Production --tenant "My Tenant" --no-prompt
```

The `k8s` alias can be used as a shorthand:

```
octopus k8s live-status --project "K8s Smoke Test Demo" --environment Development -f json --no-prompt
```

# Bulk deleting releases by created date

This example will delete all releases created before 2AM 6 Dec 2022 UTC
Expand Down
23 changes: 23 additions & 0 deletions pkg/cmd/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package kubernetes

import (
"github.com/MakeNowJust/heredoc/v2"
cmdLiveStatus "github.com/OctopusDeploy/cli/pkg/cmd/kubernetes/live-status"
"github.com/OctopusDeploy/cli/pkg/constants"
"github.com/OctopusDeploy/cli/pkg/factory"
"github.com/spf13/cobra"
)

func NewCmdKubernetes(f factory.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "kubernetes <command>",
Short: "Kubernetes observability commands",
Long: "Commands for observing Kubernetes resources deployed via Octopus Deploy",
Example: heredoc.Docf("%s kubernetes live-status --project MyProject --environment Production", constants.ExecutableName),
Aliases: []string{"k8s"},
}

cmd.AddCommand(cmdLiveStatus.NewCmdLiveStatus(f))

return cmd
}
Loading
Loading