Skip to content

Commit

Permalink
feat(helm): add support for priorityClassName (#1008)
Browse files Browse the repository at this point in the history
# Description

Add support for configuring `priorityClassName` for the agent and
operator pods.

## Related Issue

If this pull request is related to any issue, please mention it here.
Additionally, make sure that the issue is assigned to you before
submitting this pull request.

## Checklist

- [ ] I have read the [contributing
documentation](https://retina.sh/docs/contributing).
- [ ] I signed and signed-off the commits (`git commit -S -s ...`). See
[this
documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
on signing commits.
- [ ] I have correctly attributed the author(s) of the code.
- [ ] I have tested the changes locally.
- [ ] I have followed the project's style guidelines.
- [ ] I have updated the documentation, if necessary.
- [ ] I have added tests, if applicable.

---

Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more
information on how to contribute to this project.
  • Loading branch information
iarlyy authored Nov 20, 2024
1 parent 3ac7f11 commit 2ce1fdc
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
spec:
hostNetwork: true
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
nodeSelector:
kubernetes.io/os: linux
{{- with .Values.imagePullSecrets }}
Expand Down Expand Up @@ -170,6 +173,9 @@ spec:
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- with .Values.imagePullSecrets }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ spec:
cpu: 250m
memory: 250Mi
serviceAccountName: retina-operator
{{- if .Values.operator.priorityClassName }}
priorityClassName: {{ .Values.operator.priorityClassName }}
{{- end }}
terminationGracePeriodSeconds: 10
volumes:
- name: retina-operator-config
Expand Down
5 changes: 5 additions & 0 deletions deploy/hubble/manifests/controller/helm/retina/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ securityContext:
windowsOptions:
runAsUserName: "NT AUTHORITY\\SYSTEM"

## @param priorityClassName [string] Indicates the pod's priority
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
##
priorityClassName: ""

service:
type: ClusterIP
port: 10093
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ spec:
spec:
hostNetwork: true
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
initContainers:
- name: init-retina
image: {{ .Values.image.initRepository }}:{{ .Values.image.tag }}
Expand Down Expand Up @@ -183,6 +186,9 @@ spec:
namespace: {{ .Values.namespace }}
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
securityContext:
windowsOptions:
hostProcess: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ spec:
resources:
{{- toYaml .Values.operator.resources | nindent 12 }}
serviceAccountName: {{ .Values.operator.name }}
{{- if .Values.operator.priorityClassName }}
priorityClassName: {{ .Values.operator.priorityClassName }}
{{- end }}
terminationGracePeriodSeconds: 10
volumes:
- name: "{{ .Values.operator.name }}-config"
Expand Down
7 changes: 6 additions & 1 deletion deploy/legacy/manifests/controller/helm/retina/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ livenessProbe: {}
# failureThreshold: 5
# successThreshold: 1

## @param priorityClassName [string] Indicates the pod's priority
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
##
priorityClassName: ""

metrics:
## Prometheus Service Monitor
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
Expand Down Expand Up @@ -278,4 +283,4 @@ metrics:
metricRelabelings:
- sourceLabels: [__name__]
action: keep
regex: (.*)
regex: (.*)

0 comments on commit 2ce1fdc

Please sign in to comment.