<p>I’ve dependency in <code>priority class</code> inside my <code>k8s</code> yaml configs files and I need to install <strong>before</strong> any of my yaml inside the template folder
the prio class</p>

<pre><code>apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass
metadata:
  name: ocritical
value: 1000
globalDefault: false
</code></pre>

<p>After reading the helm docs it seems that I can use the <a href="http://%20https://helm.sh/docs/topics/charts_hooks/#writing-a-hook" rel="nofollow noreferrer">pre-install hook</a></p>

<p>I’ve changed my yaml and add anotiations section with pre-hook, and still it doesnt works, any idea what I miss here?  </p>

<pre><code>apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass
metadata:
  name: ocritical
  annotations:
    "helm.sh/hook": pre-install
value: 1000
globalDefault: false
</code></pre>

<p>The yaml is located inisde the <code>template</code> folder</p>

<p>You put quotation marks for <code>helm.sh/hook</code> annotation which is incorrect - you can only add quotation marks for values of them.
You can add description field in your configuration file, remember that this field is an arbitrary string. It is meant to tell users of the cluster when they should use this PriorityClass. </p>

<p>Your PriorityClass should looks like this:</p>

<pre><code>apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass
metadata:
  name: ocritical
  annotations:
    helm.sh/hook: pre-install,pre-upgrade
    helm.sh/hook-delete-policy: before-hook-creation
value: 1000
globalDefault: false
description: "This priority class should be used for XYZ service pods only."
</code></pre>

<p>More information about proper configuration of PriorityClass you can find here: <a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/" rel="nofollow noreferrer">PriorityClass</a>.
More information about installing hooks you can find here: <a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/" rel="nofollow noreferrer">helm-hooks</a>.</p>

<p>I hope it helps.</p>
