@@ -338,39 +338,114 @@ spec:
338338 secretName: tls-client-key-file
339339```
340340
341- ### What should be done
342-
343- * [x] Metadata response versions V0,V1,V2,V3,V4 and V5
344- * [x] Find coordinator response versions V0 and V1
345- * [X] TLS
346- * [X] PLAIN/SASL
347- * [X] Request / reponse deadlines - socket reads/writes
348- * [X] Health endpoint
349- * [X] Prometheus metrics
350- 1 . gauge: proxy_opened_connections {broker}
351- 2 . counter: proxy_requests_total {broker, api_key, api_version}
352- 3 . counter: proxy_connections_total {broker}
353- 4 . counter: proxy_requests_bytes {broker}
354- 5 . counter: proxy_responses_bytes {broker}
355- * [X] Pluggable proxy authentication
356- * [X] Deploying Kafka Proxy as a sidecar container
357- * [X] Advertised proxy listeners e.g. bootstrap-server-mapping (remotehost: remoteport ,localhost: localport ,advhost: advport )
358- * [X] Pluggable authentication between client kafka-proxy and broker kafka-proxy a.k.a kafka-gateway
359- 1 . additional handshake - protocol: magic, method, data
360- 2 . google-id method
361- * [X] Registry for built-in plugins
362- * [X] Client cert check
363- * [X] Set TLS server CipherSuites and CurvePreferences
364- * [X] Optional ApiVersionsRequest before Local SASL Authentication Sequence
365- * [X] SaslHandshakeRequest v1 - Kafka 1.0.0
366- * [X] Connect to Kafka through SOCKS5 Proxy
367- * [ ] Performance tests and tuning
368- * [ ] Socket buffer sizing e.g. SO_RCVBUF = 32768, SO_SNDBUF = 131072
369- * [ ] Kafka connect tests
370- * [X] Different Kafka API versions tests
371- * [ ] Unit and integration tests
372- * [ ] Rolling upgrade test
373- * [ ] Graceful shutdown
341+ ### Connect to Kafka running in Kubernetes example
342+
343+ ``` yaml
344+
345+ ---
346+ apiVersion : apps/v1beta2
347+ kind : StatefulSet
348+ metadata :
349+ name : kafka-proxy
350+ spec :
351+ selector :
352+ matchLabels :
353+ app : kafka-proxy
354+ replicas : 1
355+ serviceName : kafka-proxy
356+ template :
357+ metadata :
358+ labels :
359+ app : kafka-proxy
360+ spec :
361+ containers :
362+ - name : kafka-proxy
363+ image : grepplabs/kafka-proxy:latest
364+ args :
365+ - ' server'
366+ - ' --log-format=json'
367+ - ' --bootstrap-server-mapping=kafka-0:9093,127.0.0.1:32400'
368+ - ' --bootstrap-server-mapping=kafka-1:9093,127.0.0.1:32401'
369+ - ' --bootstrap-server-mapping=kafka-2:9093,127.0.0.1:32402'
370+ - ' --tls-enable'
371+ - ' --tls-ca-chain-cert-file=/var/run/secret/kafka-ca-chain-certificate/ca-chain.cert.pem'
372+ - ' --tls-client-cert-file=/var/run/secret/kafka-client-certificate/client.cert.pem'
373+ - ' --tls-client-key-file=/var/run/secret/kafka-client-key/client.key.pem'
374+ - ' --tls-client-key-password=$(TLS_CLIENT_KEY_PASSWORD)'
375+ - ' --sasl-enable'
376+ - ' --sasl-jaas-config-file=/var/run/secret/kafka-client-jaas/jaas.config'
377+ - ' --proxy-request-buffer-size=32768'
378+ - ' --proxy-response-buffer-size=32768'
379+ - ' --proxy-listener-read-buffer-size=32768'
380+ - ' --proxy-listener-write-buffer-size=131072'
381+ - ' --kafka-connection-read-buffer-size=131072'
382+ - ' --kafka-connection-write-buffer-size=32768'
383+ env :
384+ - name : TLS_CLIENT_KEY_PASSWORD
385+ valueFrom :
386+ secretKeyRef :
387+ name : tls-client-key-password
388+ key : password
389+ volumeMounts :
390+ - name : " sasl-jaas-config-file"
391+ mountPath : " /var/run/secret/kafka-client-jaas"
392+ - name : " tls-ca-chain-certificate"
393+ mountPath : " /var/run/secret/kafka-ca-chain-certificate"
394+ - name : " tls-client-cert-file"
395+ mountPath : " /var/run/secret/kafka-client-certificate"
396+ - name : " tls-client-key-file"
397+ mountPath : " /var/run/secret/kafka-client-key"
398+ ports :
399+ - name : metrics
400+ containerPort : 9080
401+ - name : kafka-0
402+ containerPort : 32400
403+ - name : kafka-1
404+ containerPort : 32401
405+ - name : kafka-2
406+ containerPort : 32402
407+ livenessProbe :
408+ httpGet :
409+ path : /health
410+ port : 9080
411+ initialDelaySeconds : 5
412+ periodSeconds : 3
413+ readinessProbe :
414+ httpGet :
415+ path : /health
416+ port : 9080
417+ initialDelaySeconds : 5
418+ periodSeconds : 10
419+ timeoutSeconds : 5
420+ successThreshold : 2
421+ failureThreshold : 5
422+ resources :
423+ requests :
424+ memory : 128Mi
425+ cpu : 1000m
426+ restartPolicy : Always
427+ volumes :
428+ - name : sasl-jaas-config-file
429+ secret :
430+ secretName : sasl-jaas-config-file
431+ - name : tls-ca-chain-certificate
432+ secret :
433+ secretName : tls-ca-chain-certificate
434+ - name : tls-client-cert-file
435+ secret :
436+ secretName : tls-client-cert-file
437+ - name : tls-client-key-file
438+ secret :
439+ secretName : tls-client-key-file
440+ ` ` `
441+
442+
443+ ` ` ` bash
444+ kubectl port-forward kafka-proxy-0 32400:32400 32401:32401 32402:32402
445+ ```
446+
447+ Use localhost:32400, localhost:32401 and localhost:32402 as boostrap servers
448+
374449
375450### Embedded third-party source code
376451
0 commit comments