Skip to content

Commit

Permalink
Merge branch 'master' into zk-kubestash
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudro-25 authored Sep 24, 2024
2 parents a1d711c + 6272f9b commit 3f95ed7
Show file tree
Hide file tree
Showing 151 changed files with 11,286 additions and 315 deletions.
17 changes: 17 additions & 0 deletions docs/examples/rabbitmq/cluster/rabbit-custom-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: RabbitMQ
metadata:
name: rm-cluster
namespace: demo
spec:
version: "3.13.2"
storageType: Durable
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
configSecret:
name: rabbit-custom-config
17 changes: 17 additions & 0 deletions docs/examples/rabbitmq/cluster/rabbitmq-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: RabbitMQ
metadata:
name: rabbitmq
namespace: demo
spec:
version: "3.13.2"
replicas: 3
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
storageType: Durable
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: RabbitMQOpsRequest
metadata:
name: reconfigure-rm-cluster
namespace: demo
spec:
type: Reconfigure
databaseRef:
name: rm-cluster
configuration:
configSecret:
name: new-custom-config
timeout: 5m
apply: IfReady
15 changes: 15 additions & 0 deletions docs/examples/rabbitmq/opsrequests/rabbitmq-reconfigure-apply.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: RabbitMQOpsRequest
metadata:
name: reconfigure-apply
namespace: demo
spec:
type: Reconfigure
databaseRef:
name: rm-cluster
configuration:
applyConfig:
rabbitmq.conf: |
default_vhost = /newvhost
timeout: 5m
apply: IfReady
2 changes: 1 addition & 1 deletion docs/examples/rabbitmq/quickstart/quickstart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: rm-quickstart
namespace: demo
spec:
version: "3.12.12"
version: "3.13.2"
replicas: 3
storage:
accessModes:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/mongodb/arbiter/sharding.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Here,
- `configSecret` is an optional field to provide custom configuration file for mongos (i.e mongod.cnf). If specified, this file will be used as configuration file otherwise a default configuration file will be used.
- `podTemplate` is an optional configuration for pods.
- `spec.keyFileSecret` (optional) is a secret name that contains keyfile (a random string)against `key.txt` key. Each mongod instances in the replica set and `shardTopology` uses the contents of the keyfile as the shared password for authenticating other members in the replicaset. Only mongod instances with the correct keyfile can join the replica set. _User can provide the `keyFileSecret` by creating a secret with key `key.txt`. See [here](https://docs.mongodb.com/manual/tutorial/enforce-keyfile-access-control-in-existing-replica-set/#create-a-keyfile) to create the string for `keyFileSecret`._ If `keyFileSecret` is not given, KubeDB operator will generate a `keyFileSecret` itself.
- `spec.arbiter` denotes arbiter spec of the deployed MongoDB CRD. There are two fields under it : configSecret & podTemplate. `spec.arbiter.configSecret` is an optional field to provide custom configuration file for database (i.e mongod.cnf). If specified, this file will be used as configuration file otherwise default configuration file will be used. `spec.arbiter.podTemplate` holds the arbiter-podSpec. `null` value of it, instructs kubedb operator to use the default arbiter podTemplate.
- `spec.arbiter` denotes arbiter spec of the deployed MongoDB CRD. There are two fields under it : configSecret & podTemplate. `spec.arbiter.configSecret` is an optional field to provide custom configuration file for database (i.e mongod.cnf). If specified, this file will be used as configuration file otherwise default configuration file will be used. `spec.arbiter.podTemplate` holds the arbiter-podSpec. `null` value of it, instructs kubedb operator to use the default arbiter podTemplate.

KubeDB operator watches for `MongoDB` objects using Kubernetes api. When a `MongoDB` object is created, KubeDB operator will create some new PetSets : 1 for mongos, 1 for configServer, and 1 for each of the shard & arbiter. It creates a primary Service with the matching MongoDB object name. KubeDB operator will also create governing services for PetSets with the name `<mongodb-name>-<node-type>-pods`.

Expand Down Expand Up @@ -957,7 +957,7 @@ From the above output, you can see that MongoDB object, PVCs, Secret are still t
## Resume Halted Database
Now, to resume the database, i.e. to get the same database setup back again, you have to set the the `spec.halted` as false. You can use the below command.
Now, to resume the database, i.e. to get the same database setup back again, you have to set the `spec.halted` as false. You can use the below command.
```bash
$ kubectl patch -n demo mg/mongo-sh-arb -p '{"spec":{"halted":false}}' --type="merge"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: core.kubestash.com/v1alpha1
kind: BackupConfiguration
metadata:
name: sample-mongodb-backup
namespace: demo
spec:
target:
apiGroup: kubedb.com
kind: MongoDB
namespace: demo
name: sample-mongodb
backends:
- name: s3-backend
storageRef:
namespace: demo
name: s3-storage
retentionPolicy:
name: backup-rp
namespace: demo
sessions:
- name: frequent-backup
scheduler:
schedule: "*/5 * * * *"
jobTemplate:
backoffLimit: 1
repositories:
- name: s3-mongodb-repo
backend: s3-backend
directory: /mongodb
encryptionSecret:
name: encry-secret
namespace: demo
addon:
name: mongodb-addon
tasks:
- name: manifest-backup
- name: logical-backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: s3-storage
namespace: demo
spec:
storage:
provider: s3
s3:
endpoint: us-east-1.linodeobjects.com
bucket: kubestash-testing
region: us-east-1
prefix: demo-application-level
secretName: s3-secret
usagePolicy:
allowedNamespaces:
from: All
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: core.kubestash.com/v1alpha1
kind: RestoreSession
metadata:
name: restore-sample-mongodb
namespace: demo
spec:
manifestOptions:
restoreNamespace: dev
mongoDB:
db: true
dataSource:
repository: s3-mongodb-repo
snapshot: latest
encryptionSecret:
name: encry-secret
namespace: demo
addon:
name: mongodb-addon
tasks:
- name: logical-backup-restore
- name: manifest-restore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: storage.kubestash.com/v1alpha1
kind: RetentionPolicy
metadata:
name: backup-rp
namespace: demo
spec:
maxRetentionPeriod: 2mo
successfulSnapshots:
last: 10
usagePolicy:
allowedNamespaces:
from: All
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1
kind: MongoDB
metadata:
name: sample-mongodb
namespace: demo
spec:
version: "4.4.26"
replicaSet:
name: "replicaset"
replicas: 3
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Loading

0 comments on commit 3f95ed7

Please sign in to comment.