forked from opendatahub-io/rhaii-on-xks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
140 lines (121 loc) · 5.96 KB
/
Makefile
File metadata and controls
140 lines (121 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.PHONY: deploy deploy-all undeploy undeploy-kserve status help check-kubeconfig sync clear-cache
.PHONY: deploy-cert-manager deploy-istio deploy-lws deploy-kserve deploy-opendatahub-prerequisites deploy-cert-manager-pki
.PHONY: test conformance
HELMFILE_CACHE := $(HOME)/.cache/helmfile
KSERVE_NAMESPACE ?= opendatahub
check-kubeconfig:
@kubectl cluster-info >/dev/null 2>&1 || (echo "ERROR: Cannot connect to cluster. Check KUBECONFIG." && exit 1)
help:
@echo "rhaii-on-xks - Infrastructure for llm-d on xKS (AKS/CoreWeave)"
@echo ""
@echo "Deploy:"
@echo " make deploy - Deploy cert-manager + istio + lws"
@echo " make deploy-all - Deploy all (cert-manager + istio + lws + kserve)"
@echo " make deploy-kserve - Deploy KServe"
@echo ""
@echo "Undeploy:"
@echo " make undeploy - Remove all infrastructure"
@echo " make undeploy-kserve - Remove KServe"
@echo ""
@echo "Other:"
@echo " make status - Show deployment status"
@echo " make test - Run ODH conformance tests"
@echo " make sync - Fetch latest from git repos"
@echo " make clear-cache - Clear helmfile git cache"
clear-cache:
@echo "=== Clearing helmfile cache ==="
helmfile cache info
helmfile cache cleanup
@echo "Cache cleared"
sync: clear-cache
helmfile deps
# Deploy
deploy: check-kubeconfig clear-cache
helmfile apply --selector name=cert-manager-operator
helmfile apply --selector name=sail-operator
helmfile apply --selector name=lws-operator
@$(MAKE) status
deploy-all: check-kubeconfig deploy-cert-manager deploy-istio deploy-lws deploy-kserve
@$(MAKE) status
deploy-cert-manager: check-kubeconfig clear-cache
helmfile apply --selector name=cert-manager-operator
deploy-istio: check-kubeconfig clear-cache
helmfile apply --selector name=sail-operator
deploy-lws: check-kubeconfig clear-cache
helmfile apply --selector name=lws-operator
deploy-opendatahub-prerequisites: check-kubeconfig
@echo "=== Deploying OpenDataHub prerequisites ==="
kubectl create namespace $(KSERVE_NAMESPACE) --dry-run=client -o yaml | kubectl apply -f -
-kubectl get secret redhat-pull-secret -n istio-system -o yaml 2>/dev/null | \
sed 's/namespace: istio-system/namespace: $(KSERVE_NAMESPACE)/' | \
kubectl apply -f - 2>/dev/null || true
deploy-cert-manager-pki: check-kubeconfig deploy-opendatahub-prerequisites
@kubectl get crd clusterissuers.cert-manager.io >/dev/null 2>&1 || \
(echo "ERROR: cert-manager CRDs not found. Run 'make deploy-cert-manager' first." && exit 1)
@echo "Waiting for cert-manager webhook..."
-kubectl delete secret cert-manager-webhook-ca -n cert-manager --ignore-not-found 2>/dev/null || true
kubectl rollout restart deployment/cert-manager-webhook -n cert-manager
kubectl rollout status deployment/cert-manager-webhook -n cert-manager --timeout=120s
@sleep 5
kubectl apply -f ./charts/kserve/pki-prereq.yaml
kubectl wait --for=condition=Ready clusterissuer/opendatahub-ca-issuer --timeout=120s
deploy-kserve: check-kubeconfig deploy-cert-manager-pki
@echo "Applying KServe via Helm..."
helmfile sync --wait --selector name=kserve-rhaii-xks --skip-crds
@echo "=== KServe deployed ==="
# Undeploy
undeploy: check-kubeconfig undeploy-kserve
@./scripts/cleanup.sh -y
undeploy-kserve: check-kubeconfig
-@kubectl delete llminferenceservice --all -A --ignore-not-found 2>/dev/null || true
-@kubectl delete inferencepool --all -A --ignore-not-found 2>/dev/null || true
-@helm uninstall kserve-rhaii-xks --namespace $(KSERVE_NAMESPACE) 2>/dev/null || true
-@kubectl delete validatingwebhookconfiguration llminferenceservice.serving.kserve.io llminferenceserviceconfig.serving.kserve.io --ignore-not-found 2>/dev/null || true
-@# Removes KServe CRDs and Inference Extension CRDs (Helm does not remove CRDs on uninstall)
-@kubectl get crd -o name | grep -E "serving.kserve.io|inference.networking" | xargs -r kubectl delete --ignore-not-found 2>/dev/null || true
-@# Removes cluster-scoped RBAC resources
-@kubectl get clusterrole,clusterrolebinding -o name | grep -i kserve | xargs -r kubectl delete --ignore-not-found 2>/dev/null || true
-@kubectl delete clusterissuer opendatahub-ca-issuer opendatahub-selfsigned-issuer --ignore-not-found 2>/dev/null || true
-@kubectl delete certificate opendatahub-ca -n cert-manager --ignore-not-found 2>/dev/null || true
-@kubectl delete namespace $(KSERVE_NAMESPACE) --ignore-not-found --wait=false 2>/dev/null || true
@echo "=== KServe removed ==="
# Status
status: check-kubeconfig
@echo ""
@echo "=== Deployment Status ==="
@echo "cert-manager-operator:"
@kubectl get pods -n cert-manager-operator 2>/dev/null || echo " Not deployed"
@echo ""
@echo "cert-manager:"
@kubectl get pods -n cert-manager 2>/dev/null || echo " Not deployed"
@echo ""
@echo "istio:"
@kubectl get pods -n istio-system 2>/dev/null || echo " Not deployed"
@echo ""
@echo "lws-operator:"
@kubectl get pods -n openshift-lws-operator 2>/dev/null || echo " Not deployed"
@echo ""
@echo "kserve:"
@kubectl get pods -n $(KSERVE_NAMESPACE) -l control-plane=kserve-controller-manager 2>/dev/null || echo " Not deployed"
@echo ""
@echo "kserve config:"
@kubectl get llminferenceserviceconfig -n $(KSERVE_NAMESPACE) 2>/dev/null || echo " Not deployed"
@echo ""
@echo "=== API Versions ==="
@echo -n "InferencePool API: "
@if kubectl get crd inferencepools.inference.networking.k8s.io >/dev/null 2>&1; then \
echo "v1 (inference.networking.k8s.io)"; \
elif kubectl get crd inferencepools.inference.networking.x-k8s.io >/dev/null 2>&1; then \
echo "v1alpha2 (inference.networking.x-k8s.io)"; \
else \
echo "Not installed"; \
fi
@echo -n "Istio version: "
@kubectl get istio default -n istio-system -o jsonpath='{.spec.version}' 2>/dev/null || echo "Not deployed"
@echo ""
# Test/Conformance (ODH deployment validation)
NAMESPACE ?= llm-d
PROFILE ?= kserve-basic
test: conformance
conformance: check-kubeconfig
@./test/conformance/verify-llm-d-deployment.sh --namespace $(NAMESPACE) --profile $(PROFILE)