Skip to content

Commit 85b61f4

Browse files
authored
Merge pull request #270 from Yolean/storagclass-kustomize
Use standard storage class by default, demonstrate kustomization per hosting provider
2 parents d5fc680 + 61555c3 commit 85b61f4

32 files changed

+219
-85
lines changed

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ To quote [@arthurk](https://github.com/Yolean/kubernetes-kafka/issues/82#issueco
1212
## Getting started
1313

1414
We suggest you `apply -f` manifests in the following order:
15-
* Your choice of storage classes from [./configure](./configure/)
1615
* [namespace](./00-namespace.yml)
1716
* [./rbac-namespace-default](./rbac-namespace-default/)
1817
* [./zookeeper](./zookeeper/)
1918
* [./kafka](./kafka/)
2019

2120
That'll give you client "bootstrap" `bootstrap.kafka.svc.cluster.local:9092`.
2221

22+
With the introduction of [-k](#kustomize) support, apply `-f` will report `error: unable to decode "zookeeper/kustomization.yaml": Object 'Kind' is missing in ...`. With kubectl v1.14+ you can avoid that using: `kubectl apply -k variants/scale-3-5/`.
23+
2324
## Fork
2425

2526
Our only dependency is `kubectl`. Not because we dislike Helm or Operators, but because we think plain manifests make it easier to collaborate.
@@ -30,21 +31,35 @@ If you begin to rely on this kafka setup we recommend you fork, for example to e
3031
With the introduction of [app customization](https://kubectl.docs.kubernetes.io/pages/app_customization/introduction.html) in `kubectl` 1.14 there's an alternative to forks. We as a community can maintain a set of overlays.
3132

3233
See the [variants](./variants) folder for different overlays. For example to scale to 1 kafka broker try `kubectl apply -k variants/scale-1/`.
34+
Variants also include examples of how to configure volumes for GKE, AWS and AKS with different storage classes.
35+
36+
### Quickstart
3337

34-
Currently `apply -k` replaces `apply -f ./zookeeper; apply -f ./kafka`.
35-
The original commands now result in `error: unable to decode "zookeeper/kustomization.yaml": Object 'Kind' is missing in ...`
36-
and though they still seem to work you can get around that with a v1.14+ kubectl using: `kubectl apply -k variants/as-is/`.
38+
```
39+
kubectl create namespace kafka && \
40+
kubectl apply -k github.com/Yolean/kubernetes-kafka/variants/dev-small/?ref=storagclass-kustomize
41+
```
42+
43+
When all pods are Ready, test with for example `kafkacat -b localhost:9094 -L` over `kubectl -n kafka port-forward kafka-0 9094`.
3744

3845
### Maintaining your own kustomization
3946

40-
`kubectl apply -k` takes a single overlay, meaning that you can't compose different overlays from this repo.
41-
You'll probably want to maintain your own variant.
42-
One option is to keep kubernets-kafka as a git submodule and edit the relative path from an example variant.
47+
Start your variant as a new folder in your choice of version control, with a base `kustomization.yaml` pointing to a tag or revision in this repository:
48+
49+
```
50+
bases:
51+
- github.com/Yolean/kubernetes-kafka/rbac-namespace-default/?ref=553f327
52+
- github.com/Yolean/kubernetes-kafka/kafka/?ref=553f327
53+
- github.com/Yolean/kubernetes-kafka/zookeeper/?ref=553f327
54+
```
55+
56+
Then pick and chose from patches our [example variants](https://github.com/Yolean/kubernetes-kafka/tree/master/variants) to tailor your Kafka setup.
4357

4458
## Version history
4559

4660
| tag | k8s ≥ | highlights |
4761
| ------ | ----- | ----------- |
62+
| v6.0.0 | 1.11+ | Kafka 2.2.0 + `apply -k` (kubectl 1.14+) |
4863
| v5.1.0 | 1.11+ | Kafka 2.1.1 |
4964
| v5.0.3 | 1.11+ | Zookeeper fix [#227](https://github.com/Yolean/kubernetes-kafka/pull/227) + [maxClientCnxns=1](https://github.com/Yolean/kubernetes-kafka/pull/230#issuecomment-445953857) |
5065
| v5.0 | 1.11+ | Destabilize because in Docker we want Java 11 [#197](https://github.com/Yolean/kubernetes-kafka/pull/197) [#191](https://github.com/Yolean/kubernetes-kafka/pull/191) |
@@ -62,21 +77,14 @@ Have a look at:
6277
* [./consumers-prometheus](./consumers-prometheus/)
6378
* [or plain JMX](https://github.com/Yolean/kubernetes-kafka/pull/96)
6479
* what's happening in the [monitoring](https://github.com/Yolean/kubernetes-kafka/labels/monitoring) label.
65-
* Note that this repo is intentionally light on [automation](https://github.com/Yolean/kubernetes-kafka/labels/automation). We think every SRE team must build the operational knowledge first.
80+
* Note that this repo is intentionally light on [automation](https://github.com/Yolean/kubernetes-kafka/labels/automation). We think every SRE team must build the operational knowledge first. But there is an example of a [Cruise Control](./cruise-control/) setup.
6681

6782
## Outside (out-of-cluster) access
6883

6984
Available for:
7085

7186
* [Brokers](./outside-services/)
7287

73-
## Fewer than three nodes?
74-
75-
For [minikube](https://github.com/kubernetes/minikube/), [youkube](https://github.com/Yolean/youkube) etc:
76-
77-
* [Scale 1](https://github.com/Yolean/kubernetes-kafka/pull/44)
78-
* [Scale 2](https://github.com/Yolean/kubernetes-kafka/pull/118)
79-
8088
## Stream...
8189

8290
* [Kubernetes events to Kafka](./events-kube/)

configure/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

configure/docker-storageclass-broker.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

configure/docker-storageclass-zookeeper.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

configure/minikube-storageclasses.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

kafka/50kafka.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ spec:
100100
name: data
101101
spec:
102102
accessModes: [ "ReadWriteOnce" ]
103-
storageClassName: kafka-broker
103+
storageClassName: standard
104104
resources:
105105
requests:
106106
storage: 10Gi
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resources:
2+
- node-reader.yml
3+
- pod-labler.yml
File renamed without changes.
File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bases:
2+
- ../scale-3-5
3+
resources:
4+
- aks-storageclass-broker-managed.yaml
5+
- aks-storageclass-zookeeper-managed.yaml
6+
patchesStrategicMerge:
7+
- volume-claims.yaml

0 commit comments

Comments
 (0)