From 29c41abf58540437eff015696828e776ae2b82de Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Fri, 12 Apr 2024 17:07:56 +0200 Subject: [PATCH] add common apps for kafka and clickhouse Signed-off-by: Andrei Kvapil --- packages/apps/clickhouse/Chart.yaml | 25 +++++++++ .../apps/clickhouse/templates/clickhouse.yaml | 15 ++++++ packages/apps/kafka/Chart.yaml | 25 +++++++++ packages/apps/kafka/templates/kafka.yaml | 53 +++++++++++++++++++ packages/apps/versions_map | 2 + 5 files changed, 120 insertions(+) create mode 100644 packages/apps/clickhouse/Chart.yaml create mode 100644 packages/apps/clickhouse/templates/clickhouse.yaml create mode 100644 packages/apps/kafka/Chart.yaml create mode 100644 packages/apps/kafka/templates/kafka.yaml diff --git a/packages/apps/clickhouse/Chart.yaml b/packages/apps/clickhouse/Chart.yaml new file mode 100644 index 00000000..13752c29 --- /dev/null +++ b/packages/apps/clickhouse/Chart.yaml @@ -0,0 +1,25 @@ +apiVersion: v2 +name: clickhouse +description: Managed ClickHouse service +icon: https://cdn.worldvectorlogo.com/logos/clickhouse.svg + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/packages/apps/clickhouse/templates/clickhouse.yaml b/packages/apps/clickhouse/templates/clickhouse.yaml new file mode 100644 index 00000000..47426d64 --- /dev/null +++ b/packages/apps/clickhouse/templates/clickhouse.yaml @@ -0,0 +1,15 @@ +apiVersion: "clickhouse.altinity.com/v1" +kind: "ClickHouseInstallation" +metadata: + name: "simple-01" +spec: + configuration: + users: + # printf 'test_password' | sha256sum + test_user/password_sha256_hex: 10a6e6cc8311a3e2bcc09bf6c199adecd5dd59408c343e926b129c4914f3cb01 + test_user/password: test_password + # to allow access outside from kubernetes + test_user/networks/ip: + - 0.0.0.0/0 + clusters: + - name: "simple" diff --git a/packages/apps/kafka/Chart.yaml b/packages/apps/kafka/Chart.yaml new file mode 100644 index 00000000..2ed27680 --- /dev/null +++ b/packages/apps/kafka/Chart.yaml @@ -0,0 +1,25 @@ +apiVersion: v2 +name: kafka +description: Managed Kafka service +icon: https://upload.wikimedia.org/wikipedia/commons/0/05/Apache_kafka.svg + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/packages/apps/kafka/templates/kafka.yaml b/packages/apps/kafka/templates/kafka.yaml new file mode 100644 index 00000000..345f33e2 --- /dev/null +++ b/packages/apps/kafka/templates/kafka.yaml @@ -0,0 +1,53 @@ +apiVersion: kafka.strimzi.io/v1beta2 +kind: Kafka +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +spec: + kafka: + replicas: 3 + listeners: + - name: plain + port: 9092 + type: internal + tls: false + - name: tls + port: 9093 + type: internal + tls: true + - name: external + port: 9094 + {{- if .Values.external }} + type: loadbalancer + {{- else }} + type: internal + {{- end }} + tls: false + config: + offsets.topic.replication.factor: 3 + transaction.state.log.replication.factor: 3 + transaction.state.log.min.isr: 2 + default.replication.factor: 3 + min.insync.replicas: 2 + storage: + type: jbod + volumes: + - id: 0 + type: persistent-claim + {{- with .Values.kafka.size }} + size: {{ . }} + {{- end }} + deleteClaim: true + zookeeper: + replicas: 3 + storage: + type: persistent-claim + {{- with .Values.zookeeper.size }} + size: {{ . }} + {{- end }} + deleteClaim: false + entityOperator: + topicOperator: {} + userOperator: {} diff --git a/packages/apps/versions_map b/packages/apps/versions_map index e53b7b4e..6fe6f60b 100644 --- a/packages/apps/versions_map +++ b/packages/apps/versions_map @@ -1,4 +1,6 @@ +clickhouse 0.1.0 HEAD http-cache 0.1.0 HEAD +kafka 0.1.0 HEAD kubernetes 0.1.0 HEAD mysql 0.1.0 f642698 mysql 0.2.0 HEAD