# Is the Helm lookup() function supported?

**URL:** <https://community.replicated.com/t/is-the-helm-lookup-function-supported/1060>\
**Category:** Uncategorized\
**Created:** [December 8, 2022, 11:40am UTC](https://community.replicated.com/t/is-the-helm-lookup-function-supported/1060 "2022-12-08T11:40:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bco](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/bco/32/482_2.png) [@bco](https://community.replicated.com/u/bco)\
**Post date:** [December 8, 2022, 11:40am UTC](https://community.replicated.com/t/is-the-helm-lookup-function-supported/1060/1 "2022-12-08T11:40:45Z")

</div>

In a [previous discussion](https://community.replicated.com/t/rendering-or-fetching-value-files-for-helmcharts/979/2) it was noted that Helm kots applications use `helm template` to install instead of `helm install` or `helm upgrade`.

Does this mean that the Helm lookup() function can’t be used?

> **[Template Function List](https://helm.sh/docs/chart_template_guide/function_list/)**
>
> A list of template functions available in Helm

> lookup: `lookup` is used to look up resource in a running cluster. When used with the `helm template` command it always returns an empty response.

If so is there any way around it?

---

<div class="post-metadata">

**Author:** ![jdewinne](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/jdewinne/32/152_2.png) [@jdewinne](https://community.replicated.com/u/jdewinne)\
**Post date:** [December 8, 2022, 9:33pm UTC](https://community.replicated.com/t/is-the-helm-lookup-function-supported/1060/2 "2022-12-08T21:33:23Z")

</div>

Hi @bco That is correct. We have an internal task on the backlog to have this also documented.

A workaround depends on what you’re using the `lookup()` function for.

---

<div class="post-metadata">

**Author:** ![bco](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/bco/32/482_2.png) [@bco](https://community.replicated.com/u/bco)\
**Post date:** [December 9, 2022, 11:51am UTC](https://community.replicated.com/t/is-the-helm-lookup-function-supported/1060/3 "2022-12-09T11:51:21Z")

</div>

The use case is a Helm pre-hook that generates the configuration file for a pod and writes it to a Secret. The Secret is mounted as a file in the pod.

Typically in Helm you would then add an annotation to the Deployment and use lookup() to compute the hash of the Secret, which would then cause a rollout restart when that Secret changes.

One workaround is to compute that hash in code and apply the annotation from the pre-hook code, but it means potentially doing a double rollout restart. I think we will just live with always restarting the service by adding the annotation `rollme: {{ uuidv4 }}` to the Helm Deployment.

---

<div class="post-metadata">

**Author:** ![jdewinne](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/jdewinne/32/152_2.png) [@jdewinne](https://community.replicated.com/u/jdewinne)\
**Post date:** [December 9, 2022, 10:07pm UTC](https://community.replicated.com/t/is-the-helm-lookup-function-supported/1060/4 "2022-12-09T22:07:19Z")

</div>

Maybe [reloader](https://github.com/stakater/Reloader) from stakater could automate this for you?
