-
Notifications
You must be signed in to change notification settings - Fork 4
/
rockcraft.yaml
75 lines (71 loc) · 2.54 KB
/
rockcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
---
name: charmed-kafka # the name of your ROCK
base: [email protected] # the base environment for this ROCK
version: '3.6.1' # just for humans. Semantic versioning is recommended
summary: Charmed Kafka ROCK OCI # 79 char long summary
description: |
This is an OCI image that bundles Apache Kafka together with other tools
of its ecosystem in order to be used in Charmed Operators, providing
automated operations management from day 0 to day 2 on the Apache Kafka
distributed coodrdinator, on top of a Virtual Machine cluster and K8s cluster.
It is an open source, end-to-end, production ready data platform on top of
cloud native technologies.
license: Apache-2.0 # your application's SPDX license
platforms: # The platforms this ROCK should be built on and run on
amd64:
services:
kafka:
override: replace
command: /opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties
startup: enabled
user: kafka
group: kafka
environment:
JAVA_HOME: /usr/lib/jvm/java-18-openjdk-amd64
KAFKA_OPTS: "-javaagent:/opt/kafka/libs/jmx_prometheus_javaagent.jar=\n
9101:/etc/kafka/jmx_prometheus.yaml\n
-Djava.security.auth.login.config=\n
/etc/kafka/kafka-jaas.cfg"
parts:
kafka:
plugin: nil
stage-packages:
- openjdk-18-jre-headless
- libpsl5
- curl
build-environment:
- JAVA_HOME: /usr/lib/jvm/java-18-openjdk-amd64
stage-snaps:
- charmed-kafka/3/edge
override-build: |
ln -s /usr/lib/jvm/java-18-openjdk-amd64/bin/java \
$CRAFT_PART_INSTALL/usr/bin/java
ln -s /usr/lib/jvm/java-18-openjdk-amd64/bin/keytool \
$CRAFT_PART_INSTALL/usr/bin/keytool
# making core dirs
mkdir -p $CRAFT_PART_INSTALL/var/lib/pebble/default/
mkdir -p $CRAFT_PART_INSTALL/var/lib/kafka/
mkdir -p $CRAFT_PART_INSTALL/var/log/kafka/
mkdir -p $CRAFT_PART_INSTALL/opt/kafka/
mkdir -p $CRAFT_PART_INSTALL/etc/kafka/
organize:
bin: opt/kafka/bin/
libs: opt/kafka/libs/
config: opt/kafka/config/
non-root-user:
plugin: nil
after: [kafka]
overlay-script: |
# Create a user in the $CRAFT_OVERLAY chroot
groupadd -R $CRAFT_OVERLAY -g 1000 kafka
useradd -R $CRAFT_OVERLAY -M -r -g kafka -u 1000 kafka
override-prime: |
craftctl default
# Give permission ot the required folders
install -d -o 1000 -g 1000 -m 770 \
opt/kafka \
var/lib/kafka \
var/log/kafka \
etc/kafka