-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add zookeeper ops and monitoring docs
Signed-off-by: Rudro-25 <[email protected]>
- Loading branch information
Showing
57 changed files
with
4,554 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: kubedb.com/v1alpha2 | ||
kind: ZooKeeper | ||
metadata: | ||
name: zookeeper-builtin-prom | ||
namespace: demo | ||
spec: | ||
version: 3.8.3 | ||
replicas: 3 | ||
storage: | ||
resources: | ||
requests: | ||
storage: "100Mi" | ||
storageClassName: standard | ||
accessModes: | ||
- ReadWriteOnce | ||
deletionPolicy: WipeOut | ||
monitor: | ||
agent: prometheus.io/builtin | ||
prometheus: | ||
serviceMonitor: | ||
labels: | ||
release: prometheus | ||
interval: 10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: prometheus-config | ||
labels: | ||
app: prometheus-demo | ||
namespace: monitoring | ||
data: | ||
prometheus.yml: |- | ||
global: | ||
scrape_interval: 5s | ||
evaluation_interval: 5s | ||
scrape_configs: | ||
- job_name: 'kubedb-databases' | ||
honor_labels: true | ||
scheme: http | ||
kubernetes_sd_configs: | ||
- role: endpoints | ||
# by default Prometheus server select all Kubernetes services as possible target. | ||
# relabel_config is used to filter only desired endpoints | ||
relabel_configs: | ||
# keep only those services that has "prometheus.io/scrape","prometheus.io/path" and "prometheus.io/port" anootations | ||
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape, __meta_kubernetes_service_annotation_prometheus_io_port] | ||
separator: ; | ||
regex: true;(.*) | ||
action: keep | ||
# currently KubeDB supported databases uses only "http" scheme to export metrics. so, drop any service that uses "https" scheme. | ||
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme] | ||
action: drop | ||
regex: https | ||
# only keep the stats services created by KubeDB for monitoring purpose which has "-stats" suffix | ||
- source_labels: [__meta_kubernetes_service_name] | ||
separator: ; | ||
regex: (.*-stats) | ||
action: keep | ||
# service created by KubeDB will have "app.kubernetes.io/name" and "app.kubernetes.io/instance" annotations. keep only those services that have these annotations. | ||
- source_labels: [__meta_kubernetes_service_label_app_kubernetes_io_name] | ||
separator: ; | ||
regex: (.*) | ||
action: keep | ||
# read the metric path from "prometheus.io/path: <path>" annotation | ||
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path] | ||
action: replace | ||
target_label: __metrics_path__ | ||
regex: (.+) | ||
# read the port from "prometheus.io/port: <port>" annotation and update scraping address accordingly | ||
- source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port] | ||
action: replace | ||
target_label: __address__ | ||
regex: ([^:]+)(?::\d+)?;(\d+) | ||
replacement: $1:$2 | ||
# add service namespace as label to the scraped metrics | ||
- source_labels: [__meta_kubernetes_namespace] | ||
separator: ; | ||
regex: (.*) | ||
target_label: namespace | ||
replacement: $1 | ||
action: replace | ||
# add service name as a label to the scraped metrics | ||
- source_labels: [__meta_kubernetes_service_name] | ||
separator: ; | ||
regex: (.*) | ||
target_label: service | ||
replacement: $1 | ||
action: replace | ||
# add stats service's labels to the scraped metrics | ||
- action: labelmap | ||
regex: __meta_kubernetes_service_label_(.+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: kubedb.com/v1alpha2 | ||
kind: ZooKeeper | ||
metadata: | ||
name: zookeeper | ||
namespace: demo | ||
spec: | ||
version: 3.8.3 | ||
replicas: 3 | ||
storage: | ||
resources: | ||
requests: | ||
storage: "100Mi" | ||
storageClassName: longhorn | ||
accessModes: | ||
- ReadWriteOnce | ||
deletionPolicy: WipeOut | ||
monitor: | ||
agent: prometheus.io/operator | ||
prometheus: | ||
serviceMonitor: | ||
labels: | ||
release: prometheus | ||
interval: 10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
stringData: | ||
zoo.cfg: | | ||
maxClientCnxns=100 | ||
kind: Secret | ||
metadata: | ||
name: zk-new-configuration | ||
namespace: demo |
18 changes: 18 additions & 0 deletions
18
docs/examples/zookeeper/reconfiguration/sample-zk-configuration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: kubedb.com/v1alpha2 | ||
kind: ZooKeeper | ||
metadata: | ||
name: zk-quickstart | ||
namespace: demo | ||
spec: | ||
version: "3.8.3" | ||
adminServerPort: 8080 | ||
replicas: 3 | ||
configSecret: | ||
name: zk-configuration | ||
storage: | ||
resources: | ||
requests: | ||
storage: "1Gi" | ||
accessModes: | ||
- ReadWriteOnce | ||
deletionPolicy: "WipeOut" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
stringData: | ||
zoo.cfg: | | ||
maxClientCnxns=70 | ||
kind: Secret | ||
metadata: | ||
name: zk-configuration | ||
namespace: demo |
13 changes: 13 additions & 0 deletions
13
docs/examples/zookeeper/reconfiguration/zkops-apply-reconfiguration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: zk-reconfig-apply | ||
namespace: demo | ||
spec: | ||
type: Reconfigure | ||
databaseRef: | ||
name: zk-quickstart | ||
configuration: | ||
applyConfig: | ||
zoo.cfg: | | ||
maxClientCnxns=90 |
12 changes: 12 additions & 0 deletions
12
docs/examples/zookeeper/reconfiguration/zkops-reconfiguration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: zk-reconfig | ||
namespace: demo | ||
spec: | ||
type: Reconfigure | ||
databaseRef: | ||
name: zk-quickstart | ||
configuration: | ||
configSecret: | ||
name: zk-new-configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: zkops-remove | ||
namespace: demo | ||
spec: | ||
type: ReconfigureTLS | ||
databaseRef: | ||
name: zk-quickstart | ||
tls: | ||
remove: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: zkops-rotate | ||
namespace: demo | ||
spec: | ||
type: ReconfigureTLS | ||
databaseRef: | ||
name: zk-quickstart | ||
tls: | ||
rotateCertificates: true |
23 changes: 23 additions & 0 deletions
23
docs/examples/zookeeper/reconfigure-tls/zookeeper-add-tls.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: zkops-add-tls | ||
namespace: demo | ||
spec: | ||
type: ReconfigureTLS | ||
databaseRef: | ||
name: zk-quickstart | ||
tls: | ||
issuerRef: | ||
name: zookeeper-ca-issuer | ||
kind: Issuer | ||
apiGroup: "cert-manager.io" | ||
certificates: | ||
- alias: client | ||
subject: | ||
organizations: | ||
- zookeeper | ||
organizationalUnits: | ||
- client | ||
timeout: 5m | ||
apply: IfReady |
8 changes: 8 additions & 0 deletions
8
docs/examples/zookeeper/reconfigure-tls/zookeeper-issuer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: zk-issuer | ||
namespace: demo | ||
spec: | ||
ca: | ||
secretName: zookeeper-ca |
8 changes: 8 additions & 0 deletions
8
docs/examples/zookeeper/reconfigure-tls/zookeeper-new-issuer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: zk-new-issuer | ||
namespace: demo | ||
spec: | ||
ca: | ||
secretName: zookeeper-new-ca |
14 changes: 14 additions & 0 deletions
14
docs/examples/zookeeper/reconfigure-tls/zookeeper-update-tls-issuer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: zkops-update-issuer | ||
namespace: demo | ||
spec: | ||
type: ReconfigureTLS | ||
databaseRef: | ||
name: zk-quickstart | ||
tls: | ||
issuerRef: | ||
name: zk-new-issuer | ||
kind: Issuer | ||
apiGroup: "cert-manager.io" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: kubedb.com/v1alpha2 | ||
kind: ZooKeeper | ||
metadata: | ||
name: zk-quickstart | ||
namespace: demo | ||
spec: | ||
version: "3.8.3" | ||
adminServerPort: 8080 | ||
replicas: 3 | ||
storage: | ||
resources: | ||
requests: | ||
storage: "1Gi" | ||
accessModes: | ||
- ReadWriteOnce | ||
deletionPolicy: "WipeOut" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: horizontal-scale-down | ||
namespace: demo | ||
spec: | ||
type: HorizontalScaling | ||
databaseRef: | ||
name: zk-quickstart | ||
horizontalScaling: | ||
replicas: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: horizontal-scale-up | ||
namespace: demo | ||
spec: | ||
type: HorizontalScaling | ||
databaseRef: | ||
name: zk-quickstart | ||
horizontalScaling: | ||
replicas: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: ops.kubedb.com/v1alpha1 | ||
kind: ZooKeeperOpsRequest | ||
metadata: | ||
name: vscale | ||
namespace: demo | ||
spec: | ||
databaseRef: | ||
name: zk-quickstart | ||
type: VerticalScaling | ||
verticalScaling: | ||
node: | ||
resources: | ||
limits: | ||
cpu: 1 | ||
memory: 2Gi | ||
requests: | ||
cpu: 1 | ||
memory: 2Gi | ||
timeout: 5m | ||
apply: IfReady |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: kubedb.com/v1alpha2 | ||
kind: ZooKeeper | ||
metadata: | ||
name: zk-quickstart | ||
namespace: demo | ||
spec: | ||
version: "3.8.3" | ||
adminServerPort: 8080 | ||
replicas: 4 | ||
storage: | ||
resources: | ||
requests: | ||
storage: "1Gi" | ||
storageClassName: "standard" | ||
accessModes: | ||
- ReadWriteOnce | ||
deletionPolicy: "WipeOut" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: zookeeper-ca-issuer | ||
namespace: demo | ||
spec: | ||
ca: | ||
secretName: zookeeper-ca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: kubedb.com/v1alpha2 | ||
kind: ZooKeeper | ||
metadata: | ||
name: zk-quickstart | ||
namespace: demo | ||
spec: | ||
version: "3.8.3" | ||
enableSSL: true | ||
tls: | ||
issuerRef: | ||
apiGroup: "cert-manager.io" | ||
kind: Issuer | ||
name: zookeeper-ca-issuer | ||
adminServerPort: 8080 | ||
replicas: 5 | ||
storage: | ||
resources: | ||
requests: | ||
storage: "1Gi" | ||
accessModes: | ||
- ReadWriteOnce | ||
deletionPolicy: "WipeOut" |
Oops, something went wrong.