diff --git a/charts/blocky/Chart.yaml b/charts/blocky/Chart.yaml index 1541301c..1116f354 100644 --- a/charts/blocky/Chart.yaml +++ b/charts/blocky/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: v0.10 +appVersion: v0.11 description: DNS proxy as ad-blocker for local network name: blocky -version: 4.0.1 +version: 4.1.0 keywords: - blocky - dbs diff --git a/charts/blocky/templates/deployment.yaml b/charts/blocky/templates/deployment.yaml index 2c914906..3a34ae74 100644 --- a/charts/blocky/templates/deployment.yaml +++ b/charts/blocky/templates/deployment.yaml @@ -45,6 +45,13 @@ spec: subPath: {{ $name }} readOnly: true {{- end }} + {{- if .Values.config.queryLog }} + - name: data + mountPath: {{ .Values.config.queryLog.dir }} + {{- if .Values.persistence.subPath }} + subPath: {{ .Values.persistence.subPath }} + {{- end }} + {{- end }} ports: - name: api containerPort: 4000 @@ -89,6 +96,15 @@ spec: - key: {{ $name }} path: {{ $name }} {{- end }} + {{- if .Values.config.queryLog }} + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "blocky.fullname" . }}{{- end }} + {{- else }} + emptyDir: {} + {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/blocky/templates/persistentvolumeclaim.yaml b/charts/blocky/templates/persistentvolumeclaim.yaml new file mode 100644 index 00000000..b7dd55e7 --- /dev/null +++ b/charts/blocky/templates/persistentvolumeclaim.yaml @@ -0,0 +1,33 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "blocky.fullname" . }} + labels: + app.kubernetes.io/name: {{ include "blocky.name" . }} + helm.sh/chart: {{ include "blocky.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- with .Values.persistence.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.persistence.finalizers }} + finalizers: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + accessModes: + {{- toYaml .Values.persistence.accessModes | nindent 4 }} + {{- if .Values.persistence.storageClassName }} + storageClassName: {{ .Values.persistence.storageClassName }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- with .Values.persistence.selectorLabels }} + selector: + matchLabels: + {{- toYaml . | nindent 6 }} + {{- end }} +{{- end -}} diff --git a/charts/blocky/values.yaml b/charts/blocky/values.yaml index fdb5b635..8d1f0e71 100644 --- a/charts/blocky/values.yaml +++ b/charts/blocky/values.yaml @@ -2,7 +2,7 @@ replicaCount: 1 image: repository: spx01/blocky - tag: v0.10 + tag: v0.11 pullPolicy: IfNotPresent nameOverride: "" @@ -106,11 +106,33 @@ config: # url path, optional (default '/metrics') path: /metrics + # optional: write query information (question, answer, client, duration etc) to daily csv file + # queryLog: + # # directory (will be mounted as volume in the pod) + # dir: /logs + # # if true, write one file per client. Writes all queries to single file otherwise + # perClient: true + # # if > 0, deletes log files which are older than ... days + # logRetentionDays: 7 + # optional: HTTP listener port, default 0 = no http listener. If > 0, will be used for prometheus metrics, pprof, ... httpPort: 4000 # optional: Log level (one from debug, info, warn, error). Default: info logLevel: info +## Add persistence for query logs (if enabled) +persistence: + enabled: false + # storageClassName: default + accessModes: + - ReadWriteOnce + size: 10Gi + # annotations: {} + finalizers: + - kubernetes.io/pvc-protection + # selectorLabels: {} + # subPath: "" + # existingClaim: # Probes configuration probes: