Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Kafka deployment #15

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading