Skip to content

Commit

Permalink
Add k8s installation
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquingx committed Sep 8, 2024
1 parent fe61402 commit a7d378e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
29 changes: 29 additions & 0 deletions k8s-installation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PLATFORM ?= linux/amd64
IMAGE_NAME ?= airflow
TAG ?= latest
REGISTRY ?= "localhost:5001"
RELEASE_NAME ?= "airflow"
NAMESPACE ?= "airflow"
SSH_KEY ?= "~/.ssh/dags_ssh"

.PHONY: build
build:
-cd .. && docker build -f docker-installation/Dockerfile --platform $(PLATFORM) -t $(REGISTRY)/$(IMAGE_NAME):$(TAG) .

.PHONY: push
push:
-docker push $(REGISTRY)/$(IMAGE_NAME):$(TAG)

.PHONY: deploy
deploy:
-helm install $(RELEASE_NAME) apache-airflow/airflow --namespace $(NAMESPACE) --debug --timeout 10m0s -f values.yaml
-create-connections
-git-sync-credentials

.PHONY: create-connections
create_connections:
-kubectl create secret generic airflow-connections --from-file=airflow-connections.yaml -n $(NAMESPACE)

.PHONY: git-sync-credentials
git-sync-credentials:
-kubectl create secret generic airflow-ssh-git-secret --from-file=gitSshKey=$(SSH_KEY) -n $(NAMESPACE)
34 changes: 34 additions & 0 deletions k8s-installation/kind-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
kubeadmConfigPatches:
- |
kind: JoinConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "node=worker_1"
extraMounts:
- hostPath: ./data
containerPath: /tmp/data
- role: worker
kubeadmConfigPatches:
- |
kind: JoinConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "node=worker_2"
extraMounts:
- hostPath: ./data
containerPath: /tmp/data
- role: worker
kubeadmConfigPatches:
- |
kind: JoinConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "node=worker_3"
extraMounts:
- hostPath: ./data
containerPath: /tmp/data
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kafka-python-ng
apache-airflow-providers-mongo
apache-airflow-providers-apache-kafka

0 comments on commit a7d378e

Please sign in to comment.