Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: sayedppqq <[email protected]>
  • Loading branch information
sayedppqq committed Nov 28, 2024
1 parent 9473e28 commit c620f68
Show file tree
Hide file tree
Showing 40 changed files with 1,712 additions and 208 deletions.
2 changes: 1 addition & 1 deletion docs/examples/ferretdb/monitoring/builtin-prom-fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: builtin-prom-fr
namespace: demo
spec:
version: "1.18.0"
version: "1.23.0"
storage:
accessModes:
- ReadWriteOnce
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/ferretdb/reconfigure-tls/ferretdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: ferretdb
namespace: demo
spec:
version: "1.23.0"
version: "1.18.0"
storage:
accessModes:
- ReadWriteOnce
Expand Down
14 changes: 14 additions & 0 deletions docs/examples/ferretdb/reconfigure-tls/frops-change-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: FerretDBOpsRequest
metadata:
name: frops-change-issuer
namespace: demo
spec:
type: ReconfigureTLS
databaseRef:
name: ferretdb
tls:
issuerRef:
name: fr-new-issuer
kind: Issuer
apiGroup: "cert-manager.io"
11 changes: 11 additions & 0 deletions docs/examples/ferretdb/reconfigure-tls/frops-remove.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: FerretDBOpsRequest
metadata:
name: frops-remove
namespace: demo
spec:
type: ReconfigureTLS
databaseRef:
name: ferretdb
tls:
remove: true
8 changes: 8 additions & 0 deletions docs/examples/ferretdb/reconfigure-tls/new-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: fr-new-issuer
namespace: demo
spec:
ca:
secretName: ferretdb-new-ca
17 changes: 17 additions & 0 deletions docs/examples/ferretdb/restart/ferretdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: FerretDB
metadata:
name: ferretdb
namespace: demo
spec:
version: "1.23.0"
replicas: 1
backend:
externallyManaged: false
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
deletionPolicy: WipeOut
11 changes: 11 additions & 0 deletions docs/examples/ferretdb/restart/ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: FerretDBOpsRequest
metadata:
name: restart-ferretdb
namespace: demo
spec:
type: Restart
databaseRef:
name: ferretdb
timeout: 3m
apply: Always
17 changes: 17 additions & 0 deletions docs/examples/ferretdb/scaling/fr-horizontal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: FerretDB
metadata:
name: fr-horizontal
namespace: demo
spec:
version: "1.23.0"
replicas: 1
backend:
externallyManaged: false
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
deletionPolicy: WipeOut
20 changes: 20 additions & 0 deletions docs/examples/ferretdb/scaling/fr-vertical-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: FerretDBOpsRequest
metadata:
name: ferretdb-scale-vertical
namespace: demo
spec:
type: VerticalScaling
databaseRef:
name: fr-vertical
verticalScaling:
node:
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "2Gi"
cpu: "1"
timeout: 5m
apply: IfReady
17 changes: 17 additions & 0 deletions docs/examples/ferretdb/scaling/fr-vertical.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: FerretDB
metadata:
name: fr-vertical
namespace: demo
spec:
version: "1.23.0"
replicas: 1
backend:
externallyManaged: false
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
deletionPolicy: WipeOut
11 changes: 11 additions & 0 deletions docs/examples/ferretdb/scaling/frops-hscale-down-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: FerretDBOpsRequest
metadata:
name: ferretdb-horizontal-scale-down
namespace: demo
spec:
type: HorizontalScaling
databaseRef:
name: fr-horizontal
horizontalScaling:
node: 2
11 changes: 11 additions & 0 deletions docs/examples/ferretdb/scaling/frops-hscale-up-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: FerretDBOpsRequest
metadata:
name: ferretdb-horizontal-scale-up
namespace: demo
spec:
type: HorizontalScaling
databaseRef:
name: fr-horizontal
horizontalScaling:
node: 3
17 changes: 17 additions & 0 deletions docs/examples/ferretdb/update-version/fr-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: FerretDB
metadata:
name: fr-update
namespace: demo
spec:
version: "1.18.0"
replicas: 1
backend:
externallyManaged: false
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
deletionPolicy: WipeOut
11 changes: 11 additions & 0 deletions docs/examples/ferretdb/update-version/frops-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: FerretDBOpsRequest
metadata:
name: ferretdb-version-update
namespace: demo
spec:
type: UpdateVersion
databaseRef:
name: fr-update
updateVersion:
targetVersion: 1.23.0
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: FerretDB Autoscaling
menu:
docs_{{ .version }}:
identifier: fr-auto-scaling-ferretdb
name: ferretdbCompute
name: Ferretdb Compute Autoscaling
parent: fr-compute-auto-scaling
weight: 15
menu_name: docs_{{ .version }}
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/ferretdb/concepts/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ section_menu_id: guides

## What is FerretDBVersion

