From e373fc25dccfe3cfce9521e79ab85cef693d9cbf Mon Sep 17 00:00:00 2001 From: Hermain Date: Fri, 10 Aug 2018 09:43:52 +0200 Subject: [PATCH 1/3] Outside access over hostport documented --- outside-services/README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/outside-services/README.md b/outside-services/README.md index 17a03f49..d456a545 100644 --- a/outside-services/README.md +++ b/outside-services/README.md @@ -2,4 +2,21 @@ Currently supported for brokers, not zookeeper. -This folder only creates sample services for NodePort access, i.e. inside any firewalls that protect your cluster. Can be switched to LoadBalancer, but then the init script for brokers must be updated to retrieve external names. See discussions around https://github.com/Yolean/kubernetes-kafka/pull/78 for examples. + +### Outside access with one nodeport per broker +outside-0.yml - outside2.yml creates sample services for NodePort access, i.e. inside any firewalls that protect your cluster. Can be switched to LoadBalancer, but then the init script for brokers must be updated to retrieve external names. See discussions around https://github.com/Yolean/kubernetes-kafka/pull/78 for examples. + +When using this approach a service must be created for each kafka broker. + +### Outside access with hostport +An alternative is to use the hostport for the outside access. When using this only one kafka broker can run on each host, which is a good idea anyway. + +In order to switch to hostport the kafka advertise address needs to be switched to the ExternalIP or ExternalDNS name of the node running the broker. +in [kafka/10broker-config.yml](../kafka/10broker-config.yml) switch to +* `OUTSIDE_HOST=$(kubectl get node "$NODE_NAME" -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')` +* `OUTSIDE_PORT=${OutsidePort}` +and in [kafka/50kafka.yml ](../kafka/50kafka.yml) add the hostport: +``` - name: outside + containerPort: 9094 + hostPort: 9094 +``` From 8df66f222a5657382c9aacbad3e056400a5651f4 Mon Sep 17 00:00:00 2001 From: Hermain Date: Fri, 10 Aug 2018 09:47:17 +0200 Subject: [PATCH 2/3] outside access doc updated --- outside-services/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/outside-services/README.md b/outside-services/README.md index d456a545..25740204 100644 --- a/outside-services/README.md +++ b/outside-services/README.md @@ -16,7 +16,8 @@ in [kafka/10broker-config.yml](../kafka/10broker-config.yml) switch to * `OUTSIDE_HOST=$(kubectl get node "$NODE_NAME" -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')` * `OUTSIDE_PORT=${OutsidePort}` and in [kafka/50kafka.yml ](../kafka/50kafka.yml) add the hostport: -``` - name: outside +``` + - name: outside containerPort: 9094 hostPort: 9094 ``` From fe3cff74fce14bde33f1bf41ba99342b3eb68cb9 Mon Sep 17 00:00:00 2001 From: Hermain Date: Fri, 10 Aug 2018 09:48:35 +0200 Subject: [PATCH 3/3] Outside access cosmetic change to docs --- outside-services/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/outside-services/README.md b/outside-services/README.md index 25740204..a5cab738 100644 --- a/outside-services/README.md +++ b/outside-services/README.md @@ -15,6 +15,7 @@ In order to switch to hostport the kafka advertise address needs to be switched in [kafka/10broker-config.yml](../kafka/10broker-config.yml) switch to * `OUTSIDE_HOST=$(kubectl get node "$NODE_NAME" -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')` * `OUTSIDE_PORT=${OutsidePort}` + and in [kafka/50kafka.yml ](../kafka/50kafka.yml) add the hostport: ``` - name: outside