forked from FoundationDB/fdb-kubernetes-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster_with_backup.yaml
136 lines (136 loc) · 3.9 KB
/
cluster_with_backup.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# This file provides an example of a cluster with backup agents running
# alongside the cluster.
#
# Once the cluster and the backup agents are up, you can start a backup by
# opening a shell in one of the backup_agent pods and running the
# fdbbackup commands command. Examples:
#
# # Start a Backup:
# kubectl exec deployment/sample-cluster-backup-agents -- fdbbackup start -d "blobstore://minio@minio-service:9000/sample-cluster-test-backup?sc=0&bucket=fdb-backups" -z
# # Check Status
# kubectl exec deployment/sample-cluster-backup-agents -- fdbbackup status
#
# This example uses configuration for a local MinIO instance, which is set up as
# part of the local testing environment for the operator. This instance has
# TLS disabled, and credentials that are hardcoded in the YAML. This
# configuration is for testing purposes only. You will need to determine the
# appropriate way of managing TLS and credentials for your real environment and
# endpoints, as well as the appropriate backup solution to use. We use MinIO in
# our local tests due to its lightweight setup, but you can backup to any
# S3-compatible object storage service.
#
# If you are testing this in Docker Desktop, you can browse the local MinIO
# instance at http://localhost:9000.
apiVersion: apps.foundationdb.org/v1beta1
kind: FoundationDBCluster
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: sample-cluster
spec:
version: 6.2.15
persistentVolumeClaim:
spec:
resources:
requests:
storage: "16G"
faultDomain:
key: foundationdb.org/none
processCounts:
stateless: -1
customParameters:
- "knob_disable_posix_kernel_aio=1"
podTemplate:
spec:
securityContext:
fsGroup: 0
containers:
- name: foundationdb
securityContext:
runAsUser: 0
resources:
requests:
cpu: 250m
memory: 128Mi
- name: foundationdb-kubernetes-sidecar
securityContext:
runAsUser: 0
initContainers:
- name: foundationdb-kubernetes-init
securityContext:
runAsUser: 0
---
apiVersion: v1
kind: Secret
metadata:
name: sample-cluster-backup-secrets
type: Opaque
stringData:
credentials: |
{
"accounts": {
"minio@minio-service": {
"secret" : "minio123"
}
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-cluster-backup-agents
spec:
replicas: 2
selector:
matchLabels:
app: sample-cluster-backup-agents
template:
metadata:
labels:
app: sample-cluster-backup-agents
name: sample-cluster-backup-agents
spec:
automountServiceAccountToken: false
containers:
- name: foundationdb
image: foundationdb/foundationdb:6.2.11
args:
- --log
- --logdir
- /var/log/fdb-trace-logs
command:
- backup_agent
env:
- name: FDB_CLUSTER_FILE
value: /var/dynamic-conf/fdb.cluster
- name: FDB_BLOB_CREDENTIALS
value: /var/secrets/credentials
resources:
limits:
cpu: 250m
memory: 128Mi
requests:
cpu: 250m
memory: 128Mi
securityContext:
runAsGroup: 0
runAsUser: 0
volumeMounts:
- name: logs
mountPath: /var/log/fdb-trace-logs
- name: dynamic-conf
mountPath: /var/dynamic-conf
- name: secrets
mountPath: /var/secrets
volumes:
- name: secrets
secret:
secretName: sample-cluster-backup-secrets
- name: dynamic-conf
configMap:
name: sample-cluster-config
items:
- key: cluster-file
path: fdb.cluster
- name: logs
emptyDir: {}