Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Beck <[email protected]>
  • Loading branch information
Kidswiss committed May 13, 2024
1 parent 2666a12 commit 444a47a
Show file tree
Hide file tree
Showing 3 changed files with 226 additions and 1 deletion.
61 changes: 60 additions & 1 deletion docs/modules/ROOT/pages/how-tos/backup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,63 @@ spec:
secret:
secretName: client-tls
defaultMode: 420
----
----

== Customize Pod Spec
You can override most of the fields in the podSpec for the backup jobs.

These are the fields you can't override:

* image
* command
* container name
* args

The podSpec has to be created via a separate object of the type `PodConfig`.
Any annotations and labels set on the `PodConfig` will also be applied to the pod.
Any fields on the `PodConfig` object has precedence over settings specified in the job.
For example, if the job has `podSecurityContext` set and the `PodConfig` has it set as well, then the setting from the `PodConfig` will override the setting in the job definition.

[source,yaml]
----
apiVersion: k8up.io/v1
kind: PodConfig
metadata:
name: podconfig
namespace: prod
annotations:
test: test
spec:
template:
spec:
containers:
- env:
- name: FOO
value: bar
securityContext:
allowPrivilegeEscalation: true
---
apiVersion: k8up.io/v1
kind: Backup
metadata:
name: k8up-backup
namespace: prod
spec:
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 1
backend:
repoPasswordSecretRef:
name: backup-repo
key: password
s3:
endpoint: http://minio.minio-e2e.svc.cluster.local:9000
bucket: backup
accessKeyIDSecretRef:
name: backup-credentials
key: username
secretAccessKeySecretRef:
name: backup-credentials
key: password
podConfig:
name: podconfig
----
41 changes: 41 additions & 0 deletions docs/modules/ROOT/pages/how-tos/schedules.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,44 @@ The file above will instruct the Operator to do backups every 5 minute, prune th
Feel free to adjust the frequencies to your liking. To help you with the crontab syntax, we recommend to check out https://crontab.guru[crontab.guru].

TIP: You can always check the state and configuration of your backup by using `kubectl describe schedule`. By default, all PVCs are backed up automatically. Adding the annotation `k8up.io/backup=false` to a PVC object will exclude it from all following backups. Alternatively, you can set the environment variable `BACKUP_SKIP_WITHOUT_ANNOTATION=true` if you want K8up to ignore objects without the annotation.

== Customize Pod Spec
Just like for each job type, it's possible to pass custom pod specs to a schedule.

You can either set a `PodConfig` for all jobs in a schedule at once, or for each job individually.
The `PodConfig` set in the job has precedence over the one in the schedule.

[source,yaml]
----
apiVersion: k8up.io/v1
kind: PodConfig
metadata:
name: podconfig
namespace: prod
annotations:
test: test
spec:
template:
spec:
containers:
- env:
- name: FOO
value: bar
securityContext:
allowPrivilegeEscalation: true
---
apiVersion: k8up.io/v1
kind: Schedule
metadata:
name: schedule-test
namespace: prod
spec:
podConfigRef:
name: podconfig
backend:
# Abridged for readability
backup:
# Abridged for readability
podConfig:
name: anotherPodConfig
----
Loading

0 comments on commit 444a47a

Please sign in to comment.