prod add kafka

main
ycz008 2023-11-20 16:27:48 +08:00
parent 96d1749b63
commit f951c224b9
2 changed files with 209 additions and 0 deletions

View File

@ -0,0 +1,102 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: akhq-config
data:
application.yml: |
micronaut:
security:
enabled: true
token:
jwt:
signatures:
secret:
generator:
secret: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjpbeyJ0b29sdHQiOiJodHRwczovL3Rvb2x0dC5jb20ifV0sImlhdCI6MTY4NTY4OTU1MiwiZXhwIjoyNTM3NjI1NTk5LCJhdWQiOiIiLCJpc3MiOiJzbWFsbGtvdWRhaSIsInN1YiI6IiJ9.mKw9nKRhQimdaNtMWLHT9TqIn2-iIcZR4txgy8z07xQ
akhq:
security:
default-group: no-roles
basic-auth:
- username: admin
password: "$2a$10$zBr9YyaCto68TJ.aYsP8/eQXHm5MqJUULRm0OpzEOowhmG2Pjv2ry"
passwordHash: BCRYPT
groups:
- admin
connections:
kafka-cluster:
properties:
bootstrap.servers: "kafka.prod.svc.cluster.local:9092"
schema-registry:
url: "http://schemaregistry.prod.svc.cluster.local:8081"
type: "confluent"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: akhq
spec:
replicas: 1
selector:
matchLabels:
app: akhq
template:
metadata:
labels:
app: akhq
spec:
containers:
- name: akhq
image: tchiotludo/akhq
env:
- name: MICRONAUT_CONFIG_FILES
value: /app/application.yml
ports:
- name: http
containerPort: 8080
protocol: TCP
- name: management
containerPort: 28081
protocol: TCP
volumeMounts:
- name: config
mountPath: /app/application.yml
subPath: application.yml
livenessProbe:
httpGet:
path: /health
port: management
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: management
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
resources: {}
volumes:
- name: config
configMap:
name: akhq-config
---
apiVersion: v1
kind: Service
metadata:
name: akhq
spec:
type: ClusterIP
ports:
- name: http
protocol: TCP
port: 8080
targetPort: http
selector:
app: akhq

View File

@ -0,0 +1,107 @@
---
apiVersion: platform.confluent.io/v1beta1
kind: Zookeeper
metadata:
name: zookeeper
spec:
replicas: 3
oneReplicaPerNode: true
configOverrides:
jvm:
- "-Xmx128m"
podTemplate:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: app.kubernetes.io/component=mq
operator: In
values:
- mq
image:
application: confluentinc/cp-zookeeper:7.4.0
init: confluentinc/confluent-init-container:2.6.0
dataVolumeCapacity: 10Gi
logVolumeCapacity: 10Gi
storageClass:
name: kafka-prod
---
apiVersion: platform.confluent.io/v1beta1
kind: Kafka
metadata:
name: kafka
spec:
replicas: 3
oneReplicaPerNode: true
configOverrides:
server:
- auto.create.topics.enable=true
- default.replication.factor=3
jvm:
- "-Xmx512m"
podTemplate:
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "4G"
cpu: "1"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- mq
image:
application: confluentinc/cp-server:7.4.0
init: confluentinc/confluent-init-container:2.6.0
dataVolumeCapacity: 20Gi
storageClass:
name: kafka-prod
metricReporter:
enabled: true
listeners:
external:
externalAccess:
type: nodePort
nodePort:
host: kafka-prod.beaconfireinc.com
nodePortOffset: 30002
# dependencies:
# 多个kakfa集群复用zk
# zookeeper:
# endpoint: zookeeper.common.svc.cluster.local:2181
---
apiVersion: platform.confluent.io/v1beta1
kind: SchemaRegistry
metadata:
name: schemaregistry
spec:
replicas: 3
oneReplicaPerNode: true
configOverrides:
jvm:
- "-Xmx128m"
podTemplate:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- mq
image:
application: confluentinc/cp-schema-registry:7.4.0
init: confluentinc/confluent-init-container:2.6.0
externalAccess:
type: nodePort
nodePort:
host: kafka-prod.beaconfireinc.com
nodePortOffset: 30006