Skip to content

Commit

Permalink
feat!: migration to cmak-docker for cmak image
Browse files Browse the repository at this point in the history
  • Loading branch information
eshepelyuk committed May 10, 2022
1 parent e53864e commit deea757
Show file tree
Hide file tree
Showing 28 changed files with 2,156 additions and 4,253 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
venv
.venv
*.json
*.yaml
.github
.git
*.adoc
*.md
.editorconfig
.gitignore
.helmignore
justfile
5 changes: 0 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ indent_size = 4
[*.md]
max_line_length = 120

[Makefile]
indent_style = tab
indent_size = 4


5 changes: 2 additions & 3 deletions .github/workflows/ci.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continous integration
name: Build
on:
pull_request:
branches:
Expand All @@ -23,7 +23,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: volesen/setup-skaffold@v1.1
with:
version: 'v1.35.0'
version: v1.38.0
- uses: extractions/setup-just@v1
- run: |
just test
Expand All @@ -32,7 +32,6 @@ jobs:
skipClusterCreation: true
- run: |
just k3d
just up
- run: |
just test-e2e
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Release
name: Publish release
on:
workflow_dispatch
jobs:
build_docker_job:
rel_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -13,13 +13,13 @@ jobs:
with:
ref: gh-pages
path: gh-pages
- uses: volesen/setup-skaffold@v1.1
with:
version: v1.38.0
- uses: docker/login-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: volesen/setup-skaffold@v1.1
with:
version: 'v1.35.0'
- run: |
npm ci
npx semantic-release
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ node_modules
.idea
values-dev.yaml
__pycache__
.venv

4 changes: 2 additions & 2 deletions .helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
.vscode/

venv
.venv
*.tgz
.github
*.py
*.adoc
*.txt
.release-it.json
*.adoc
*.md
skaffold.yaml
values-lint.yaml
node_modules
Expand Down
12 changes: 7 additions & 5 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
branches:
- master

tagFormat: "${version}"

preset: "conventionalcommits"

plugins:
- '@semantic-release/commit-analyzer'
- 'semantic-release-commitlint'
-
- "@semantic-release/release-notes-generator"
- preset: "conventionalcommits"
- "@semantic-release/commit-analyzer"
- "semantic-release-commitlint"
- "@semantic-release/release-notes-generator"
-
- "@semantic-release/git"
- assets: []
Expand Down
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ description: Manage and vizualize Kafka clusters with CMAK (prev. Kafka Manager)
icon: https://www.vectorlogo.zone/logos/kubernetes/kubernetes-icon.svg
type: application
version: 0.0.0 # actual chart version is managed by git tags
appVersion: 3.0.0.5-7e7a22e
appVersion: 0.1.1

home: https://github.com/eshepelyuk/cmak-operator

sources:
- https://github.com/yahoo/CMAK
- https://github.com/hleb-albau/kafka-manager-docker
- https://github.com/eshepelyuk/cmak-docker

maintainers:
- name: Ievgenii Shepeliuk
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ that allows to install and configure CMAK in K8s cluster.
CMAK operator comprises following components:

* [CMAK](https://github.com/yahoo/CMAK/),
powered by [Docker image](https://hub.docker.com/r/hlebalbau/kafka-manager/)
from [@hleb-albau](https://github.com/hleb-albau/kafka-manager-docker).
powered by [CMAK docker](https://github.com/eshepelyuk/cmak-docker).
* [Apache ZooKeeper](https://zookeeper.apache.org/),
powered by [official Docker image](https://hub.docker.com/_/zookeeper/).
* Custom [cmak2zk tool](https://hub.docker.com/repository/docker/eshepelyuk/cmak2zk),
used to configure Kafka clusters in CMAK from YAML files.

## Installation


It's recommended to install CMAK operator into a dedicated namespace.

1. Add Helm repository
Expand Down
2 changes: 1 addition & 1 deletion cmak2zk/examples/docker-compose-cmak2zk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181

cmak:
image: hlebalbau/kafka-manager:stable
image: ghcr.io/eshepelyuk/cmak-3.0.0.5:latest
restart: always
ports:
- "9000:9000"
Expand Down
52 changes: 39 additions & 13 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
@test: test-lint test-unit
export E2E_TEST := "default"

@test-e2e:
helm test cmak-operator --logs
default:
@just --list

@test-lint:
test-lint:
./test/linter/test.sh
echo
echo =======================
echo = LINTER TESTS PASSED =
echo =======================

@test-unit:
test-unit:
helm plugin ls | grep unittest || helm plugin install https://github.com/quintush/helm-unittest
helm unittest -f 'test/unit/*.yaml' -3 .
echo
echo =====================
echo = UNIT TESTS PASSED =
echo =====================

@_skaffold-ctx:
skaffold config set default-repo localhost:5000
test: test-lint test-unit

_skaffold-ctx:
skaffold config set default-repo localhost:5000

# (re) create local k8s cluster using k3d
@k3d: && _skaffold-ctx
k3d cluster create --config ./test/e2e/k3d.yaml
kubectl apply -f test/e2e/kafka.yaml
k3d: && _skaffold-ctx
k3d cluster rm cmak-operator || true
k3d cluster create --config ./test/e2e/k3d.yaml
sleep 15

# install into local k8s
up: _skaffold-ctx down
skaffold run

# remove from local k8s
down:
skaffold delete || true

_chk-py:
#!/usr/bin/env bash
set -euxo pipefail
if [ ! -d .venv ]; then
python3 -mvenv .venv
pip3 install -r test/e2e/requirements.txt
fi
# run only e2e test script
test-e2e-sh: _chk-py
#!/usr/bin/env bash
set -euxo pipefail
source .venv/bin/activate
pytest --capture=tee-sys test/e2e/{{E2E_TEST}}/test.py
# run single e2e test
test-e2e: up test-e2e-sh

# deploy chart to local k8s
@up: _skaffold-ctx
skaffold run
Loading

0 comments on commit deea757

Please sign in to comment.