mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
chore: overhaul chart (#620)
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> Signed-off-by: Philipp Born <git@pborn.eu>
This commit is contained in:
parent
589a6ffd00
commit
c3de3ef2f3
24 changed files with 284 additions and 213 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -124,5 +124,5 @@ jobs:
|
||||||
install \
|
install \
|
||||||
--config .ct.yaml \
|
--config .ct.yaml \
|
||||||
--debug \
|
--debug \
|
||||||
--helm-extra-set-args "--set=image.repository=ghcr.io/${{ github.repository }}" \
|
--helm-extra-set-args "--set=image.repository=ghcr.io/${{ github.repository }},probes=null" \
|
||||||
${{github.event_name == 'workflow_dispatch' && '--all'}} ;
|
${{github.event_name == 'workflow_dispatch' && '--all'}} ;
|
||||||
|
|
|
@ -1,34 +1,62 @@
|
||||||
# dragonfly
|
# dragonfly
|
||||||
|
|
||||||
  
|
  
|
||||||
|
|
||||||
Dragonfly is a modern in-memory datastore, fully compatible with Redis and Memcached APIs.
|
Dragonfly is a modern in-memory datastore, fully compatible with Redis and Memcached APIs.
|
||||||
|
|
||||||
|
**Homepage:** <https://dragonflydb.io/>
|
||||||
|
|
||||||
|
## Source Code
|
||||||
|
|
||||||
|
* <https://github.com/dragonflydb/dragonfly>
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
Kubernetes: `>=1.23.0-0`
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|
||||||
| Key | Type | Default | Description |
|
| Key | Type | Default | Description |
|
||||||
|-----|------|---------|-------------|
|
|-----|------|---------|-------------|
|
||||||
| affinity | object | `{}` | Affinity for pod assignment |
|
| affinity | object | `{}` | Affinity for pod assignment |
|
||||||
| command.set | list | `[]` | Allow overriding the container's command |
|
| command | list | `[]` | Allow overriding the container's command |
|
||||||
| extraArgs | list | `[]` | Extra arguments to pass to the dragonfly binary |
|
| extraArgs | list | `[]` | Extra arguments to pass to the dragonfly binary |
|
||||||
|
| extraContainers | list | `[]` | Additional sidecar containers |
|
||||||
|
| extraObjects | list | `[]` | extra K8s manifests to deploy |
|
||||||
| extraVolumeMounts | list | `[]` | Extra volume mounts corresponding to the volumes mounted above |
|
| extraVolumeMounts | list | `[]` | Extra volume mounts corresponding to the volumes mounted above |
|
||||||
| extraVolumes | list | `[]` | Extra volumes to mount into the pods |
|
| extraVolumes | list | `[]` | Extra volumes to mount into the pods |
|
||||||
| fullnameOverride | string | `""` | String to fully override dragonfly.fullname |
|
| fullnameOverride | string | `""` | String to fully override dragonfly.fullname |
|
||||||
| image.pullPolicy | string | `"IfNotPresent"` | Dragonfly image pull policy |
|
| image.pullPolicy | string | `"IfNotPresent"` | Dragonfly image pull policy |
|
||||||
| image.repository | string | `"docker.dragonflydb.io/dragonflydb/dragonfly"` | Container Image Registry to pull the image from |
|
| image.repository | string | `"docker.dragonflydb.io/dragonflydb/dragonfly"` | Container Image Registry to pull the image from |
|
||||||
| image.tag | string | `"latest"` | Overrides the image tag whose default is the chart appVersion. |
|
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
|
||||||
| imagePullSecrets | list | `[]` | Container Registry Secret names in an array |
|
| imagePullSecrets | list | `[]` | Container Registry Secret names in an array |
|
||||||
| initContainers | list | `[]` | A list of initContainers to run before each pod starts |
|
| initContainers | list | `[]` | A list of initContainers to run before each pod starts |
|
||||||
| nameOverride | string | `""` | String to partially override dragonfly.fullname |
|
| nameOverride | string | `""` | String to partially override dragonfly.fullname |
|
||||||
| nodeSelector | object | `{}` | Node labels for pod assignment |
|
| nodeSelector | object | `{}` | Node labels for pod assignment |
|
||||||
| podAnnotations | object | `{}` | Annotations for pods |
|
| podAnnotations | object | `{}` | Annotations for pods |
|
||||||
| podSecurityContext | object | `{}` | Set securityContext for pod itself |
|
| podSecurityContext | object | `{}` | Set securityContext for pod itself |
|
||||||
|
| probes.livenessProbe.exec.command[0] | string | `"/bin/sh"` | |
|
||||||
|
| probes.livenessProbe.exec.command[1] | string | `"/usr/local/bin/healthcheck.sh"` | |
|
||||||
|
| probes.livenessProbe.failureThreshold | int | `3` | |
|
||||||
|
| probes.livenessProbe.initialDelaySeconds | int | `10` | |
|
||||||
|
| probes.livenessProbe.periodSeconds | int | `10` | |
|
||||||
|
| probes.livenessProbe.successThreshold | int | `1` | |
|
||||||
|
| probes.livenessProbe.timeoutSeconds | int | `5` | |
|
||||||
|
| probes.readinessProbe.exec.command[0] | string | `"/bin/sh"` | |
|
||||||
|
| probes.readinessProbe.exec.command[1] | string | `"/usr/local/bin/healthcheck.sh"` | |
|
||||||
|
| probes.readinessProbe.failureThreshold | int | `3` | |
|
||||||
|
| probes.readinessProbe.initialDelaySeconds | int | `10` | |
|
||||||
|
| probes.readinessProbe.periodSeconds | int | `10` | |
|
||||||
|
| probes.readinessProbe.successThreshold | int | `1` | |
|
||||||
|
| probes.readinessProbe.timeoutSeconds | int | `5` | |
|
||||||
| prometheusRule.enabled | bool | `false` | Deploy a PrometheusRule |
|
| prometheusRule.enabled | bool | `false` | Deploy a PrometheusRule |
|
||||||
| prometheusRule.spec | list | `[]` | PrometheusRule.Spec https://awesome-prometheus-alerts.grep.to/rules |
|
| prometheusRule.spec | list | `[]` | PrometheusRule.Spec https://awesome-prometheus-alerts.grep.to/rules |
|
||||||
| replicaCount | int | `1` | Number of replicas to deploy |
|
| replicaCount | int | `1` | Number of replicas to deploy |
|
||||||
| resources.limits | object | `{}` | The resource limits for the containers |
|
| resources.limits | object | `{}` | The resource limits for the containers |
|
||||||
| resources.requests | object | `{}` | The requested resources for the containers |
|
| resources.requests | object | `{}` | The requested resources for the containers |
|
||||||
| securityContext | object | `{}` | Set securityContext for containers |
|
| securityContext | object | `{}` | Set securityContext for containers |
|
||||||
|
| service.annotations | object | `{}` | Extra annotations for the service |
|
||||||
|
| service.lablels | object | `{}` | Extra labels for the service |
|
||||||
| service.metrics.portName | string | `"metrics"` | name for the metrics port |
|
| service.metrics.portName | string | `"metrics"` | name for the metrics port |
|
||||||
| service.metrics.serviceType | string | `"ClusterIP"` | serviceType for the metrics service |
|
| service.metrics.serviceType | string | `"ClusterIP"` | serviceType for the metrics service |
|
||||||
| service.port | int | `6379` | Dragonfly service port |
|
| service.port | int | `6379` | Dragonfly service port |
|
||||||
|
@ -36,6 +64,7 @@ Dragonfly is a modern in-memory datastore, fully compatible with Redis and Memca
|
||||||
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
|
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
|
||||||
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
|
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
|
||||||
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
|
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
|
||||||
|
| serviceMonitor.annotations | object | `{}` | additional annotations to apply to the metrics |
|
||||||
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator |
|
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator |
|
||||||
| serviceMonitor.interval | string | `"10s"` | scrape interval |
|
| serviceMonitor.interval | string | `"10s"` | scrape interval |
|
||||||
| serviceMonitor.labels | object | `{}` | additional labels to apply to the metrics |
|
| serviceMonitor.labels | object | `{}` | additional labels to apply to the metrics |
|
||||||
|
@ -51,4 +80,4 @@ Dragonfly is a modern in-memory datastore, fully compatible with Redis and Memca
|
||||||
| tolerations | list | `[]` | Tolerations for pod assignment |
|
| tolerations | list | `[]` | Tolerations for pod assignment |
|
||||||
|
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0)
|
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
|
||||||
|
|
12
contrib/charts/dragonfly/ci/affinity-values.yaml
Normal file
12
contrib/charts/dragonfly/ci/affinity-values.yaml
Normal file
|
@ -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
|
|
@ -0,0 +1,6 @@
|
||||||
|
command:
|
||||||
|
- /usr/local/bin/dragonfly
|
||||||
|
- --logtostderr
|
||||||
|
|
||||||
|
extraArgs:
|
||||||
|
- --cache_mode=true
|
|
@ -0,0 +1,5 @@
|
||||||
|
extraContainers:
|
||||||
|
- name: sidecar-string
|
||||||
|
image: busybox:latest
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "date; sleep 3600;"]
|
|
@ -0,0 +1,5 @@
|
||||||
|
extraContainers: |
|
||||||
|
- name: sidecar-tpl
|
||||||
|
image: {{ .Values.image.repository }}:latest
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "date; sleep 3600;"]
|
8
contrib/charts/dragonfly/ci/extravolumes-values.yaml
Normal file
8
contrib/charts/dragonfly/ci/extravolumes-values.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
extraVolumes:
|
||||||
|
- name: tmp
|
||||||
|
emptyDir:
|
||||||
|
sizeLimit: 500Mi
|
||||||
|
|
||||||
|
extraVolumeMounts:
|
||||||
|
- mountPath: /tmp
|
||||||
|
name: tmp
|
|
@ -0,0 +1,5 @@
|
||||||
|
initContainers:
|
||||||
|
- name: initcontainer-string
|
||||||
|
image: busybox:1.28
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "date; sleep 1;"]
|
|
@ -0,0 +1,5 @@
|
||||||
|
initContainers: |
|
||||||
|
- name: initcontainer-tpl
|
||||||
|
image: {{ .Values.image.repository }}:latest
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "date; sleep 1;"]
|
3
contrib/charts/dragonfly/ci/persistent-values.yaml
Normal file
3
contrib/charts/dragonfly/ci/persistent-values.yaml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
storage:
|
||||||
|
enabled: true
|
||||||
|
requests: 128Mi
|
7
contrib/charts/dragonfly/ci/resources-values.yaml
Normal file
7
contrib/charts/dragonfly/ci/resources-values.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
5
contrib/charts/dragonfly/ci/securitycontext-values.yaml
Normal file
5
contrib/charts/dragonfly/ci/securitycontext-values.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
podSecurityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: true
|
24
contrib/charts/dragonfly/ci/tls-values.yaml
Normal file
24
contrib/charts/dragonfly/ci/tls-values.yaml
Normal file
|
@ -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-----
|
3
contrib/charts/dragonfly/ci/tolerations-values.yaml
Normal file
3
contrib/charts/dragonfly/ci/tolerations-values.yaml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
tolerations:
|
||||||
|
- effect: NoSchedule
|
||||||
|
operator: Exists
|
110
contrib/charts/dragonfly/templates/_pod.tpl
Normal file
110
contrib/charts/dragonfly/templates/_pod.tpl
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
{{- 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:
|
||||||
|
{{- if eq (typeOf .) "string" }}
|
||||||
|
{{- tpl . $ | nindent 2 }}
|
||||||
|
{{- else }}
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- 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.extraContainers }}
|
||||||
|
{{- if eq (typeOf .) "string" }}
|
||||||
|
{{- tpl . $ | nindent 2 }}
|
||||||
|
{{- else }}
|
||||||
|
{{- toYaml . | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- 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 }}
|
|
@ -13,98 +13,14 @@ spec:
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
{{- if .Values.tls.enabled }}
|
{{- if and (.Values.tls.enabled) (not .Values.tls.existing_secret) }}
|
||||||
{{- if not .Values.tls.existing_secret }}
|
|
||||||
checksum/tls-secret: {{ include (print $.Template.BasePath "/tls-secret.yaml") . | sha256sum }}
|
checksum/tls-secret: {{ include (print $.Template.BasePath "/tls-secret.yaml") . | sha256sum }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- with .Values.podAnnotations }}
|
||||||
{{- with .Values.podAnnotations }}
|
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "dragonfly.selectorLabels" . | nindent 8 }}
|
{{- include "dragonfly.selectorLabels" . | nindent 8 }}
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- include "dragonfly.pod" . | nindent 6 }}
|
||||||
imagePullSecrets:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
serviceAccountName: {{ include "dragonfly.serviceAccountName" . }}
|
|
||||||
securityContext:
|
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
||||||
{{- if .Values.initContainers }}
|
|
||||||
initContainers: {{- toYaml .Values.initContainers | nindent 6 }}
|
|
||||||
{{- if .Values.resources }}
|
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.resources | nindent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.extraVolumeMounts }}
|
|
||||||
volumeMounts:
|
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- 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 }}
|
|
||||||
ports:
|
|
||||||
- name: dragonfly
|
|
||||||
containerPort: 6379
|
|
||||||
protocol: TCP
|
|
||||||
{{- with .Values.probes }}
|
|
||||||
{{- toYaml . | nindent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.command.cmd }}
|
|
||||||
command:
|
|
||||||
{{ toYaml .Values.command.cmd | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
args:
|
|
||||||
- "--alsologtostderr"
|
|
||||||
{{- if .Values.extraArgs }}
|
|
||||||
{{- toYaml .Values.extraArgs | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.tls.enabled }}
|
|
||||||
- "--tls"
|
|
||||||
- "--tls_cert_file=/etc/dragonfly/tls/tls.crt"
|
|
||||||
- "--tls_key_file=/etc/dragonfly/tls/tls.key"
|
|
||||||
{{- end }}
|
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
|
||||||
volumeMounts:
|
|
||||||
{{- if .Values.tls.enabled }}
|
|
||||||
- mountPath: /etc/dragonfly/tls
|
|
||||||
name: tls
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.extraVolumeMounts }}
|
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.nodeSelector }}
|
|
||||||
nodeSelector:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
volumes:
|
|
||||||
{{- if .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 }}
|
|
||||||
{{- if .Values.extraVolumes }}
|
|
||||||
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
4
contrib/charts/dragonfly/templates/extra-manifests.yaml
Normal file
4
contrib/charts/dragonfly/templates/extra-manifests.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{{ range .Values.extraObjects }}
|
||||||
|
---
|
||||||
|
{{ tpl (toYaml .) $ }}
|
||||||
|
{{ end }}
|
|
@ -5,16 +5,10 @@ metadata:
|
||||||
name: {{ template "dragonfly.fullname" . }}-metrics
|
name: {{ template "dragonfly.fullname" . }}-metrics
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
labels:
|
labels:
|
||||||
chart: {{ template "dragonfly.chart" . }}
|
{{- include "dragonfly.labels" . | nindent 4 }}
|
||||||
app: {{ template "dragonfly.name" . }}
|
|
||||||
release: "{{ .Release.Name }}"
|
|
||||||
heritage: "{{ .Release.Service }}"
|
|
||||||
{{- if .Values.serviceMonitor.labels }}
|
|
||||||
{{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
spec:
|
||||||
groups:
|
groups:
|
||||||
- name: {{ template "dragonfly.name" . }}
|
- name: {{ template "dragonfly.name" . }}
|
||||||
rules:
|
rules:
|
||||||
{{- toYaml .Values.prometheusRule.spec | nindent 4 }}
|
{{- toYaml .Values.prometheusRule.spec | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -2,7 +2,14 @@ apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dragonfly.fullname" . }}
|
name: {{ include "dragonfly.fullname" . }}
|
||||||
|
{{- with .Values.service.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
|
{{- with .Values.service.labels }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
{{- include "dragonfly.labels" . | nindent 4 }}
|
{{- include "dragonfly.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.type }}
|
type: {{ .Values.service.type }}
|
||||||
|
|
|
@ -3,10 +3,10 @@ apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "dragonfly.serviceAccountName" . }}
|
name: {{ include "dragonfly.serviceAccountName" . }}
|
||||||
labels:
|
|
||||||
{{- include "dragonfly.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.serviceAccount.annotations }}
|
{{- with .Values.serviceAccount.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "dragonfly.labels" . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -3,29 +3,30 @@ apiVersion: monitoring.coreos.com/v1
|
||||||
kind: ServiceMonitor
|
kind: ServiceMonitor
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ template "dragonfly.fullname" . }}-metrics
|
name: {{ template "dragonfly.fullname" . }}-metrics
|
||||||
{{- if .Values.serviceMonitor.namespace }}
|
{{- with .Values.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.serviceMonitor.namespace }}
|
namespace: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.serviceMonitor.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
chart: {{ template "dragonfly.chart" . }}
|
{{- with .Values.serviceMonitor.labels }}
|
||||||
app: {{ template "dragonfly.name" . }}
|
{{- toYaml . | nindent 4 }}
|
||||||
release: "{{ .Release.Name }}"
|
|
||||||
heritage: "{{ .Release.Service }}"
|
|
||||||
{{- if .Values.serviceMonitor.labels }}
|
|
||||||
{{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- include "dragonfly.labels" . | nindent 4 }}
|
||||||
spec:
|
spec:
|
||||||
endpoints:
|
endpoints:
|
||||||
- interval: {{ .Values.serviceMonitor.interval }}
|
- interval: {{ .Values.serviceMonitor.interval }}
|
||||||
{{- if .Values.serviceMonitor.scrapeTimeout }}
|
{{- with .Values.serviceMonitor.scrapeTimeout }}
|
||||||
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
|
scrapeTimeout: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
honorLabels: true
|
honorLabels: true
|
||||||
port: {{ default "metrics" .Values.service.metrics.portName }}
|
port: {{ default "metrics" .Values.service.metrics.portName }}
|
||||||
path: /metrics
|
path: /metrics
|
||||||
{{- if .Values.tls.enabled }}
|
{{- if .Values.tls.enabled }}
|
||||||
scheme: https
|
scheme: https
|
||||||
tls:
|
tlsConfig:
|
||||||
insecureSkipVerify: true
|
insecureSkipVerify: true
|
||||||
{{- else }}
|
{{- else }}
|
||||||
scheme: http
|
scheme: http
|
||||||
|
|
|
@ -14,103 +14,16 @@ spec:
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
{{- if .Values.tls.enabled }}
|
{{- if and (.Values.tls.enabled) (not .Values.tls.existing_secret) }}
|
||||||
{{- if not .Values.tls.existing_secret }}
|
|
||||||
checksum/tls-secret: {{ include (print $.Template.BasePath "/tls-secret.yaml") . | sha256sum }}
|
checksum/tls-secret: {{ include (print $.Template.BasePath "/tls-secret.yaml") . | sha256sum }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- with .Values.podAnnotations }}
|
||||||
{{- with .Values.podAnnotations }}
|
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "dragonfly.selectorLabels" . | nindent 8 }}
|
{{- include "dragonfly.selectorLabels" . | nindent 8 }}
|
||||||
spec:
|
spec:
|
||||||
{{- with .Values.imagePullSecrets }}
|
{{- include "dragonfly.pod" . | nindent 6 }}
|
||||||
imagePullSecrets:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
serviceAccountName: {{ include "dragonfly.serviceAccountName" . }}
|
|
||||||
securityContext:
|
|
||||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
||||||
{{- if .Values.initContainers }}
|
|
||||||
initContainers: {{- toYaml .Values.initContainers | nindent 6 }}
|
|
||||||
{{- if .Values.resources }}
|
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.resources | nindent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /data
|
|
||||||
name: "{{ .Release.Name }}-data"
|
|
||||||
{{- if .Values.extraVolumeMounts }}
|
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- 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 }}
|
|
||||||
ports:
|
|
||||||
- name: dragonfly
|
|
||||||
containerPort: 6379
|
|
||||||
protocol: TCP
|
|
||||||
{{- with .Values.probes }}
|
|
||||||
{{- toYaml . | nindent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.command.cmd }}
|
|
||||||
command:
|
|
||||||
{{ toYaml .Values.command.cmd | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
args:
|
|
||||||
- "--alsologtostderr"
|
|
||||||
{{- if .Values.extraArgs }}
|
|
||||||
{{- toYaml .Values.extraArgs | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.tls.enabled }}
|
|
||||||
- "--tls"
|
|
||||||
- "--tls_cert_file=/etc/dragonfly/tls/tls.crt"
|
|
||||||
- "--tls_key_file=/etc/dragonfly/tls/tls.key"
|
|
||||||
{{- end }}
|
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /data
|
|
||||||
name: "{{ .Release.Name }}-data"
|
|
||||||
{{- if .Values.tls.enabled }}
|
|
||||||
- mountPath: /etc/dragonfly/tls
|
|
||||||
name: tls
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.extraVolumeMounts }}
|
|
||||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.nodeSelector }}
|
|
||||||
nodeSelector:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
volumes:
|
|
||||||
{{- if .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 }}
|
|
||||||
{{- if .Values.extraVolumes }}
|
|
||||||
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
volumeClaimTemplates:
|
volumeClaimTemplates:
|
||||||
- metadata:
|
- metadata:
|
||||||
name: "{{ .Release.Name }}-data"
|
name: "{{ .Release.Name }}-data"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{{- if and .Values.tls.enabled .Values.tls.cert .Values.tls.key }}
|
{{- if and (.Values.tls.enabled) (.Values.tls.cert) (.Values.tls.key) (not .Values.tls.existing_secret) }}
|
||||||
{{- if not .Values.tls.existing_secret }}
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -11,4 +10,3 @@ data:
|
||||||
tls.crt: {{ default "" .Values.tls.cert | b64enc | quote }}
|
tls.crt: {{ default "" .Values.tls.cert | b64enc | quote }}
|
||||||
tls.key: {{ default "" .Values.tls.key | b64enc | quote }}
|
tls.key: {{ default "" .Values.tls.key | b64enc | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
|
||||||
|
|
|
@ -52,6 +52,10 @@ service:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
# -- Dragonfly service port
|
# -- Dragonfly service port
|
||||||
port: 6379
|
port: 6379
|
||||||
|
# -- Extra annotations for the service
|
||||||
|
annotations: {}
|
||||||
|
# -- Extra labels for the service
|
||||||
|
lablels: {}
|
||||||
metrics:
|
metrics:
|
||||||
# -- name for the metrics port
|
# -- name for the metrics port
|
||||||
portName: metrics
|
portName: metrics
|
||||||
|
@ -65,6 +69,8 @@ serviceMonitor:
|
||||||
namespace: ""
|
namespace: ""
|
||||||
# -- additional labels to apply to the metrics
|
# -- additional labels to apply to the metrics
|
||||||
labels: {}
|
labels: {}
|
||||||
|
# -- additional annotations to apply to the metrics
|
||||||
|
annotations: {}
|
||||||
# -- scrape interval
|
# -- scrape interval
|
||||||
interval: 10s
|
interval: 10s
|
||||||
# -- scrape timeout
|
# -- scrape timeout
|
||||||
|
@ -130,9 +136,8 @@ probes:
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
|
||||||
command:
|
# -- Allow overriding the container's command
|
||||||
# -- Allow overriding the container's command
|
command: []
|
||||||
set: []
|
|
||||||
|
|
||||||
# -- Extra arguments to pass to the dragonfly binary
|
# -- Extra arguments to pass to the dragonfly binary
|
||||||
extraArgs: []
|
extraArgs: []
|
||||||
|
@ -146,6 +151,12 @@ extraVolumeMounts: []
|
||||||
# -- A list of initContainers to run before each pod starts
|
# -- A list of initContainers to run before each pod starts
|
||||||
initContainers: []
|
initContainers: []
|
||||||
|
|
||||||
|
# -- Additional sidecar containers
|
||||||
|
extraContainers: []
|
||||||
|
|
||||||
|
# -- extra K8s manifests to deploy
|
||||||
|
extraObjects: []
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
# -- The requested resources for the containers
|
# -- The requested resources for the containers
|
||||||
requests: {}
|
requests: {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue