Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cp configmap elements over to config volume as configmap vol is RO #163

Merged
merged 7 commits into from
Mar 24, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To quote [@arthurk](https://github.com/Yolean/kubernetes-kafka/issues/82#issueco

> 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!

## Gettings started
## Getting started

We suggest you `apply -f` manifests in the following order:
* You choice of storage classes from [./configure](./configure/)
Expand All @@ -28,6 +28,7 @@ If you begin to rely on this kafka setup we recommend you fork, for example to e

| tag | k8s ≥ | highlights |
| ----- | ------ | ---------- |
| master | 1.9.4 | Required for read-only ConfigMaps, k8s 1.9.4+ |
Copy link
Contributor Author

@lamdor lamdor Mar 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick note that the readonly configmap volume fix was backported and released as 1.8.9 and 1.7.14 too so each of those need master as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @rubbish. I have apparently not been paying enough attention. I'll merge this now.

| v3.1 | 1.8 | The painstaking path to `min.insync.replicas`=2 |
| v3.0 | 1.8 | [Outside access](#78), [modern manifests](#84), [bootstrap.kafka](#52) |
| v2.1 | 1.5 | Kafka 1.0, the init script concept |
Expand Down
1 change: 1 addition & 0 deletions kafka/10broker-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ data:
set -x
KAFKA_BROKER_ID=${HOSTNAME##*-}
cp -Lur /etc/kafka-configmap/* /etc/kafka/
sed -i "s/#init#broker.id=#init#/broker.id=$KAFKA_BROKER_ID/" /etc/kafka/server.properties
LABELS="kafka-broker-id=$KAFKA_BROKER_ID"
Expand Down
10 changes: 7 additions & 3 deletions kafka/50kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
terminationGracePeriodSeconds: 30
initContainers:
- name: init-config
image: solsson/kafka-initutils@sha256:c98d7fb5e9365eab391a5dcd4230fc6e72caf929c60f29ff091e3b0215124713
image: solsson/kafka-initutils@sha256:18bf01c2c756b550103a99b3c14f741acccea106072cd37155c6d24be4edd6e2
env:
- name: NODE_NAME
valueFrom:
Expand All @@ -34,8 +34,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command: ['/bin/bash', '/etc/kafka/init.sh']
command: ['/bin/bash', '/etc/kafka-configmap/init.sh']
volumeMounts:
- name: configmap
mountPath: /etc/kafka-configmap
- name: config
mountPath: /etc/kafka
containers:
Expand Down Expand Up @@ -70,9 +72,11 @@ spec:
- name: data
mountPath: /var/lib/kafka/data
volumes:
- name: config
- name: configmap
configMap:
name: broker-config
- name: config
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: data
Expand Down
1 change: 1 addition & 0 deletions zookeeper/10zookeeper-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data:
[ -z "$ID_OFFSET" ] && ID_OFFSET=1
export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-} + $ID_OFFSET))
echo "${ZOOKEEPER_SERVER_ID:-1}" | tee /var/lib/zookeeper/data/myid
cp -Lur /etc/kafka-configmap/* /etc/kafka/
sed -i "s/server\.$ZOOKEEPER_SERVER_ID\=[a-z0-9.-]*/server.$ZOOKEEPER_SERVER_ID=0.0.0.0/" /etc/kafka/zookeeper.properties
zookeeper.properties: |-
Expand Down
10 changes: 7 additions & 3 deletions zookeeper/50pzoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ spec:
terminationGracePeriodSeconds: 10
initContainers:
- name: init-config
image: solsson/kafka:1.0.1@sha256:1a4689d49d6274ac59b9b740f51b0408e1c90a9b66d16ad114ee9f7193bab111
command: ['/bin/bash', '/etc/kafka/init.sh']
image: solsson/kafka-initutils@sha256:18bf01c2c756b550103a99b3c14f741acccea106072cd37155c6d24be4edd6e2
command: ['/bin/bash', '/etc/kafka-configmap/init.sh']
volumeMounts:
- name: configmap
mountPath: /etc/kafka-configmap
- name: config
mountPath: /etc/kafka
- name: data
Expand Down Expand Up @@ -61,9 +63,11 @@ spec:
- name: data
mountPath: /var/lib/zookeeper/data
volumes:
- name: config
- name: configmap
configMap:
name: zookeeper-config
- name: config
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: data
Expand Down
10 changes: 7 additions & 3 deletions zookeeper/51zoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ spec:
terminationGracePeriodSeconds: 10
initContainers:
- name: init-config
image: solsson/kafka:1.0.1@sha256:1a4689d49d6274ac59b9b740f51b0408e1c90a9b66d16ad114ee9f7193bab111
command: ['/bin/bash', '/etc/kafka/init.sh']
image: solsson/kafka-initutils@sha256:18bf01c2c756b550103a99b3c14f741acccea106072cd37155c6d24be4edd6e2
command: ['/bin/bash', '/etc/kafka-configmap/init.sh']
env:
- name: ID_OFFSET
value: "4"
volumeMounts:
- name: configmap
mountPath: /etc/kafka-configmap
- name: config
mountPath: /etc/kafka
- name: data
Expand Down Expand Up @@ -64,8 +66,10 @@ spec:
- name: data
mountPath: /var/lib/zookeeper/data
volumes:
- name: config
- name: configmap
configMap:
name: zookeeper-config
- name: config
emptyDir: {}
- name: data
emptyDir: {}