eindelijk weer eens een push
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: kafka-chat-config
|
||||
namespace: kafka
|
||||
data:
|
||||
config.json: |
|
||||
{
|
||||
"kafka": {
|
||||
"broker": "kafka-service.kafka.svc.cluster.local:9092"
|
||||
},
|
||||
"couchdb": {
|
||||
"url": "http://admin:Couchdb01@couchdb.couchdb.svc.cluster.local:5984"
|
||||
},
|
||||
"mail": {
|
||||
"host": "smtp.eu.mailgun.org",
|
||||
"port": 587,
|
||||
"user": "postmaster@allarddcs.nl",
|
||||
"pass": "Mailgun01@"
|
||||
},
|
||||
"app": {
|
||||
"baseUrl": "https://kafkachat-dev.allarddcs.nl",
|
||||
"inviteExpiry": 604800
|
||||
}
|
||||
}
|
||||
---
|
||||
# chat-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kafka-chat
|
||||
namespace: kafka
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: kafka-chat
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: kafka-chat
|
||||
spec:
|
||||
containers:
|
||||
- name: kafka-chat
|
||||
image: allardkrings/kafka-chat:1.0
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8080 # backend WS
|
||||
- containerPort: 3000 # frontend
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/kafkachat
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: kafka-chat-config
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: ServersTransport
|
||||
metadata:
|
||||
name: kafka-chat-transport
|
||||
namespace: kafka
|
||||
spec:
|
||||
forwardingTimeouts:
|
||||
responseHeaderTimeout: 0s
|
||||
idleConnTimeout: 0s
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-chat
|
||||
namespace: kafka
|
||||
spec:
|
||||
selector:
|
||||
app: kafka-chat
|
||||
ports:
|
||||
- name: frontend
|
||||
port: 80
|
||||
targetPort: 3000
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-chat-lb
|
||||
namespace: kafka
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: kafka-chat
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 3000
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: kafka-chat
|
||||
namespace: kafka
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`kafkachat-prod.allarddcs.nl`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: kafka-chat
|
||||
port: 80
|
||||
serversTransport: kafka-chat-transport
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
@@ -1,19 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: kafka-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.2.28
|
||||
path: /mnt/nfs_share/kafka
|
||||
readOnly: false
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: kafka-pvc
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: kafka-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+47
-1
@@ -2,6 +2,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-service
|
||||
namespace: kafka
|
||||
labels:
|
||||
app: kafka
|
||||
spec:
|
||||
@@ -14,6 +15,7 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kafka-deployment
|
||||
namespace: kafka
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
@@ -48,6 +50,7 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kafka-ui
|
||||
namespace: kafka
|
||||
labels:
|
||||
app: kafka-ui
|
||||
spec:
|
||||
@@ -75,6 +78,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-ui
|
||||
namespace: kafka
|
||||
labels:
|
||||
name: kafka-ui
|
||||
spec:
|
||||
@@ -90,14 +94,56 @@ apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: kafka-ui-tls-allarddcs
|
||||
namespace: kafka
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`kafka-prod.allarddcs.nl`)
|
||||
- match: Host(`kafka-dev.allarddcs.nl`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: kafka-ui
|
||||
port: 8080
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: kafka-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.2.111
|
||||
path: /mnt/nfs_share/dev/kafka
|
||||
readOnly: false
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: kafka-pvc
|
||||
namespace: kafka
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: kafka-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: kafka
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-headless
|
||||
namespace: kafka
|
||||
labels:
|
||||
app: kafka
|
||||
spec:
|
||||
clusterIP: None
|
||||
selector:
|
||||
app: kafka
|
||||
ports:
|
||||
- name: broker
|
||||
port: 9092
|
||||
- name: controller
|
||||
port: 9093
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: kafka
|
||||
namespace: kafka
|
||||
spec:
|
||||
serviceName: kafka-headless
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: kafka
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: kafka
|
||||
spec:
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
containers:
|
||||
- name: kafka
|
||||
image: apache/kafka:4.0.0
|
||||
ports:
|
||||
- containerPort: 9092
|
||||
name: broker
|
||||
- containerPort: 9093
|
||||
name: controller
|
||||
env:
|
||||
- name: KAFKA_PROCESS_ROLES
|
||||
value: "broker,controller"
|
||||
|
||||
- name: KAFKA_NODE_ID
|
||||
value: "1"
|
||||
|
||||
- name: KAFKA_CONTROLLER_LISTENER_NAMES
|
||||
value: "CONTROLLER"
|
||||
|
||||
- name: KAFKA_LISTENERS
|
||||
value: "PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093"
|
||||
|
||||
- name: KAFKA_ADVERTISED_LISTENERS
|
||||
value: "PLAINTEXT://kafka-0.kafka-headless.kafka.svc.cluster.local:9092"
|
||||
|
||||
- name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
|
||||
value: "PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT"
|
||||
|
||||
- name: KAFKA_CONTROLLER_QUORUM_VOTERS
|
||||
value: "1@kafka-0.kafka-headless.kafka.svc.cluster.local:9093"
|
||||
|
||||
- name: KAFKA_LOG_DIRS
|
||||
value: "/var/lib/kafka/data"
|
||||
|
||||
volumeMounts:
|
||||
- name: kafka-storage
|
||||
mountPath: /var/lib/kafka
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: kafka-storage
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-ui
|
||||
namespace: kafka
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: kafka-ui
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
nodePort: 31890
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kafka-ui
|
||||
namespace: kafka
|
||||
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
|
||||
env:
|
||||
- name: KAFKA_CLUSTERS_0_NAME
|
||||
value: "kraft-cluster"
|
||||
- name: KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS
|
||||
value: "kafka-0.kafka-headless.kafka.svc.cluster.local:9092"
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: kafka-ui-tls
|
||||
namespace: kafka
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`kafka-dev.allarddcs.nl`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: kafka-ui
|
||||
port: 8080
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
@@ -0,0 +1,8 @@
|
||||
microk8s kubectl create ns kafka
|
||||
kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka
|
||||
|
||||
|
||||
#single node:
|
||||
|
||||
|
||||
kubectl apply -f https://strimzi.io/examples/latest/kafka/kafka-single-node.yaml -n kafka
|
||||
@@ -0,0 +1,47 @@
|
||||
apiVersion: kafka.strimzi.io/v1
|
||||
kind: KafkaNodePool
|
||||
metadata:
|
||||
name: dual-role
|
||||
labels:
|
||||
strimzi.io/cluster: my-cluster
|
||||
spec:
|
||||
replicas: 1
|
||||
roles:
|
||||
- controller
|
||||
- broker
|
||||
storage:
|
||||
type: jbod
|
||||
volumes:
|
||||
- id: 0
|
||||
type: persistent-claim
|
||||
size: 10Gi
|
||||
deleteClaim: false
|
||||
kraftMetadata: shared
|
||||
---
|
||||
|
||||
apiVersion: kafka.strimzi.io/v1
|
||||
kind: Kafka
|
||||
metadata:
|
||||
name: my-cluster
|
||||
spec:
|
||||
kafka:
|
||||
version: 4.1.1
|
||||
metadataVersion: 4.1-IV1
|
||||
listeners:
|
||||
- name: plain
|
||||
port: 9092
|
||||
type: internal
|
||||
tls: false
|
||||
- name: tls
|
||||
port: 9093
|
||||
type: internal
|
||||
tls: true
|
||||
config:
|
||||
offsets.topic.replication.factor: 1
|
||||
transaction.state.log.replication.factor: 1
|
||||
transaction.state.log.min.isr: 1
|
||||
default.replication.factor: 1
|
||||
min.insync.replicas: 1
|
||||
entityOperator:
|
||||
topicOperator: {}
|
||||
userOperator: {}
|
||||
@@ -0,0 +1,57 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-ui
|
||||
namespace: kafka
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: kafka-ui
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
nodePort: 31890
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kafka-ui
|
||||
namespace: kafka
|
||||
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
|
||||
env:
|
||||
- name: KAFKA_CLUSTERS_0_NAME
|
||||
value: "my-cluster"
|
||||
- name: KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS
|
||||
value: "my-cluster-kafka-bootstrap:9092"
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: kafka-ui-tls
|
||||
namespace: kafka
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`kafka-dev.allarddcs.nl`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: kafka-ui
|
||||
port: 8080
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
@@ -2,6 +2,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: zookeeper-service
|
||||
namespace: kafka
|
||||
labels:
|
||||
app: zookeeper
|
||||
spec:
|
||||
@@ -14,6 +15,7 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: zookeeper-deployment
|
||||
namespace: kafka
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
|
||||
Reference in New Issue
Block a user