-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This should greatly improve readability of the chart itself - moved the `Pod` spec for both the `Deployment` and `StatefulSet` into a common template in `_pod.yaml` - replace a bunch of `if $value; print $value`-type blocks with `with $value; print .` - replaced `command.set` in `values.yaml` with `command` directly - this was broken anyways, as the chart wrongly referenced `command.cmd` for both `Deployment` and `StatefulSet` - populated contrib/charts/dragonfly/ci/ folder for development/CI purposes Signed-off-by: Philipp Born <git@pborn.eu>
- Loading branch information
Showing
19 changed files
with
249 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app.kubernetes.io/name | ||
operator: In | ||
values: | ||
- dragonfly | ||
topologyKey: kubernetes.io/hostname | ||
weight: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
command: | ||
- /usr/local/bin/dragonfly | ||
- --logtostderr | ||
|
||
extraArgs: | ||
- --cache_mode=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extraVolumes: | ||
- name: tmp | ||
emptyDir: | ||
sizeLimit: 500Mi | ||
|
||
extraVolumeMounts: | ||
- mountPath: /tmp | ||
name: tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
initContainers: | ||
- name: busybox | ||
image: busybox:1.28 | ||
command: ['sh', '-c', 'sleep 1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
storage: | ||
enabled: true | ||
requests: 128Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
podSecurityContext: | ||
allowPrivilegeEscalation: false | ||
|
||
securityContext: | ||
readOnlyRootFilesystem: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
tls: | ||
enabled: true | ||
existing_secret: "" | ||
cert: | | ||
-----BEGIN CERTIFICATE----- | ||
MIIB8zCCAZqgAwIBAgIEbb2Z2jAKBggqhkjOPQQDAzBZMQswCQYDVQQGEwJGTzEg | ||
MB4GA1UEAwwXZHJhZ29uZmx5LmRyYWdvbmZseS5zdmMxDDAKBgNVBAgMA2ZvbzEM | ||
MAoGA1UEBwwDZm9vMQwwCgYDVQQKDANmb28wHhcNMjIxMjI5MTIwMzI3WhcNMzIx | ||
MjI2MTIwMzI3WjBZMQswCQYDVQQGEwJGTzEgMB4GA1UEAwwXZHJhZ29uZmx5LmRy | ||
YWdvbmZseS5zdmMxDDAKBgNVBAgMA2ZvbzEMMAoGA1UEBwwDZm9vMQwwCgYDVQQK | ||
DANmb28wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQWNfTuNjhPEi7h1ciCS0It | ||
fKgiBhxLGlF3MtjlFTjCrzkynSSABoMtNljcDE0hm/izbRUogAcDFcvknvChzxaq | ||
o1AwTjAdBgNVHQ4EFgQUSN6FbsJZ2EUfX3beCh5cEo6cktQwHwYDVR0jBBgwFoAU | ||
SN6FbsJZ2EUfX3beCh5cEo6cktQwDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQDAwNH | ||
ADBEAiB6tG5xzyj4iT/e0wpCMRHOvlQKQexByhyNPAhro9ZCRgIgaDcd9vM8rCbb | ||
JPRyzm0iN9OWM/A24nmm3itn3I4rcD0= | ||
-----END CERTIFICATE----- | ||
key: | | ||
-----BEGIN EC PRIVATE KEY----- | ||
MHcCAQEEINh6eMDrBlAiT68T8ovzGn6JZbJevUefYkIIYNWww55yoAoGCCqGSM49 | ||
AwEHoUQDQgAEFjX07jY4TxIu4dXIgktCLXyoIgYcSxpRdzLY5RU4wq85Mp0kgAaD | ||
LTZY3AxNIZv4s20VKIAHAxXL5J7woc8Wqg== | ||
-----END EC PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tolerations: | ||
- effect: NoSchedule | ||
operator: Exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{{- define "dragonfly.volumemounts" -}} | ||
{{- if or (.Values.storage.enabled) (.Values.extraVolumeMounts) (.Values.tls.enabled) }} | ||
volumeMounts: | ||
{{- if .Values.storage.enabled }} | ||
- mountPath: /data | ||
name: "{{ .Release.Name }}-data" | ||
{{- end }} | ||
{{- if and .Values.tls .Values.tls.enabled }} | ||
- mountPath: /etc/dragonfly/tls | ||
name: tls | ||
{{- end }} | ||
{{- with .Values.extraVolumeMounts }} | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "dragonfly.pod" -}} | ||
serviceAccountName: {{ include "dragonfly.serviceAccountName" . }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- with .Values.podSecurityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- with .Values.initContainers }} | ||
initContainers: | ||
{{- toYaml . | nindent 2 }} | ||
{{- with $.Values.resources }} | ||
resources: | ||
{{- toYaml . | nindent 6 }} | ||
{{- end }} | ||
{{- include "dragonfly.volumemounts" $ | nindent 4 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
{{- with .Values.securityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 6 }} | ||
{{- end }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: dragonfly | ||
containerPort: 6379 | ||
protocol: TCP | ||
{{- with .Values.probes }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.command }} | ||
command: | ||
{{- toYaml . | nindent 6 }} | ||
{{- end }} | ||
args: | ||
- "--alsologtostderr" | ||
{{- with .Values.extraArgs }} | ||
{{- toYaml . | nindent 6 }} | ||
{{- end }} | ||
{{- if .Values.tls.enabled }} | ||
- "--tls" | ||
- "--tls_cert_file=/etc/dragonfly/tls/tls.crt" | ||
- "--tls_key_file=/etc/dragonfly/tls/tls.key" | ||
{{- end }} | ||
{{- with .Values.resources }} | ||
resources: | ||
{{- toYaml . | nindent 6 }} | ||
{{- end }} | ||
{{- include "dragonfly.volumemounts" . | nindent 4 }} | ||
|
||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
|
||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
|
||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
|
||
{{- if or (.Values.tls.enabled) (.Values.extraVolumes) }} | ||
volumes: | ||
{{- if and .Values.tls .Values.tls.enabled }} | ||
{{- if .Values.tls.existing_secret }} | ||
- name: tls | ||
secret: | ||
secretName: {{ .Values.tls.existing_secret }} | ||
{{- else }} | ||
- name: tls | ||
secret: | ||
secretName: {{ include "dragonfly.fullname" . }}-tls | ||
{{- end }} | ||
{{- end }} | ||
{{- with .Values.extraVolumes }} | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.