streaming/kafka-strimzi/manifests/09-mirror-maker/my-source-cluster.yaml (198 lines of code) (raw):
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
name: my-source-cluster
spec:
kafka:
version: 3.6.0
replicas: 3
template:
pod:
tolerations:
- key: "app.stateful/component"
operator: "Equal"
value: "kafka-broker"
effect: NoSchedule
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: In
values:
- "kafka-broker"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "topology.kubernetes.io/zone"
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: kafka
strimzi.io/cluster: my-cluster
strimzi.io/component-type: kafka
resources:
requests:
memory: 5Gi
cpu: "1"
limits:
memory: 5Gi
cpu: "2"
jvmOptions:
-Xms: 4096m
-Xmx: 4096m
listeners:
- name: plain
port: 9092
type: internal
tls: false
- name: tls
port: 9093
type: internal
tls: true
authentication:
type: tls
configuration:
useServiceDnsDomain: true
authorization:
type: simple
config:
offsets.topic.replication.factor: 3
transaction.state.log.replication.factor: 3
transaction.state.log.min.isr: 2
default.replication.factor: 3
min.insync.replicas: 2
inter.broker.protocol.version: "3.4"
storage:
type: jbod
volumes:
- id: 0
type: persistent-claim
size: 100Gi
class: premium-rwo
deleteClaim: false
zookeeper:
template:
pod:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: "app.stateful/component"
operator: In
values:
- "zookeeper"
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "topology.kubernetes.io/zone"
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: zookeeper
strimzi.io/cluster: my-cluster
strimzi.io/component-type: zookeeper
replicas: 3
resources:
requests:
memory: 2560Mi
cpu: 1000m
limits:
memory: 2560Mi
cpu: 2000m
jvmOptions:
-Xms: 2048m
-Xmx: 2048m
storage:
type: persistent-claim
size: 100Gi
class: premium-rwo
deleteClaim: false
entityOperator:
tlsSidecar:
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 128Mi
topicOperator:
resources:
requests:
cpu: 100m
memory: 512Mi
limits:
cpu: 500m
memory: 512Mi
userOperator:
resources:
requests:
cpu: 500m
ephemeral-storage: 1Gi
memory: 2Gi
limits:
cpu: 500m
ephemeral-storage: 1Gi
memory: 2Gi
---
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
name: source-user
labels:
strimzi.io/cluster: my-source-cluster
spec:
authentication:
type: tls
authorization:
type: simple
acls:
# MirrorSourceConnector
- resource: # Not needed if offset-syncs.topic.location=target
type: topic
name: mm2-offset-syncs.my-target-cluster.internal
operations:
- Read
- DescribeConfigs
- Write
- Create
- resource:
type: topic
name: my-topic
patternType: literal
operations:
- Create
- Describe
- Write
- Read
host: "*"
- resource: # Needed for every topic which is mirrored
type: topic
name: "*"
operations:
- Read
- DescribeConfigs
# MirrorCheckpointConnector
- resource:
type: cluster
operations:
- Describe
- resource: # Needed for every group for which offsets are synced
type: group
name: "*"
operations:
- Describe
---
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: my-topic
labels:
strimzi.io/cluster: my-source-cluster
spec:
partitions: 3
replicas: 3
config:
retention.ms: 7200000