Files
flamingo-tech-test/Makefile
Andriy Oblivantsev b5c22e84ec
Helm Chart CI & Release / Lint Helm Chart (push) Failing after 39s
Helm Chart CI & Release / Release Helm Chart (push) Has been skipped
Configure Gitea Actions for Helm chart CI and release
- Replace GitHub chart-releaser with Gitea-compatible workflow
- Lint job: helm lint, template validation on push to main/master
- Release job: package and publish to Gitea releases on tag push (v*)
- Use gitea-release-action for creating releases
- Support both main and master branches

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 17:13:53 +00:00

79 lines
2.6 KiB
Makefile

# FleetDM Stack - Local Kubernetes Deployment
# Requires: helm, kubectl, docker; optional: kind or minikube
RELEASE_NAME ?= fleetdm-stack
NAMESPACE ?= fleetdm
CLUSTER_TYPE ?= kind
.PHONY: cluster install uninstall deps verify clean
cluster:
@echo "Creating local Kubernetes cluster ($(CLUSTER_TYPE))..."
ifeq ($(CLUSTER_TYPE),kind)
@command -v kind >/dev/null 2>&1 || { echo "Install kind: https://kind.sigs.k8s.io/"; exit 1; }
kind create cluster --name fleetdm --wait 2m || true
@echo "Installing nginx ingress controller..."
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
kubectl wait --namespace ingress-nginx --for=condition=ready pod -l app.kubernetes.io/component=controller --timeout=120s
else
@command -v minikube >/dev/null 2>&1 || { echo "Install minikube: https://minikube.sigs.k8s.io/"; exit 1; }
minikube start
minikube addons enable ingress
endif
@echo "Cluster ready. Run 'make install' to deploy FleetDM stack."
deps:
helm dependency update fleetdm-stack/
tls-certs:
@mkdir -p fleetdm-stack/certs && \
if [ ! -f fleetdm-stack/certs/cert.pem ]; then \
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout fleetdm-stack/certs/key.pem -out fleetdm-stack/certs/cert.pem \
-subj "/CN=fleet.localhost"; \
echo "Generated TLS certs in fleetdm-stack/certs/"; \
fi
install: deps tls-certs
@echo "Creating namespace $(NAMESPACE)..."
kubectl create namespace $(NAMESPACE) --dry-run=client -o yaml | kubectl apply -f -
@echo "Installing FleetDM stack..."
helm upgrade --install $(RELEASE_NAME) fleetdm-stack/ \
--namespace $(NAMESPACE)
@echo "Installation complete. Run 'make verify' to check status."
uninstall:
@echo "Removing FleetDM stack..."
helm uninstall $(RELEASE_NAME) --namespace $(NAMESPACE) || true
kubectl delete namespace $(NAMESPACE) --timeout=120s || true
@echo "Uninstall complete."
verify:
@echo "Verifying FleetDM, MySQL, and Redis..."
@echo ""
@echo "=== Pods ==="
kubectl get pods -n $(NAMESPACE) -o wide
@echo ""
@echo "=== Services ==="
kubectl get svc -n $(NAMESPACE)
@echo ""
@echo "=== Ingress ==="
kubectl get ingress -n $(NAMESPACE)
@echo ""
@echo "Access Fleet UI:"
ifeq ($(CLUSTER_TYPE),kind)
@echo " Add to /etc/hosts: 127.0.0.1 fleet.localhost"
@echo " Then: curl -H 'Host: fleet.localhost' http://localhost"
else
@echo " minikube tunnel (if needed) then: http://fleet.localhost (add to /etc/hosts)"
endif
clean: uninstall
ifeq ($(CLUSTER_TYPE),kind)
@echo "Deleting Kind cluster..."
kind delete cluster --name fleetdm || true
else
@echo "Stopping minikube..."
-minikube stop
endif