-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.yml
143 lines (137 loc) · 3.13 KB
/
manifest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Kube deployment example
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: j2k
labels:
app: j2k
spec:
replicas: 2
selector:
matchLabels:
app: j2k
template:
metadata:
annotations:
co.elastic.logs/json.add_error_key: "true"
co.elastic.logs/json.keys_under_root: "false"
labels:
app: j2k
spec:
containers:
- name: json2kafka
image: lefebsy/json2kafka:v1.1.0
imagePullPolicy: Always
env:
- name: BasicAuthEnabled
value: "true"
- name: BasicAuthLogin
value: test
- name: BasicAuthPassword
value: d3m0-Secr3t
- name: BootstrapServers
value: broker-1:9092, broker-2:9092, broker-39092
- name: Topic
value: test
- name: SecurityProtocol
value: "2"
- name: SaslMechanism
value: "1"
- name: SaslUsername
valueFrom:
secretKeyRef:
name: kafka-creds-kube-secret
key: SaslUsername
- name: SaslPassword
valueFrom:
secretKeyRef:
name: kafka-creds-kube-secret
key: SaslPassword
- name: EnableIdempotence
value: "true"
resources:
limits:
memory: "60Mi"
requests:
cpu: "5m"
memory: "60Mi"
ports:
- containerPort: 8080
name: http
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 3
periodSeconds: 20
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 120
periodSeconds: 20
---
# Kube secret definition here with kafka credentials
---
# https://kubernetes.io/fr/docs/concepts/services-networking/service/#d%c3%a9finition-dun-service
apiVersion: v1
kind: Service
metadata:
name: j2k
labels:
app: j2k
spec:
ports:
- port: 8080
name: http
selector:
app: j2k
---
# https://kubernetes.io/fr/docs/concepts/services-networking/ingress/#quest-ce-quun-ingress-
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: j2k
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: "j2k.k8s.caas.ca-sa.gca"
http:
paths:
- backend:
serviceName: j2k
servicePort: http
tls:
- hosts:
- "j2k.k8s.caas.ca-sa.gca"
---
# https://kubernetes.io/docs/concepts/services-networking/network-policies/
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: netpol-j2k
spec:
podSelector:
matchLabels:
app: j2k
policyTypes:
- Egress
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: ingress-nginx
- podSelector:
matchLabels: {}
egress:
- ports:
- port: 443
protocol: TCP
- to:
- podSelector: {}
- namespaceSelector: {}
- ipBlock:
cidr: 1.2.3.4/24 #Kafka cluster range