• Stars
    star
    1,804
  • Rank 25,741 (Top 0.6 %)
  • Language
    Shell
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kafka cluster as Kubernetes StatefulSet, plain manifests and config

Kafka for Kubernetes

This community seeks to provide:

  • Production-worthy Kafka setup for persistent (domain- and ops-) data at small scale.
  • Operational knowledge, biased towards resilience over throughput, as Kubernetes manifest.
  • A platform for event-driven (streaming!) microservices design using Kubernetes.

To quote @arthurk:

thanks for creating and maintaining this Kubernetes files, they're up-to-date (unlike the kubernetes contrib files, don't require helm and work great!

Getting started

We suggest you apply -f manifests in the following order:

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

Fork

Our only dependency is kubectl. Not because we dislike Helm or Operators, but because we think plain manifests make it easier to collaborate. If you begin to rely on this kafka setup we recommend you fork, for example to edit broker config.

Kustomize

With the introduction of app customization in kubectl 1.14 there's an alternative to forks. We as a community can maintain a set of overlays.

See the variants folder for different overlays. For example to scale to 1 kafka broker try kubectl apply -k variants/scale-1/. Variants also include examples of how to configure volumes for GKE, AWS and AKS with different storage classes.

Quickstart

kubectl create namespace kafka && \
kubectl apply -k github.com/Yolean/kubernetes-kafka/variants/dev-small/?ref=v6.0.3

When all pods are Ready, test with for example kafkacat -b localhost:9094 -L over kubectl -n kafka port-forward kafka-0 9094.

Maintaining your own kustomization

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:

bases:
- github.com/Yolean/kubernetes-kafka/rbac-namespace-default/?ref=60d01b5
- github.com/Yolean/kubernetes-kafka/kafka/?ref=60d01b5
- github.com/Yolean/kubernetes-kafka/zookeeper/?ref=60d01b5

Then pick and chose from patches our example variants to tailor your Kafka setup.

Version history

tag k8s ≥ highlights
v7.0.0 1.15+ Breaking with nonroot and native bases
v6.0.x 1.13+ Kafka 2.4.0 + standard storage class
v6.0.0 1.11+ Kafka 2.2.0 + apply -k (kubectl 1.14+) + #270
v5.1.0 1.11+ Kafka 2.1.1
v5.0.3 1.11+ Zookeeper fix #227 + maxClientCnxns=1
v5.0 1.11+ Destabilize because in Docker we want Java 11 #197 #191
v4.3.1 1.9+ Critical Zookeeper persistence fix #228
v4.3 1.9+ Adds a proper shutdown hook #207
v4.2 1.9+ Kafka 1.0.2 and tools upgrade
... see releases for full history ...
v1.0 1 Stateful? In Kubernetes? In 2016? Yes.

Monitoring

Have a look at:

Outside (out-of-cluster) access

Available for:

Stream...

More Repositories

1

kubernetes-mysql-cluster

The simplest SQL cluster that could possibly work
147
star
2

youkube

Kubernetes locally using kubeadm and https://github.com/coreos/coreos-vagrant
Shell
11
star
3

kubeadm-vagrant

Multi-node unopinionated Kubernetes setup locally
Shell
9
star
4

kubernetes-assert

JavaScript
8
star
5

kubernetes-registry

Tries to track what's going on with https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/registry, and avoid dependency on gcr.io
Makefile
8
star
6

ystack

Kubernetes platform-as-a-platform
Shell
7
star
7

kafka-cache

Explorations for the log-backed in-memory cache we need in almost every service
JavaScript
6
star
8

confluent-quickstart-kubernetes

Abandoned in favor of https://github.com/Yolean/kubernetes-kafka/pull/45
6
star
9

kubernetes-minio

Minio on Kubernetes using Kustomize
5
star
10

kafka-keyvalue

The sequel to https://github.com/Yolean/kafka-cache - over HTTP this time
Java
3
star
11

docker-base

Because pull time matters with ephemeral nodes
Dockerfile
3
star
12

kafka-hook

HTTP to Kafka, a webhook endpoint that tries to represent every event with context
Java
3
star
13

keycloak-stats

A /varz REST endpoint that returns session count for the realms in keycloak
JavaScript
3
star
14

kafka-topic-client

Create Kafka topics remotely
Java
3
star
15

quarkus-javet

Quarkus Javet extension, see https://github.com/caoccao/Javet/issues/107
Java
2
star
16

kubernetes-keycloakx

Transition to Keycloak.X from Keycloak.big-footprint on Kubernetes
Shell
2
star
17

kube-test

2
star
18

kafka-topics-copy

Copy Kafka topics within your existing Kafka Cluster.
Shell
2
star
19

kubernetes-requestbin

2
star
20

kubernetes-job-to-cronjob

Because CronJob is one yaml "spec:" level too far
2
star
21

kafka-keyvalue-nodejs

TypeScript
2
star
22

kafka-test-failover

A test utility for https://github.com/Yolean/kubernetes-kafka/pull/78
Java
1
star
23

kafka-keyvalue-demo

JavaScript
1
star
24

kubernetes-git-cluster

Bare git hosting with sufficiently high availability for use as gitRepo volumes in other pods
Shell
1
star
25

promparse

A crappy lib, but it explores Deno && Node compatibility
TypeScript
1
star
26

grafana-dashboards

Ops dashboards in addition to those from kubernetes-mixin
JavaScript
1
star
27

yolean.github.io

HTML
1
star
28

kube-backup

Experiments with kubectl get --export to pull relevant parts of Etcd state to version control
Shell
1
star
29

knative-test

Knative was just irresistible
Shell
1
star
30

javet-quarkus

Experiments with Javet and Quarkus native builds
HTML
1
star
31

build-contract

CI-neutral build+test definitions using docker-compose
JavaScript
1
star