Skip to content

Commit

Permalink
add kafka kuber config
Browse files Browse the repository at this point in the history
  • Loading branch information
Rost-is-love committed Aug 29, 2024
1 parent 86970ef commit 37a37a3
Showing 1 changed file with 163 additions and 0 deletions.
163 changes: 163 additions & 0 deletions aidbox-subscriptions-to-kafka/k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka
namespace: subscriptions
spec:
replicas: 1
selector:
matchLabels:
app: kafka
template:
metadata:
labels:
app: kafka
spec:
containers:
- name: kafka
image: apache/kafka:latest
ports:
- containerPort: 9092
- containerPort: 29093
envFrom:
- configMapRef:
name: kafka-config
volumeMounts:
- name: kafka-data
mountPath: /var/lib/kafka/data
volumes:
- name: kafka-data
persistentVolumeClaim:
claimName: kafka-pvc
---
apiVersion: v1
kind: Service
metadata:
name: kafka
namespace: subscriptions
spec:
ports:
- name: outside
port: 9092
targetPort: 9092
- name: controller
port: 29093
targetPort: 29093
selector:
app: kafka
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kafka-pvc
namespace: subscriptions
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kafka-config
namespace: subscriptions
data:
KAFKA_NODE_ID: "1"
KAFKA_PROCESS_ROLES: "broker,controller"
KAFKA_LISTENERS: "LISTENER_INSIDE://0.0.0.0:29092,LISTENER_OUTSIDE://0.0.0.0:9092,CONTROLLER://0.0.0.0:29093"
KAFKA_ADVERTISED_LISTENERS: "LISTENER_INSIDE://kafka:29092,LISTENER_OUTSIDE://kafka:9092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "LISTENER_INSIDE:PLAINTEXT,LISTENER_OUTSIDE:PLAINTEXT,CONTROLLER:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: "LISTENER_INSIDE"
KAFKA_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
KAFKA_CONTROLLER_QUORUM_VOTERS: "1@kafka:29093"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-ui
namespace: subscriptions
spec:
replicas: 1
selector:
matchLabels:
app: kafka-ui
template:
metadata:
labels:
app: kafka-ui
spec:
containers:
- name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- containerPort: 8080
envFrom:
- configMapRef:
name: kafka-ui-config
---
apiVersion: v1
kind: Service
metadata:
name: kafka-ui
namespace: subscriptions
spec:
ports:
- port: 8080
targetPort: 8080
selector:
app: kafka-ui
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kafka-ui-config
namespace: subscriptions
data:
KAFKA_CLUSTERS_0_NAME: "local"
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: "kafka:9092"
DYNAMIC_CONFIG_ENABLED: "true"
KAFKA_CLUSTERS_0_READONLY: "true"
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kafka-ui
namespace: subscriptions
annotations:
acme.cert-manager.io/http01-ingress-class: nginx
cert-manager.io/cluster-issuer: letsencrypt
kubernetes.io/ingress.class: nginx
spec:
tls:
- hosts:
- kafka-ui-subscriptions.hz.aidbox.dev
secretName: kafka-ui-cert
rules:
- host: kafka-ui-subscriptions.hz.aidbox.dev
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: kafka-ui
port:
number: 8080
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt
spec:
acme:
email: hello@my-domain.com
preferredChain: ''
privateKeySecretRef:
name: issuer-key
server: https://acme-v02.api.letsencrypt.org/directory
solvers:
- http01:
ingress:
class: nginx

0 comments on commit 37a37a3

Please sign in to comment.