Skip to content

Commit

Permalink
Add priority class name (#1266)
Browse files Browse the repository at this point in the history
* Add support for priorityClassName (#1252)

Signed-off-by: Chris Stanaway <chris.stanaway@here.com>

* Add support for priorityClassName (#1252)

Signed-off-by: Chris Stanaway <chris.stanaway@here.com>

* Removed changes to `charts` directory per instructions. Updated helm chart README to reference `kustomize-for-helm.yaml`.

Signed-off-by: Chris Stanaway <chris.stanaway@here.com>

* Added priorityClassName to the default deployment

Signed-off-by: Chris Stanaway <chris.stanaway@here.com>

* Moved README update

Signed-off-by: Chris Stanaway <chris.stanaway@here.com>

* Add newline at end of file

Signed-off-by: Chris Stanaway <chris.stanaway@here.com>

* Moved README update

Signed-off-by: Chris Stanaway <chris.stanaway@here.com>

Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com>
  • Loading branch information
jcstanaway and ritazh committed Apr 28, 2021
1 parent d883817 commit a974d70
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions cmd/build/helmify/kustomize-for-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ spec:
imagePullSecrets:
HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_IMAGE_PULL_SECRETS: ""
hostNetwork: HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_HOST_NETWORK
priorityClassName: HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_PRIORITY_CLASS_NAME
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -121,6 +122,7 @@ spec:
imagePullSecrets:
HELMSUBST_DEPLOYMENT_AUDIT_IMAGE_PULL_SECRETS: ""
hostNetwork: HELMSUBST_DEPLOYMENT_AUDIT_HOST_NETWORK
priorityClassName: HELMSUBST_DEPLOYMENT_AUDIT_PRIORITY_CLASS_NAME
---
apiVersion: v1
kind: Secret
Expand Down
4 changes: 4 additions & 0 deletions cmd/build/helmify/replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ var replacements = map[string]string{

`HELMSUBST_DEPLOYMENT_AUDIT_IMAGE_PULL_SECRETS: ""`: `{{- toYaml .Values.image.pullSecrets | nindent 8 }}`,

"HELMSUBST_DEPLOYMENT_AUDIT_PRIORITY_CLASS_NAME": `{{ .Values.audit.priorityClassName }}`,

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_NODE_SELECTOR: ""`: `{{- toYaml .Values.controllerManager.nodeSelector | nindent 8 }}`,

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_AFFINITY: ""`: `{{- toYaml .Values.controllerManager.affinity | nindent 8 }}`,
Expand All @@ -25,6 +27,8 @@ var replacements = map[string]string{

`HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_IMAGE_PULL_SECRETS: ""`: `{{- toYaml .Values.image.pullSecrets | nindent 8 }}`,

"HELMSUBST_DEPLOYMENT_CONTROLLER_MANAGER_PRIORITY_CLASS_NAME": `{{ .Values.controllerManager.priorityClassName }}`,

"HELMSUBST_DEPLOYMENT_REPLICAS": `{{ .Values.replicas }}`,

`HELMSUBST_ANNOTATIONS: ""`: `{{- toYaml .Values.podAnnotations | trim | nindent 8 }}`,
Expand Down
8 changes: 4 additions & 4 deletions cmd/build/helmify/static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi

This Helm chart is autogenerated from the Gatekeeper static manifest. The
generator code lives under `cmd/build/helmify`. To make modifications to this
template, please edit `kustomization.yaml` and `replacements.go` under that
directory and then run `make manifests`. Your changes will show up in the
`manifest_staging` directory and will be promoted to the root `charts` directory
the next time a Gatekeeper release is cut.
template, please edit `kustomization.yaml`, `kustomize-for-helm.yaml` and
`replacements.go` under that directory and then run `make manifests`. Your
changes will show up in the `manifest_staging` directory and will be promoted
to the root `charts` directory the next time a Gatekeeper release is cut.
2 changes: 2 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ spec:
terminationGracePeriodSeconds: 60
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -176,3 +177,4 @@ spec:
terminationGracePeriodSeconds: 60
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
8 changes: 4 additions & 4 deletions manifest_staging/charts/gatekeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ _See [Exempting Namespaces](https://open-policy-agent.github.io/gatekeeper/websi

This Helm chart is autogenerated from the Gatekeeper static manifest. The
generator code lives under `cmd/build/helmify`. To make modifications to this
template, please edit `kustomization.yaml` and `replacements.go` under that
directory and then run `make manifests`. Your changes will show up in the
`manifest_staging` directory and will be promoted to the root `charts` directory
the next time a Gatekeeper release is cut.
template, please edit `kustomization.yaml`, `kustomize-for-helm.yaml` and
`replacements.go` under that directory and then run `make manifests`. Your
changes will show up in the `manifest_staging` directory and will be promoted
to the root `charts` directory the next time a Gatekeeper release is cut.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ spec:
{{- toYaml .Values.image.pullSecrets | nindent 8 }}
nodeSelector:
{{- toYaml .Values.audit.nodeSelector | nindent 8 }}
priorityClassName: {{ .Values.audit.priorityClassName }}
serviceAccountName: gatekeeper-admin
terminationGracePeriodSeconds: 60
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
{{- toYaml .Values.image.pullSecrets | nindent 8 }}
nodeSelector:
{{- toYaml .Values.controllerManager.nodeSelector | nindent 8 }}
priorityClassName: {{ .Values.controllerManager.priorityClassName }}
serviceAccountName: gatekeeper-admin
terminationGracePeriodSeconds: 60
tolerations:
Expand Down
2 changes: 2 additions & 0 deletions manifest_staging/deploy/gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ spec:
runAsUser: 1000
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
serviceAccountName: gatekeeper-admin
terminationGracePeriodSeconds: 60
---
Expand Down Expand Up @@ -813,6 +814,7 @@ spec:
readOnly: true
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
serviceAccountName: gatekeeper-admin
terminationGracePeriodSeconds: 60
volumes:
Expand Down

0 comments on commit a974d70

Please sign in to comment.