Skip to content

Commit

Permalink
feat: add support for more deployment configuration (#48)
Browse files Browse the repository at this point in the history
Adds some standard deployment configuration values
such as deployment annotations, priorityClassName,
pod labels, dns configuration, and extraArgs for
the container.

(cherry picked from commit fc94e6b)

Co-authored-by: Matt Demers <[email protected]>
  • Loading branch information
andaaron and matt-demers authored Oct 25, 2024
1 parent b86454e commit acb80f1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/zot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: v2.1.2-rc2
description: A Helm chart for Kubernetes
name: zot
type: application
version: 0.1.62
version: 0.1.63
19 changes: 19 additions & 0 deletions charts/zot/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ metadata:
name: {{ include "zot.fullname" . }}
labels:
{{- include "zot.labels" . | nindent 4 }}
{{- with .Values.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
{{- with .Values.strategy }}
Expand All @@ -30,6 +34,9 @@ spec:
{{- end }}
labels:
{{- include "zot.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -38,12 +45,19 @@ spec:
serviceAccountName: {{ include "zot.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.extraArgs }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- toYaml .Values.env | nindent 12 }}
ports:
Expand Down Expand Up @@ -147,3 +161,8 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: {{ .Values.dnsPolicy }}
14 changes: 14 additions & 0 deletions charts/zot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,21 @@ strategy:
# rollingUpdate:
# maxUnavailable: 25%

# Extra args to pass to the deployment's container
extraArgs: []

podAnnotations: {}

podLabels: {}

deploymentAnnotations: {}

priorityClassName: ""

dnsConfig: {}

dnsPolicy: "ClusterFirst"

# Metrics configuration
# NOTE: need enable metric extension in config.json
metrics:
Expand Down

0 comments on commit acb80f1

Please sign in to comment.