aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStaffan Olsson <staffan@repos.se>2017-07-26 11:38:47 +0200
committerStaffan Olsson <staffan@repos.se>2017-07-26 11:42:19 +0200
commitbe5a82037682d9b1ebd907a367e839ecd71aa1fa (patch)
tree38fbaf6e36acc693e7036ed5d52d8b2532bad293
parenta2d324d509d7041642123f22b589ad4925ea1199 (diff)
downloadkubernetes-kafka-be5a82037682d9b1ebd907a367e839ecd71aa1fa.tar.gz
kubernetes-kafka-be5a82037682d9b1ebd907a367e839ecd71aa1fa.tar.bz2
kubernetes-kafka-be5a82037682d9b1ebd907a367e839ecd71aa1fa.zip
Demonstrates how an init script can be used to ...
modify config prior to kafka start. My aim with this is to get rid of the /bin/sh startup scripts and use bin + args directly.
-rw-r--r--10broker-config.yml4
-rw-r--r--50kafka.yml7
2 files changed, 11 insertions, 0 deletions
diff --git a/10broker-config.yml b/10broker-config.yml
index b86a057..b6ecf1c 100644
--- a/10broker-config.yml
+++ b/10broker-config.yml
@@ -4,6 +4,10 @@ metadata:
namespace: kafka
apiVersion: v1
data:
+ init.sh: |-
+ echo "I guess I'm running in the init container"
+ sed -i 's/%p %m/%p -INIT-WAS-HERE- %m/' /etc/kafka/log4j.properties
+
server.properties: |-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
diff --git a/50kafka.yml b/50kafka.yml
index 051349e..930dcda 100644
--- a/50kafka.yml
+++ b/50kafka.yml
@@ -15,6 +15,13 @@ spec:
prometheus.io/port: "5556"
spec:
terminationGracePeriodSeconds: 30
+ initContainers:
+ - name: init-config
+ image: solsson/kafka:0.11.0.0@sha256:b27560de08d30ebf96d12e74f80afcaca503ad4ca3103e63b1fd43a2e4c976ce
+ command: ['/bin/sh', '-ec', '. /etc/kafka/init.sh']
+ volumeMounts:
+ - name: config
+ mountPath: /etc/kafka
containers:
- name: metrics
image: solsson/kafka-prometheus-jmx-exporter@sha256:1f7c96c287a2dbec1d909cd8f96c0656310239b55a9a90d7fd12c81f384f1f7d