Skip to content

Commit

Permalink
Add Kafka Opsrequest and Autoscaler Docs (#656)
Browse files Browse the repository at this point in the history
* Add Kafka Opsrequest and Autoscaler Docs

Signed-off-by: obaydullahmhs <[email protected]>
  • Loading branch information
obaydullahmhs authored Sep 9, 2024
1 parent 4778ea1 commit 54a2aa0
Show file tree
Hide file tree
Showing 132 changed files with 14,787 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: KafkaAutoscaler
metadata:
name: kf-broker-autoscaler
namespace: demo
spec:
databaseRef:
name: kafka-prod
opsRequestOptions:
timeout: 5m
apply: IfReady
compute:
broker:
trigger: "On"
podLifeTimeThreshold: 5m
resourceDiffPercentage: 20
minAllowed:
cpu: 600m
memory: 1.5Gi
maxAllowed:
cpu: 1
memory: 2Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: KafkaAutoscaler
metadata:
name: kf-combined-autoscaler
namespace: demo
spec:
databaseRef:
name: kafka-dev
opsRequestOptions:
timeout: 5m
apply: IfReady
compute:
node:
trigger: "On"
podLifeTimeThreshold: 5m
resourceDiffPercentage: 20
minAllowed:
cpu: 600m
memory: 1.5Gi
maxAllowed:
cpu: 1
memory: 2Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: KafkaAutoscaler
metadata:
name: kf-controller-autoscaler
namespace: demo
spec:
databaseRef:
name: kafka-prod
opsRequestOptions:
timeout: 5m
apply: IfReady
compute:
controller:
trigger: "On"
podLifeTimeThreshold: 5m
resourceDiffPercentage: 20
minAllowed:
cpu: 600m
memory: 1.5Gi
maxAllowed:
cpu: 1
memory: 2Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
27 changes: 27 additions & 0 deletions docs/examples/kafka/autoscaler/kafka-combined.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: kubedb.com/v1
kind: Kafka
metadata:
name: kafka-dev
namespace: demo
spec:
replicas: 2
version: 3.6.1
podTemplate:
spec:
containers:
- name: kafka
resources:
limits:
memory: 1Gi
requests:
cpu: 500m
memory: 1Gi
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
# storageClassName: standard
storageType: Durable
deletionPolicy: WipeOut
48 changes: 48 additions & 0 deletions docs/examples/kafka/autoscaler/kafka-topology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: kubedb.com/v1
kind: Kafka
metadata:
name: kafka-prod
namespace: demo
spec:
version: 3.6.1
topology:
broker:
replicas: 2
podTemplate:
spec:
containers:
- name: kafka
resources:
limits:
memory: 1Gi
requests:
cpu: 500m
memory: 1Gi
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
controller:
replicas: 2
podTemplate:
spec:
containers:
- name: kafka
resources:
limits:
memory: 1Gi
requests:
cpu: 500m
memory: 1Gi
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: autoscaling.kubedb.com/v1alpha1
kind: KafkaAutoscaler
metadata:
name: kf-storage-autoscaler-combined
namespace: demo
spec:
databaseRef:
name: kafka-dev
storage:
node:
expansionMode: "Online"
trigger: "On"
usageThreshold: 60
scalingThreshold: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: KafkaAutoscaler
metadata:
name: kf-storage-autoscaler-topology
namespace: demo
spec:
databaseRef:
name: kafka-prod
storage:
broker:
expansionMode: "Online"
trigger: "On"
usageThreshold: 60
scalingThreshold: 100
controller:
expansionMode: "Online"
trigger: "On"
usageThreshold: 60
scalingThreshold: 100
9 changes: 9 additions & 0 deletions docs/examples/kafka/configuration/configsecret-combined.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: configsecret-combined
namespace: demo
stringData:
server.properties: |-
log.retention.hours=100
default.replication.factor=2
11 changes: 11 additions & 0 deletions docs/examples/kafka/configuration/configsecret-topology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: configsecret-topology
namespace: demo
stringData:
broker.properties: |-
log.retention.hours=100
default.replication.factor=2
controller.properties: |-
metadata.log.dir=/var/log/kafka/metadata-custom
19 changes: 19 additions & 0 deletions docs/examples/kafka/configuration/kafka-combined.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kubedb.com/v1
kind: Kafka
metadata:
name: kafka-dev
namespace: demo
spec:
replicas: 2
version: 3.6.1
configSecret:
name: configsecret-combined
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
storageType: Durable
deletionPolicy: WipeOut
30 changes: 30 additions & 0 deletions docs/examples/kafka/configuration/kafka-topology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: kubedb.com/v1
kind: Kafka
metadata:
name: kafka-prod
namespace: demo
spec:
version: 3.6.1
configSecret:
name: configsecret-topology
topology:
broker:
replicas: 2
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
controller:
replicas: 2
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
storageType: Durable
deletionPolicy: WipeOut
26 changes: 26 additions & 0 deletions docs/examples/kafka/monitoring/kafka-builtin-prom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kubedb.com/v1alpha2
kind: Kafka
metadata:
name: kafka-builtin-prom
namespace: demo
spec:
replicas: 2
version: 3.6.1
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
storageType: Durable
monitor:
agent: prometheus.io/builtin
prometheus:
exporter:
port: 56790
serviceMonitor:
labels:
release: prometheus
interval: 10s
deletionPolicy: WipeOut
2 changes: 1 addition & 1 deletion docs/examples/kafka/monitoring/kf-with-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
agent: prometheus.io/operator
prometheus:
exporter:
port: 9091
port: 56790
serviceMonitor:
labels:
release: prometheus
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/kafka/reconfigure-tls/kafka-add-tls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: KafkaOpsRequest
metadata:
name: kfops-add-tls
namespace: demo
spec:
type: ReconfigureTLS
databaseRef:
name: kafka-prod
tls:
issuerRef:
name: kf-issuer
kind: Issuer
apiGroup: "cert-manager.io"
certificates:
- alias: client
subject:
organizations:
- kafka
organizationalUnits:
- client
timeout: 5m
apply: IfReady
8 changes: 8 additions & 0 deletions docs/examples/kafka/reconfigure-tls/kafka-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: kf-issuer
namespace: demo
spec:
ca:
secretName: kafka-ca
8 changes: 8 additions & 0 deletions docs/examples/kafka/reconfigure-tls/kafka-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: kf-new-issuer
namespace: demo
spec:
ca:
secretName: kafka-new-ca
11 changes: 11 additions & 0 deletions docs/examples/kafka/reconfigure-tls/kafka-remove-tls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: KafkaOpsRequest
metadata:
name: kfops-remove
namespace: demo
spec:
type: ReconfigureTLS
databaseRef:
name: kafka-prod
tls:
remove: true
11 changes: 11 additions & 0 deletions docs/examples/kafka/reconfigure-tls/kafka-rotate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: KafkaOpsRequest
metadata:
name: kfops-rotate
namespace: demo
spec:
type: ReconfigureTLS
databaseRef:
name: kafka-prod
tls:
rotateCertificates: true
14 changes: 14 additions & 0 deletions docs/examples/kafka/reconfigure-tls/kafka-update-tls-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: KafkaOpsRequest
metadata:
name: kfops-update-issuer
namespace: demo
spec:
type: ReconfigureTLS
databaseRef:
name: kafka-prod
tls:
issuerRef:
name: kf-new-issuer
kind: Issuer
apiGroup: "cert-manager.io"
Loading

0 comments on commit 54a2aa0

Please sign in to comment.