Tema054
Tema054

Reputation: 9

get name of all resources from helm release

I want get name of resources from helm release. But I don't understand how.

I don't find anything

helm get all RELEASE_NAME --template '{{range .items}}{{.metadata.name}}{{end}}'

Upvotes: 1

Views: 1823

Answers (1)

David Maze
David Maze

Reputation: 158758

helm get all has a somewhat constrained set of options for its --template option; it gets passed in a single .Release object, and the set of created Kubernetes options is stored in text in a .Release.Manifest field.

helm get all RELEASE_NAME --template '{{ .Release.Manifest }}'
# returns the manifest as a string

There's a dedicated helm get manifest subcommand that returns the manifest as YAML.

Once you have the YAML, you need to extract the resource names from it. One approach is to use a tool like yq that can do generic queries over YAML:

helm get manifest RELEASE_NAME | yq eval '.metadata.name' -

Upvotes: 2

Related Questions