Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Jun 26, 2024
1 parent e5580d5 commit 4b75bbf
Show file tree
Hide file tree
Showing 72 changed files with 355 additions and 321 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
replicas: 1
historicals:
replicas: 1
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
Expand All @@ -32,6 +33,7 @@ spec:
storageClassName: standard
middleManagers:
replicas: 1
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
Expand All @@ -41,8 +43,7 @@ spec:
storageClassName: standard
routers:
replicas: 1
storageType: Durable
terminationPolicy: Delete
deletionPolicy: Delete
serviceTemplates:
- alias: primary
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
storage: 1Gi
init:
script:
configMap:
Expand Down
4 changes: 2 additions & 2 deletions content/docs/v2024.6.4/examples/druid/quickstart/zk-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ spec:
storage:
resources:
requests:
storage: "100Mi"
storage: 1Gi
storageClassName: "standard"
accessModes:
- ReadWriteOnce
terminationPolicy: "WipeOut"
deletionPolicy: "WipeOut"
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ spec:
name: ha-postgres
namespace: demo
pgPort: 5432
terminationPolicy: WipeOut
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ spec:
storage: 500Mi
backend:
externallyManaged: false
terminationPolicy: WipeOut
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
storage: 1Gi
storageClassName: standard
storageType: Durable
terminationPolicy: DoNotTerminate
deletionPolicy: DoNotTerminate
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
storage: 1Gi
storageClassName: standard
storageType: Durable
terminationPolicy: DoNotTerminate
deletionPolicy: DoNotTerminate
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ spec:
storage: 1Gi
storageClassName: standard
storageType: Durable
terminationPolicy: DoNotTerminate
deletionPolicy: DoNotTerminate
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ spec:
kafkaRef:
name: kafka-prod
namespace: demo
terminationPolicy: WipeOut
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ spec:
release: prometheus
interval: 10s
storageType: Durable
terminationPolicy: WipeOut
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ spec:
version: "2022-cu12"
replicas: 1
storageType: Durable
tls:
issuerRef:
name: mssqlserver-issuer
kind: Issuer
apiGroup: "cert-manager.io"
clientTLS: false
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
terminationPolicy: Delete
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ metadata:
spec:
version: "1.17.0"
replicas: 1
databases:
- alias: "postgres"
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
connectionPool:
port: 2580
reservePoolSize: 5
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ metadata:
spec:
version: "1.17.0"
replicas: 1
databases:
- alias: "postgres"
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
connectionPool:
maxClientConnections: 20
reservePoolSize: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ metadata:
spec:
version: "1.17.0"
replicas: 1
databases:
- alias: "postgres"
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
connectionPool:
maxClientConnections: 20
reservePoolSize: 5
Expand Down
17 changes: 6 additions & 11 deletions content/docs/v2024.6.4/examples/pgbouncer/pb-overview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ metadata:
spec:
version: "1.17.0"
replicas: 1
databases:
- alias: "postgres"
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
- alias: "mydb"
databaseName: "tmpdb"
databaseRef:
name: "quick-postgres"
namespace: demo
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
connectionPool:
maxClientConnections: 20
reservePoolSize: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
namespace: demo
spec:
version: "1.17.0"
databases:
- alias: "postgres"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ metadata:
spec:
version: "1.17.0"
replicas: 1
databases:
- alias: "postgres"
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
- alias: "tmpdb"
databaseName: "mydb"
databaseRef:
name: "quick-postgres"
namespace: demo
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
namespace: demo
connectionPool:
maxClientConnections: 20
reservePoolSize: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
spec:
version: "1.18.0"
replicas: 1
databases:
- alias: "postgres"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "quick-postgres"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ spec:
sslMode: disable
clientAuthMode: md5
syncUsers: true
terminationPolicy: WipeOut
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
storage: 1Gi
storageClassName: standard
storageType: Durable
terminationPolicy: WipeOut # DoNotTerminate(blocks deletion), Halt( retains pvc,secret), Delete (retains secret)
deletionPolicy: WipeOut # DoNotTerminate(blocks deletion), Halt( retains pvc,secret), Delete (retains secret)
podTemplate:
spec:
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ spec:
licenseSecret:
name: license-secret
storageType: Durable
terminationPolicy: WipeOut
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
terminationPolicy: "WipeOut"
deletionPolicy: "WipeOut"
20 changes: 13 additions & 7 deletions content/docs/v2024.6.4/guides/druid/quickstart/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,18 @@ Another external dependency of Druid is deep storage where the segments are stor
In this tutorial, we will run a `minio-server` as deep storage in our local `kind` cluster using `minio-operator` and create a bucket named `druid` in it, which the deployed druid database will use.

