Skip to content

Commit

Permalink
Implemented Kafka deployment (#15)
Browse files Browse the repository at this point in the history
* Add README

* Implement Kafka Helm deployment
  • Loading branch information
utr1903 authored Jan 31, 2024
1 parent 864e757 commit fdca50b
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/helm_deploy_kafka.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Helm Kafka deployment

on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- ".github/workflows/helm_deploy_kafka.yaml"
- "infra/helm/kafka/**"

jobs:
helm_deploy:
name: "Deploy Kafka"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v2

- name: Login to Azure
id: login_to_azure
run: |
az login \
--service-principal \
-u ${{ secrets.AZURE_SERVICE_PRINCIPAL_APP_ID }} \
-p ${{ secrets.AZURE_SERVICE_PRINCIPAL_SECRET }} \
--tenant ${{ secrets.AZURE_TENANT_ID }}
- name: Get AKS credentials
id: get_aks_credentials
run: |
az aks get-credentials \
--resource-group "rg${{ secrets.PROJECT }}main${{ secrets.INSTANCE }}" \
--name "aks${{ secrets.PROJECT }}main${{ secrets.INSTANCE }}" \
--overwrite-existing
- name: Install Helm
id: install_helm
uses: azure/setup-helm@v3
with:
version: "v3.11.1"

- name: Deploy Helm chart
id: deploy_helm_chart
run: |
bash ./infra/helm/kafka/deploy.sh
- name: Logout of Azure
id: logout_from_azure
if: always()
run: |
az logout
3 changes: 3 additions & 0 deletions infra/helm/kafka/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Kafka

To be implemented...
36 changes: 36 additions & 0 deletions infra/helm/kafka/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

### Set variables
declare -A kafka
kafka["name"]="kafka"
kafka["namespace"]="opsteam"

###################
### Deploy Helm ###
###################

# Add helm repos
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

# kafka
helm upgrade ${kafka[name]} \
--install \
--wait \
--debug \
--create-namespace \
--namespace=${kafka[namespace]} \
--set listeners.client.protocol=PLAINTEXT \
--set provisioning.enabled=true \
--set provisioning.topics[0].name="dotnet" \
--set provisioning.topics[0].partitions=3 \
--set provisioning.topics[1].name="golang" \
--set provisioning.topics[1].partitions=3 \
--set provisioning.topics[2].name="java" \
--set provisioning.topics[2].partitions=3 \
--set provisioning.topics[3].name="javascript" \
--set provisioning.topics[4].partitions=3 \
--set provisioning.topics[5].name="python" \
--set provisioning.topics[5].partitions=3 \
--version "26.6.2" \
"bitnami/kafka"

0 comments on commit fdca50b

Please sign in to comment.