-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add README * Implement Kafka Helm deployment
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Kafka | ||
|
||
To be implemented... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |