Proposal: NOTES.txt rendering are the end of the install lifecycle


Guillaume Berche
 

Hi,

Following the HIP process, I'd like to know whether the use-case below already received some thoughts, and whether there are some suggestions on best user experience to support this use-case. I have so far only submitted https://github.com/helm/helm/issues/9391 and would like to gather feedback on alternative UX before contributing a HIP PR.
Expected behavior

As a helm chart author

  • in order for NOTES.txt template to display value looked up in status of K8S resources installed by the chart (say a URL to a webui managed service provisionned in a public cloud, and this url is'nt predictable at installation time)
  • I need a way for the NOTES.txt template to render during the post-install step of the install lifecycle.

See concrete example in https://github.com/orange-cloudfoundry/osb-to-helm-poc/blob/0c285e7c9de1f08898f55bc274d256de21297f0d/NOTES.txt.tpl#L1-L16

Observed behavior

NOTES.txt template is rendered before the pre-install step of the install lifecycle therefore the following NOTES.txt content

{{ $fullName:=include "p-mysql.fullname" . -}}
{{ $serviceInstance:= ( lookup "servicecatalog.k8s.io/v1beta1" "ServiceInstance" .Release.Namespace  $fullName) -}}

{{- if $serviceInstance }}
You may access the managed service dashboard through:
{{ $serviceInstance.status.dashboardURL }}

ps: you're seeing this because NOTES.txt template was refreshed during last chart update.
{{ else }}
Dashboard url may be accessed through the following command:
   kubectl get ServiceInstance -n {{.Release.Namespace}} {{$fullName}} -o jsonpath='{.status.dashboardURL}'

You may also try to update this helm chart to have this NOTES.txt template refreshed with resource looked up
{{ end }}

will render as the following as a result of `helm install`

Dashboard url may be accessed through the following command:
   kubectl get ServiceInstance -n my-namespace my-service -o jsonpath='{.status.dashboardURL}'

You may also try to update this helm chart to have this NOTES.txt template refreshed with resource looked up

If helm upgrade is executed, then NOTES.txt is rendered instead as:

You may access the managed service dashboard through:
https://sample-service.a-public-provider.org/a-dynamically-generated-guid

ps: you're seeing this because NOTES.txt template was refreshed during last chart update.

Alternative chart author and chart user experiences

1. NOTES.txt template rendering now gets executed after the last chart hook in the install lifecycle. E.g. if a chart has both a pre-install and post-install hooks then the NOTES.txt renders after the post-install hook is "Ready" (instead of before the pre-install hooks AFAIK). I'm not sure whether this is considered a breaking change according to semantic versionning applies to helm.

2. a new opt-in to select in which phases the NOTES.txt template is rendered or possibly re-rendered/refreshed. Definitively a major version according to semantic versionning. This is more complex and likely outside of the scope of this proposal. Might be useful a way to provide progress feedback during install lifecycle.

Thanks in advance for your feedback and alternative suggestions.

Guillaume.

Join cncf-helm@lists.cncf.io to automatically receive all group messages.