Skip to content

Commit

Permalink
feat: add configuration for priority classes (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
pravindahal committed Jun 13, 2023
1 parent 1cc29e4 commit 5653d98
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions charts/prefect-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Prefect Agent application bundle
| agent.podSecurityContext.fsGroup | int | `1001` | set agent pod's security context fsGroup |
| agent.podSecurityContext.runAsNonRoot | bool | `true` | set agent pod's security context runAsNonRoot |
| agent.podSecurityContext.runAsUser | int | `1001` | set agent pod's security context runAsUser |
| agent.priorityClassName | string | `""` | priority class name to use for the agent pods; if the priority class is empty or doesn't exist, the agent pods are scheduled without a priority class |
| agent.replicaCount | int | `1` | number of agent replicas to deploy |
| agent.resources.limits | object | `{"cpu":"1000m","memory":"1Gi"}` | the requested limits for the agent container |
| agent.resources.requests | object | `{"cpu":"100m","memory":"256Mi"}` | the requested resources for the agent container |
Expand Down
3 changes: 3 additions & 0 deletions charts/prefect-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ spec:
{{- if .Values.agent.podSecurityContext }}
securityContext: {{- .Values.agent.podSecurityContext | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.agent.priorityClassName }}
priorityClassName: {{ .Values.agent.priorityClassName }}
{{- end }}
containers:
- name: prefect-agent
image: "{{ .Values.agent.image.repository }}:{{ .Values.agent.image.prefectTag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/prefect-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ agent:
# -- set agent pod's security context fsGroup
fsGroup: 1001

# ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass
# -- priority class name to use for the agent pods; if the priority class is empty or doesn't exist, the agent pods are scheduled without a priority class
priorityClassName: ""

## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
containerSecurityContext:
# -- set agent containers' security context runAsUser
Expand Down
3 changes: 2 additions & 1 deletion charts/prefect-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Prefect server application bundle
| commonLabels | object | `{}` | labels to add to all deployed objects |
| fullnameOverride | string | `"prefect-server"` | fully override common.names.fullname |
| ingress.annotations | object | `{}` | additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. |
| ingress.className | string | `""` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) |
| ingress.className | string | `""` | IngressClass that will be used to implement the Ingress (Kubernetes 1.18+) |
| ingress.enabled | bool | `false` | enable ingress record generation for server |
| ingress.extraHosts | list | `[]` | an array with additional hostname(s) to be covered with the ingress record |
| ingress.extraPaths | list | `[]` | an array with additional arbitrary paths that may need to be added to the ingress under the main host |
Expand Down Expand Up @@ -93,6 +93,7 @@ Prefect server application bundle
| server.podSecurityContext.fsGroup | int | `1001` | set server pod's security context fsGroup |
| server.podSecurityContext.runAsNonRoot | bool | `true` | set server pod's security context runAsNonRoot |
| server.podSecurityContext.runAsUser | int | `1001` | set server pod's security context runAsUser |
| server.priorityClassName | string | `""` | priority class name to use for the server pods; if the priority class is empty or doesn't exist, the server pods are scheduled without a priority class |
| server.publicApiUrl | string | `""` | sets PREFECT_UI_API_URL; should be publicly accessible API URL; UI will not work unless set |
| server.readinessProbe.config.failureThreshold | int | `3` | The number of consecutive failures allowed before considering the probe as failed. |
| server.readinessProbe.config.initialDelaySeconds | int | `10` | The number of seconds to wait before starting the first probe. |
Expand Down
3 changes: 3 additions & 0 deletions charts/prefect-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ spec:
{{- if .Values.server.podSecurityContext }}
securityContext: {{- .Values.server.podSecurityContext | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.server.priorityClassName }}
priorityClassName: {{ .Values.server.priorityClassName }}
{{- end }}
containers:
- name: prefect-server
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.prefectTag }}"
Expand Down
6 changes: 5 additions & 1 deletion charts/prefect-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ server:
# -- enable server image debug mode
debug: false

# ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass
# -- priority class name to use for the server pods; if the priority class is empty or doesn't exist, the server pods are scheduled without a priority class
priorityClassName: ""

# -- sets PREFECT_UI_API_URL; should be publicly accessible API URL; UI will not work unless set
publicApiUrl: ""

Expand Down Expand Up @@ -180,7 +184,7 @@ ingress:
enabled: false
## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster .
## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/
# -- IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+)
# -- IngressClass that will be used to implement the Ingress (Kubernetes 1.18+)
className: ""
host:
# -- default host for the ingress record
Expand Down
5 changes: 4 additions & 1 deletion charts/prefect-worker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# prefect-worker

![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2-latest](https://img.shields.io/badge/AppVersion-2--latest-informational?style=flat-square)

![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2-latest](https://img.shields.io/badge/AppVersion-2--latest-informational?style=flat-square)

Prefect Worker application bundle

Expand Down Expand Up @@ -81,11 +82,13 @@ Prefect Worker application bundle
| worker.podSecurityContext.fsGroup | int | `1001` | set worker pod's security context fsGroup |
| worker.podSecurityContext.runAsNonRoot | bool | `true` | set worker pod's security context runAsNonRoot |
| worker.podSecurityContext.runAsUser | int | `1001` | set worker pod's security context runAsUser |
| worker.priorityClassName | string | `""` | priority class name to use for the worker pods; if the priority class is empty or doesn't exist, the worker pods are scheduled without a priority class |
| worker.replicaCount | int | `1` | number of worker replicas to deploy |
| worker.resources.limits | object | `{"cpu":"1000m","memory":"1Gi"}` | the requested limits for the worker container |
| worker.resources.requests | object | `{"cpu":"100m","memory":"256Mi"}` | the requested resources for the worker container |
| worker.serverApiConfig.apiUrl | string | `"http://127.0.0.1:4200/api"` | prefect API url (PREFECT_API_URL); should be in-cluster URL if the worker is deployed in the same cluster as the API |
| worker.tolerations | list | `[]` | tolerations for worker pods assignment |


----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
3 changes: 3 additions & 0 deletions charts/prefect-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ spec:
{{- if .Values.worker.podSecurityContext }}
securityContext: {{- .Values.worker.podSecurityContext | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.worker.priorityClassName }}
priorityClassName: {{ .Values.worker.priorityClassName }}
{{- end }}
containers:
- name: prefect-worker
image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.prefectTag }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/prefect-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ worker:
# -- set worker pod's security context fsGroup
fsGroup: 1001

# ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass
# -- priority class name to use for the worker pods; if the priority class is empty or doesn't exist, the worker pods are scheduled without a priority class
priorityClassName: ""

## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
containerSecurityContext:
# -- set worker containers' security context runAsUser
Expand Down

0 comments on commit 5653d98

Please sign in to comment.