Skip to content

Commit 727899a

Browse files
authored
Merge pull request #195 from Hermain/master
Outside access over hostport documented
2 parents 23736e2 + fe3cff7 commit 727899a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

outside-services/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,23 @@
22

33
Currently supported for brokers, not zookeeper.
44

5-
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.
5+
6+
### Outside access with one nodeport per broker
7+
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.
8+
9+
When using this approach a service must be created for each kafka broker.
10+
11+
### Outside access with hostport
12+
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.
13+
14+
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.
15+
in [kafka/10broker-config.yml](../kafka/10broker-config.yml) switch to
16+
* `OUTSIDE_HOST=$(kubectl get node "$NODE_NAME" -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')`
17+
* `OUTSIDE_PORT=${OutsidePort}`
18+
19+
and in [kafka/50kafka.yml ](../kafka/50kafka.yml) add the hostport:
20+
```
21+
- name: outside
22+
containerPort: 9094
23+
hostPort: 9094
24+
```

0 commit comments

Comments
 (0)