`FerretDBVersion` is a Kubernetes `Custom Resource Definitions` (CRD). It provides a declarative configuration to specify the docker images to be used for [FerretDB](https://ferretdb.net/) server deployed with KubeDB in a Kubernetes native way.
`FerretDBVersion` is a Kubernetes `Custom Resource Definitions` (CRD). It provides a declarative configuration to specify the docker images to be used for [FerretDB](https://ferretdb.com/) server deployed with KubeDB in a Kubernetes native way.

When you install KubeDB, a `FerretDBVersion` custom resource will be created automatically for every supported FerretDB release versions. You have to specify the name of `FerretDBVersion` crd in `spec.version` field of [FerretDB](/docs/guides/ferretdb/concepts/ferretdb.md) crd. Then, KubeDB will use the docker images specified in the `FerretDBVersion` crd to create your expected FerretDB instance.

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/ferretdb/concepts/ferretdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ FerretDB managed by KubeDB can be monitored with builtin-Prometheus and Promethe

### spec.deletionPolicy

`deletionPolicy` gives flexibility whether to `nullify`(reject) the delete operation of `Pgpool` CR or which resources KubeDB should keep or delete when you delete `Pgpool` CR. KubeDB provides following four deletion policies:
`deletionPolicy` gives flexibility whether to `nullify`(reject) the delete operation of `FerretDB` CR or which resources KubeDB should keep or delete when you delete `FerretDB` CR. KubeDB provides following four deletion policies:

- DoNotTerminate
- Delete
- WipeOut (`Default`)

When `deletionPolicy` is `DoNotTerminate`, KubeDB takes advantage of `ValidationWebhook` feature in Kubernetes 1.9.0 or later clusters to implement `DoNotTerminate` feature. If admission webhook is enabled, `DoNotTerminate` prevents users from deleting the database as long as the `spec.deletionPolicy` is set to `DoNotTerminate`.

Following table show what KubeDB does when you delete Pgpool CR for different deletion policies,
Following table show what KubeDB does when you delete FerretDB CR for different deletion policies,

| Behavior | DoNotTerminate | Delete | WipeOut |
|---------------------------| :------------: |:------------:| :------: |
Expand All @@ -237,7 +237,7 @@ If you don't specify `spec.deletionPolicy` KubeDB uses `Delete` deletion policy

### spec.podTemplate

KubeDB allows providing a template for pod through `spec.podTemplate`. KubeDB operator will pass the information provided in `spec.podTemplate` to the PetSet created for Pgpool.
KubeDB allows providing a template for pod through `spec.podTemplate`. KubeDB operator will pass the information provided in `spec.podTemplate` to the PetSet created for FerretDB.

KubeDB accept following fields to set in `spec.podTemplate:`

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/ferretdb/monitoring/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu:
docs_{{ .version }}:
identifier: fr-monitoring-ferretdb
name: Monitoring
parent: fr-pgpool-guides
parent: fr-ferretdb-guides
weight: 50
menu_name: docs_{{ .version }}
---
13 changes: 9 additions & 4 deletions docs/guides/ferretdb/monitoring/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ metadata:
name: sample-ferretdb
namespace: databases
spec:
version: "4.5.0"
version: "1.23.0"
deletionPolicy: WipeOut
postgresRef:
name: ha-postgres
namespace: demo
backend:
externallyManaged: false
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
monitor:
agent: prometheus.io/operator
prometheus:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/ferretdb/monitoring/using-builtin-prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ metadata:
name: builtin-prom-fr
namespace: demo
spec:
version: "1.18.0"
version: "1.23.0"
storage:
accessModes:
- ReadWriteOnce
Expand Down Expand Up @@ -336,7 +336,7 @@ Now, we can access the dashboard at `localhost:9090`. Open [http://localhost:909
  <ipp alt="Prometheus Target" height="100%" src="/docs/images/ferretdb/monitoring/fr-builtin-prom-target.png" style="padding:10px">
</p>

Check the labels marked with red rectangle. These labels confirm that the metrics are coming from `FerretDB` database `builtin-prom-fr` through stats service `builtin-prom-fr-stats`.
Check the labels. These labels confirm that the metrics are coming from `FerretDB` database `builtin-prom-fr` through stats service `builtin-prom-fr-stats`.

Now, you can view the collected metrics and create a graph from homepage of this Prometheus dashboard. You can also use this Prometheus server as data source for [Grafana](https://grafana.com/) and create beautiful dashboard with collected metrics.

Expand Down
3 changes: 1 addition & 2 deletions docs/guides/ferretdb/monitoring/using-prometheus-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ Check the `endpoint` and `service` labels marked by the red rectangles. It verif
To clean up the Kubernetes resources created by this tutorial, run following commands

```bash
kubectl delete -n demo pp/coreos-prom-pp
kubectl delete -n demo pg/ha-postgres
kubectl delete -n demo fr/coreos-prom-fr
kubectl delete ns demo
```

Expand Down
Loading

0 comments on commit c620f68

Please sign in to comment.