-
Notifications
You must be signed in to change notification settings - Fork 1
Feature platform engineering repo #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fc99734
feat: add one-command local setup with Makefile, Kind cluster, and qu…
tukue 355606a
feat: add observability stack with Prometheus, Grafana dashboards, an…
tukue a710b4c
feat: add secret management with External Secrets Operator and Cluste…
tukue 4ba4969
feat: add 28 Helm unit tests across 7 suites covering Deployment, Ing…
tukue 54b2969
feat: add app-b as second tenant app proving contract reusability acr…
tukue cf9cd82
fix: install helm unittest plugin in CI before running tests
tukue 1ee6324
fix: update CI to validate app-b alongside simple-app across all step…
tukue 255f4a5
fix: pin helm-unittest plugin to v0.7.0 for Helm 3.14.4 compatibility
tukue 4f0f2c9
fix: add --ignore-missing-schemas to kubeconform for CRDs (ServiceMon…
tukue c71625c
fix: skip values.yaml in ArgoCD validation and add -ignore-missing-sc…
tukue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,127 @@ | ||||||||||||||
| SHELL := /bin/bash | ||||||||||||||
| .SHELLFLAGS := -eu -o pipefail -c | ||||||||||||||
| .ONESHELL: | ||||||||||||||
| .DELETE_ON_ERROR: | ||||||||||||||
| MAKEFLAGS += --no-print-directory | ||||||||||||||
|
|
||||||||||||||
| CLUSTER_NAME ?= platform-demo | ||||||||||||||
| NAMESPACE ?= argocd | ||||||||||||||
| KIND_IMG ?= kindest/node:v1.30.0 | ||||||||||||||
|
|
||||||||||||||
| .PHONY: help | ||||||||||||||
| help: | ||||||||||||||
| @echo 'Usage: make <target>' | ||||||||||||||
| @echo '' | ||||||||||||||
| @echo ' setup Create cluster + install Argo CD + deploy platform + deploy demo app' | ||||||||||||||
| @echo ' kind-up Create Kind cluster' | ||||||||||||||
| @echo ' kind-down Delete Kind cluster' | ||||||||||||||
| @echo ' argocd-install Install Argo CD and apply AppProjects' | ||||||||||||||
| @echo ' deploy Apply platform bootstrap + add-ons + demo app' | ||||||||||||||
| @echo ' test Run Helm unit tests' | ||||||||||||||
| @echo ' validate Run CI checks locally (Helm lint + test + conftest)' | ||||||||||||||
| @echo ' clean kind-down + remove tmp files' | ||||||||||||||
| @echo '' | ||||||||||||||
|
|
||||||||||||||
| .PHONY: kind-up | ||||||||||||||
| kind-up: | ||||||||||||||
| @echo "=== Creating Kind cluster: $(CLUSTER_NAME) ===" | ||||||||||||||
| kind create cluster --name $(CLUSTER_NAME) --config kind-config.yaml | ||||||||||||||
| @echo "Cluster ready: $(CLUSTER_NAME)" | ||||||||||||||
|
|
||||||||||||||
| .PHONY: kind-down | ||||||||||||||
| kind-down: | ||||||||||||||
| @echo "=== Deleting Kind cluster: $(CLUSTER_NAME) ===" | ||||||||||||||
| kind delete cluster --name $(CLUSTER_NAME) 2>/dev/null || true | ||||||||||||||
|
|
||||||||||||||
| .PHONY: argocd-install | ||||||||||||||
| argocd-install: kind-up | ||||||||||||||
| @echo "=== Installing Argo CD ===" | ||||||||||||||
| cd argocd/bootstrap && ./install.sh | ||||||||||||||
|
|
||||||||||||||
| .PHONY: deploy | ||||||||||||||
| deploy: | ||||||||||||||
| @echo "=== Applying platform bootstrap ===" | ||||||||||||||
| kubectl apply -f platform/bootstrap/namespaces.yaml | ||||||||||||||
| kubectl apply -f platform/bootstrap/resource-quota.yaml | ||||||||||||||
| kubectl apply -f platform/bootstrap/limit-range.yaml | ||||||||||||||
| kubectl apply -f platform/bootstrap/network-policy.yaml | ||||||||||||||
| kubectl apply -f platform/bootstrap/rbac-readonly.yaml | ||||||||||||||
| kubectl apply -f platform/bootstrap/cluster-secret-store.yaml | ||||||||||||||
|
|
||||||||||||||
| @echo "=== Creating platform secrets namespace ===" | ||||||||||||||
| kubectl create namespace platform-secrets --dry-run=client -o yaml | kubectl apply -f - | ||||||||||||||
|
|
||||||||||||||
| @echo "=== Seeding dev secret for demo ===" | ||||||||||||||
| kubectl create secret generic dev-simple-app-db-password \ | ||||||||||||||
| --from-literal=db-password=$${DEV_DB_PASSWORD:-changeme} \ | ||||||||||||||
| -n platform-secrets --dry-run=client -o yaml | kubectl apply -f - | ||||||||||||||
|
Comment on lines
+55
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛑 Security Vulnerability: Hardcoded secret value exposes credentials in source control. Replace with environment variable or secure secret management.1
Suggested change
Footnotes
|
||||||||||||||
|
|
||||||||||||||
| @echo "=== Applying platform add-ons ===" | ||||||||||||||
| kubectl apply -f platform/addons/metrics-server.yaml | ||||||||||||||
| kubectl apply -f platform/addons/nginx-ingress.yaml | ||||||||||||||
| kubectl apply -f platform/addons/external-secrets.yaml | ||||||||||||||
| kubectl apply -f platform/addons/kube-prometheus-stack.yaml | ||||||||||||||
| kubectl apply -f platform/addons/grafana-dashboards-platform.yaml | ||||||||||||||
|
|
||||||||||||||
| @echo "=== Deploying simple-app ===" | ||||||||||||||
| helm template simple-app-dev standardized-path/app \ | ||||||||||||||
| -f platform/apps/dev/values.yaml \ | ||||||||||||||
| | kubectl apply -f - 2>&1 | grep -v 'unchanged' || true | ||||||||||||||
|
|
||||||||||||||
| @echo "=== Deploying app-b ===" | ||||||||||||||
| helm template app-b-dev standardized-path/app \ | ||||||||||||||
| -f platform/apps/app-b/dev/values.yaml \ | ||||||||||||||
| | kubectl apply -f - 2>&1 | grep -v 'unchanged' || true | ||||||||||||||
|
|
||||||||||||||
| @echo "=== App status ===" | ||||||||||||||
| kubectl get pods -n dev --show-labels | ||||||||||||||
|
|
||||||||||||||
| .PHONY: test | ||||||||||||||
| test: | ||||||||||||||
| @echo "=== Helm unit tests ===" | ||||||||||||||
| helm unittest standardized-path/app --color | ||||||||||||||
|
|
||||||||||||||
| .PHONY: validate | ||||||||||||||
| validate: test | ||||||||||||||
| @echo "=== Helm lint ===" | ||||||||||||||
| helm lint standardized-path/app -f platform/apps/dev/values.yaml | ||||||||||||||
| helm lint standardized-path/app -f platform/apps/stage/values.yaml | ||||||||||||||
| helm lint standardized-path/app -f platform/apps/prod/values.yaml | ||||||||||||||
|
|
||||||||||||||
| @echo "=== ServiceMonitor renders ===" | ||||||||||||||
| helm template simple-app-dev standardized-path/app -f platform/apps/dev/values.yaml \ | ||||||||||||||
| | grep -q "kind: ServiceMonitor" && echo " PASS: ServiceMonitor present" | ||||||||||||||
|
|
||||||||||||||
| @echo "=== OpenShift path renders correctly ===" | ||||||||||||||
| helm template test standardized-path/app \ | ||||||||||||||
| --set openshift.enabled=true \ | ||||||||||||||
| --set openshift.route.enabled=true \ | ||||||||||||||
| --set ingress.enabled=false \ | ||||||||||||||
| | grep -q "kind: Route" && echo " PASS: Route present" | ||||||||||||||
|
|
||||||||||||||
| @echo "=== OPA policy: EKS manifests ===" | ||||||||||||||
| helm template simple-app-dev standardized-path/app -f platform/apps/dev/values.yaml \ | ||||||||||||||
| | tr -d '\r' | conftest test -p policy/eks/ --no-color - | ||||||||||||||
|
|
||||||||||||||
| @echo "=== OPA policy: OpenShift manifests ===" | ||||||||||||||
| helm template test standardized-path/app \ | ||||||||||||||
| --set openshift.enabled=true \ | ||||||||||||||
| --set openshift.route.enabled=true \ | ||||||||||||||
| --set ingress.enabled=false \ | ||||||||||||||
| | tr -d '\r' | conftest test -p policy/openshift/ --no-color - | ||||||||||||||
|
|
||||||||||||||
| .PHONY: setup | ||||||||||||||
| setup: argocd-install deploy | ||||||||||||||
| @echo "=== Setup complete ===" | ||||||||||||||
| @echo "" | ||||||||||||||
| @echo " Argo CD UI: http://localhost:8080 (admin / get password below)" | ||||||||||||||
| @echo " Demo app: kubectl get all -n dev" | ||||||||||||||
| @echo "" | ||||||||||||||
| @echo " Argo CD password:" | ||||||||||||||
| @kubectl -n argocd get secret argocd-initial-admin-secret \ | ||||||||||||||
| -o jsonpath="{.data.password}" 2>/dev/null | base64 -d || echo " (retrievable after install completes)" | ||||||||||||||
|
|
||||||||||||||
| .PHONY: clean | ||||||||||||||
| clean: kind-down | ||||||||||||||
| @rm -f /tmp/platform-*.yaml 2>/dev/null || true | ||||||||||||||
| @echo "Done." | ||||||||||||||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for missing Helm unittest plugin. The workflow will fail if the plugin isn't installed.