```bash

$ helm repo add minio https://operator.min.io/
$ helm repo update minio
$ helm upgrade --install --namespace "minio-operator" --create-namespace "minio-operator" minio/operator --set operator.replicaCount=1

$ helm upgrade --install --namespace "demo" --create-namespace druid-minio minio/tenant \
--set tenant.pools[0].servers=1 \
--set tenant.pools[0].volumesPerServer=1 \
--set tenant.pools[0].size=1Gi \
--set tenant.certificate.requestAutoCert=false \
--set tenant.buckets[0].name="druid"
--set tenant.buckets[0].name="druid" \
--set tenant.pools[0].name="default"

```

Expand All @@ -144,6 +148,7 @@ stringData:
druid.s3.accessKey: "minio"
druid.s3.secretKey: "minio123"
druid.s3.protocol: "http"
druid.s3.enablePathStyleAccess: "true"
druid.s3.endpoint.signingRegion: "us-east-1"
druid.s3.endpoint.url: "http://myminio-hl.demo.svc.cluster.local:9000/"
```
Expand Down Expand Up @@ -189,6 +194,7 @@ spec:
replicas: 1
historicals:
replicas: 1
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
Expand All @@ -198,6 +204,7 @@ spec:
storageClassName: standard
middleManagers:
replicas: 1
storageType: Durable
storage:
accessModes:
- ReadWriteOnce
Expand All @@ -207,8 +214,7 @@ spec:
storageClassName: standard
routers:
replicas: 1
storageType: Durable
terminationPolicy: Delete
deletionPolicy: Delete
serviceTemplates:
- alias: primary
spec:
Expand All @@ -223,7 +229,7 @@ Here,
- `spec.version` - is the name of the DruidVersion CR. Here, a Druid of version `28.0.1` will be created.
- `spec.storageType` - specifies the type of storage that will be used for Kafka. It can be `Durable` or `Ephemeral`. The default value of this field is `Durable`. If `Ephemeral` is used then KubeDB will create the Druid using `EmptyDir` volume. In this case, you don't have to specify `spec.storage` field. This is useful for testing purposes.
- `spec.storage` specifies the StorageClass of PVC dynamically allocated to store data for this Druid instance. This storage spec will be passed to the PetSet created by the KubeDB operator to run Druid pods. You can specify any StorageClass available in your cluster with appropriate resource requests. If you don't specify `spec.storageType: Ephemeral`, then this field is required.
- `spec.terminationPolicy` specifies what KubeDB should do when a user try to delete Druid CR. Termination policy `Delete` will delete the database pods and PVC when the Druid CR is deleted.
- `spec.deletionPolicy` specifies what KubeDB should do when a user try to delete Druid CR. Deletion policy `Delete` will delete the database pods and PVC when the Druid CR is deleted.

> Note: `spec.storage` section is used to create PVC for database pod. It will create PVC with storage size specified in the `storage.resources.requests` field. Don't specify `limits` here. PVC does not get resized automatically.

Expand Down Expand Up @@ -378,7 +384,7 @@ Spec:
Metadata:
Spec:
Storage Type: Ephemeral
Termination Policy: Delete
Deletion Policy: Delete
Topology:
Brokers:
Pod Placement Policy:
Expand Down Expand Up @@ -755,7 +761,7 @@ You can use this web console for loading data, managing datasources and tasks, a
To clean up the Kubernetes resources created by this tutorial, run:

```bash
$ kubectl patch -n demo druid druid-quickstart -p '{"spec":{"terminationPolicy":"WipeOut"}}' --type="merge"
$ kubectl patch -n demo druid druid-quickstart -p '{"spec":{"deletionPolicy":"WipeOut"}}' --type="merge"
kafka.kubedb.com/druid-quickstart patched
$ kubectl delete dr druid-quickstart -n demo
Expand All @@ -770,7 +776,7 @@ namespace "demo" deleted
If you are just testing some basic functionalities, you might want to avoid additional hassles due to some safety features that are great for the production environment. You can follow these tips to avoid them.

1. **Use `storageType: Ephemeral`**. Databases are precious. You might not want to lose your data in your production environment if the database pod fails. So, we recommend to use `spec.storageType: Durable` and provide storage spec in `spec.storage` section. For testing purposes, you can just use `spec.storageType: Ephemeral`. KubeDB will use [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) for storage. You will not require to provide `spec.storage` section.
2. **Use `terminationPolicy: WipeOut`**. It is nice to be able to resume the database from the previous one. So, we preserve all your `PVCs` and auth `Secrets`. If you don't want to resume the database, you can just use `spec.terminationPolicy: WipeOut`. It will clean up every resource that was created with the Druid CR. For more details, please visit [here](/docs/v2024.6.4/guides/kafka/concepts/kafka#specterminationpolicy).
2. **Use `deletionPolicy: WipeOut`**. It is nice to be able to resume the database from the previous one. So, we preserve all your `PVCs` and auth `Secrets`. If you don't want to resume the database, you can just use `spec.deletionPolicy: WipeOut`. It will clean up every resource that was created with the Druid CR. For more details, please visit [here](/docs/v2024.6.4/guides/kafka/concepts/kafka#specdeletionPolicy).

## Next Steps

Expand Down
Loading

0 comments on commit 4b75bbf

Please sign in to comment.