Skip to content

Instantly share code, notes, and snippets.

@jaytaylor
Created June 28, 2019 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaytaylor/451c5caf27780ec0009494bf6baf979a to your computer and use it in GitHub Desktop.
Save jaytaylor/451c5caf27780ec0009494bf6baf979a to your computer and use it in GitHub Desktop.
Manual fix for missing priorityClass after helm upgrade

Problem Statement

I've been hitting cases where kubernetes cluster actions are blocked due to priorityClass being absent after a helm install --upgrade.

For example:

  Type     Reason        Age                  From                    Message
  ----     ------        ----                 ----                    -------
  Warning  FailedCreate  3m (x1405 over 11h)  statefulset-controller  create Pod elasticsearch-data-2 in StatefulSet elasticsearch-data failed error: pods "elasticsearch-data-2" is forbidden: no PriorityClass with name elasticsearch-data was found```

```bash
$ helm version
Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}```

```bash
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.7-3+1a4d39a9763d23", GitCommit:"1a4d39a9763d23548d16e262d6dbe0fb2198a8ce", GitTreeState:"clean", BuildDate:"2019-03-27T01:47:38Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.7-3+1a4d39a9763d23", GitCommit:"1a4d39a9763d23548d16e262d6dbe0fb2198a8ce", GitTreeState:"clean", BuildDate:"2019-03-27T01:47:38Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}

Manual Solution

Manually create the missing PriorityClass.

echo 'apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass
metadata:
  name: elasticsearch-data
value: 1000000
globalDefault: false
description: "Critical for elasticsearch-data workloads"' | kubectl apply -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment