Skip to content

Commit

Permalink
feat(helm): add priority class name for pod (#2183)
Browse files Browse the repository at this point in the history
add priorityClassname to pod definition
  • Loading branch information
Letfdsada authored Nov 22, 2023
1 parent cade685 commit 9bfdbca
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 0 deletions.
103 changes: 103 additions & 0 deletions contrib/charts/dragonfly/ci/priorityclassname-values.golden.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
# Source: dragonfly/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: test-dragonfly
namespace: default
labels:
app.kubernetes.io/name: dragonfly
app.kubernetes.io/instance: test
app.kubernetes.io/version: "v1.12.1"
app.kubernetes.io/managed-by: Helm
---
# Source: dragonfly/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: test-dragonfly
namespace: default
labels:
app.kubernetes.io/name: dragonfly
app.kubernetes.io/instance: test
app.kubernetes.io/version: "v1.12.1"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 6379
targetPort: dragonfly
protocol: TCP
name: dragonfly
selector:
app.kubernetes.io/name: dragonfly
app.kubernetes.io/instance: test
---
# Source: dragonfly/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-dragonfly
namespace: default
labels:
app.kubernetes.io/name: dragonfly
app.kubernetes.io/instance: test
app.kubernetes.io/version: "v1.12.1"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: dragonfly
app.kubernetes.io/instance: test
template:
metadata:
annotations:
labels:
app.kubernetes.io/name: dragonfly
app.kubernetes.io/instance: test
spec:
priorityClassName: high-priority
serviceAccountName: test-dragonfly
containers:
- name: dragonfly
image: "docker.dragonflydb.io/dragonflydb/dragonfly:v1.12.1"
imagePullPolicy: IfNotPresent
ports:
- name: dragonfly
containerPort: 6379
protocol: TCP
livenessProbe:
exec:
command:
- /bin/sh
- /usr/local/bin/healthcheck.sh
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
exec:
command:
- /bin/sh
- /usr/local/bin/healthcheck.sh
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
args:
- "--alsologtostderr"
resources:
limits: {}
requests: {}
---
# Source: dragonfly/templates/extra-manifests.yaml
apiVersion: scheduling.k8s.io/v1
description: This priority class should be used only for tests.
globalDefault: false
kind: PriorityClass
metadata:
name: high-priority
value: 1000000
10 changes: 10 additions & 0 deletions contrib/charts/dragonfly/ci/priorityclassname-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
priorityClassName: "high-priority"

extraObjects:
- apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 1000000
globalDefault: false
description: "This priority class should be used only for tests."
3 changes: 3 additions & 0 deletions contrib/charts/dragonfly/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ volumeMounts:
{{- end }}

{{- define "dragonfly.pod" -}}
{{- if ne .Values.priorityClassName "" }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | trim | nindent 2 -}}
Expand Down
3 changes: 3 additions & 0 deletions contrib/charts/dragonfly/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ resources:
# cpu: 100m
# memory: 128Mi

# -- Priority class name for pod assignment
priorityClassName: ""

# -- Node labels for pod assignment
nodeSelector: {}

Expand Down

0 comments on commit 9bfdbca

Please sign in to comment.