Skip to content

Commit 2658678

Browse files
committed
Persistence option for the helm chart
Per the official guidelines: https://github.com/kubernetes/charts/blob/master/CONTRIBUTING.md#technical-requirements https://github.com/kubernetes/charts/blob/master/REVIEW_GUIDELINES.md ... creating a volume is mandatory, and we should do it by default (but we still can disable this with "persistence.enabled=false"). While at it, update to the upcoming 0.6.0 release.
1 parent a7a6da8 commit 2658678

File tree

4 files changed

+77
-22
lines changed

4 files changed

+77
-22
lines changed

assets/helm-chart/katafygio/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
2-
appVersion: 0.5.0
2+
appVersion: 0.6.0
33
description: Continuously backup Kubernetes objets as YAML files in git
44
name: katafygio
55
home: https://github.com/bpineau/katafygio

assets/helm-chart/katafygio/templates/deployment.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ spec:
8181
tolerations:
8282
{{ toYaml . | indent 8 }}
8383
{{- end }}
84+
volumes:
85+
- name: katafygio-data
86+
{{- if .Values.persistence.enabled }}
87+
persistentVolumeClaim:
88+
claimName: {{ .Values.persistence.existingClaim | default (include "katafygio.fullname" .) }}
89+
{{- else }}
90+
emptyDir: {}
91+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
2+
kind: PersistentVolumeClaim
3+
apiVersion: v1
4+
metadata:
5+
name: {{ template "katafygio.fullname" . }}
6+
labels:
7+
{{ include "katafygio.labels.standard" . | indent 4 }}
8+
spec:
9+
accessModes:
10+
- {{ .Values.persistence.accessMode | quote }}
11+
resources:
12+
requests:
13+
storage: {{ .Values.persistence.size | quote }}
14+
{{- if .Values.persistence.storageClass }}
15+
{{- if (eq "-" .Values.persistence.storageClass) }}
16+
storageClassName: ""
17+
{{- else }}
18+
storageClassName: "{{ .Values.persistence.storageClass }}"
19+
{{- end }}
20+
{{- end }}
21+
{{- end }}

assets/helm-chart/katafygio/values.yaml

+47-21
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,69 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5-
# Where we'll dump and commit cluster objects before pushing them to a remote git repository.
6-
localDir: "/tmp/kf-dump"
5+
# gitUrl (optional) is a remote git repository that Katafygio can clone, and where
6+
# it can push changes. If gitUrl is not defined, Katafygio will still maintain a
7+
# pod-local git repository, which can be on a persistent volume (see above).
8+
#gitUrl: https://user:[email protected]/myorg/myrepos.git
79

8-
# The port we'll listen for health checks requests.
9-
healthcheckPort: 8080
10+
# noGit disable git versioning when true (will only keep an unversioned local dump up-to-date).
11+
noGit: false
1012

11-
# Frequency (in seconds) between full catch-up resyncs. 0 to disable.
12-
resyncInterval: 300
13+
# healthcheckPort is the TCP port Katafygio will listen for health check requests.
14+
healthcheckPort: 8080
1315

14-
# Logging. Output may be: stdout, stderr, syslog.
16+
# logLevel can be info, warning, error, or fatal.
1517
logLevel: warning
18+
# logOutput can be stdout, stderr, or syslog.
1619
logOutput: stdout
20+
# logServer (optional) provide the address of a remote syslog server.
21+
# logServer: "localhost:514"
1722

18-
# Optional. Repository where Katafygio would push changes.
19-
#gitUrl: https://user:[email protected]/myorg/myrepos.git
20-
21-
# Set to true to disable git versioning.
22-
noGit: false
23-
24-
# Optional. Label selector to restrict dump to certain objets.
23+
# filter is an (optional) label selector used to restrict backups to selected objects.
2524
#filter: "app in (foo, bar)"
2625

27-
# Optional. Address of a remote syslog server (if logOutput is "syslog").
28-
# logServer: "localhost:514"
29-
30-
# Optional. Kubernetes object kinds we want to exclude from the dumps.
26+
# excludeKind is an array of excluded (not backuped) Kubernetes objects kinds.
3127
excludeKind:
3228
- replicaset
3329
- endpoints
3430
- event
3531

36-
# Optional. Specific Kubernetes objets to exclude from the dumps.
32+
# excludeObject is an array of specific Kubernetes objects to exclude from dumps
33+
# (the format is: objectkind:namespace/objectname).
3734
# excludeObject:
3835
# - "configmap:kube-system/leader-elector"
3936

40-
# Katafygio needs read-only access to all Kubernetes API groups and resources.
37+
# resyncInterval is the interval (in seconds) between full catch-up resyncs
38+
# (to catch possibly missed events). Set to 0 to disable resyncs.
39+
resyncInterval: 300
40+
41+
# localDir is the path where we'll dump and commit cluster objects.
42+
localDir: "/var/lib/katafygio/data"
43+
44+
# persistence for the localDir dump directory. Note that configuring gitUrl
45+
# is an other way to achieve persistence.
46+
persistence:
47+
enabled: true
48+
## If defined, storageClassName: <storageClass>
49+
## If set to "-", storageClassName: "", which disables dynamic provisioning
50+
## If undefined (the default) or set to null, no storageClassName spec is
51+
## set, choosing the default provisioner. (gp2 on AWS, standard on
52+
## GKE, AWS & OpenStack)
53+
##
54+
storageClass: ""
55+
accessMode: ReadWriteOnce
56+
size: 1Gi
57+
# existingClaim: ""
58+
59+
# rbac allow to enable or disable RBAC role and binding. Katafygio needs
60+
# read-only access to all Kubernetes API groups and resources.
4161
rbac:
4262
# Specifies whether RBAC resources should be created
4363
create: true
4464
apiVersion: v1
4565

66+
# serviceAccount is used to provide a dedicated serviceAccount when using RBAC
67+
# (or to fallback to the namespace's "default" SA if name is left empty).
4668
serviceAccount:
4769
# Specifies whether a ServiceAccount should be created
4870
create: true
@@ -52,9 +74,13 @@ serviceAccount:
5274

5375
image:
5476
repository: bpineau/katafygio
55-
tag: v0.5.0
77+
tag: v0.6.0
5678
pullPolicy: IfNotPresent
5779

80+
# resources define the deployment's cpu and memory resources.
81+
# Katafygio only needs about 50Mi of memory as a baseline, and more depending
82+
# on the cluster's content. For instance, on a 45 nodes cluster with about 2k
83+
# pods and 1k services, Katafygio use about 250Mi.
5884
resources: {}
5985
# limits:
6086
# cpu: 100m

0 commit comments

Comments
 (0)