Reputation: 9
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
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