|
69 | 69 | endif
|
70 | 70 |
|
71 | 71 | NAMESPACE ?= instana-agent
|
| 72 | +NAMESPACE_PREPULLER ?= instana-agent-image-prepuller |
72 | 73 |
|
73 | 74 | INSTANA_AGENT_CLUSTER_WIDE_RESOURCES := \
|
74 | 75 | "crd/agents.instana.io" \
|
@@ -302,6 +303,36 @@ create-pull-secret: ## Creates image pull secret for delivery.instana.io from yo
|
302 | 303 | @echo "Restarting operator deployment..."
|
303 | 304 | @kubectl delete pods -l app.kubernetes.io/name=instana-agent-operator -n $(NAMESPACE)
|
304 | 305 |
|
| 306 | +.PHONY: pre-pull-images |
| 307 | +pre-pull-images: ## Pre-pulls images on the target cluster (useful in slow network situations to run tests reliably) |
| 308 | + @if [ "$(INSTANA_API_KEY)" == "" ]; then \ |
| 309 | + echo "env variable INSTANA_API_KEY is undefined but should contain the agent download key"; \ |
| 310 | + exit 1; \ |
| 311 | + fi |
| 312 | + oc new-project $(NAMESPACE_PREPULLER) || true |
| 313 | + @echo "Creating Docker registry secret..." |
| 314 | + @echo "Checking if secret containers-instana-io-pull-secret exists in namespace $(NAMESPACE_PREPULLER)..." |
| 315 | + @if kubectl get secret containers-instana-io-pull-secret -n $(NAMESPACE_PREPULLER) >/dev/null 2>&1; then \ |
| 316 | + echo "Updating existing secret containers-instana-io-pull-secret..."; \ |
| 317 | + kubectl delete secret containers-instana-io-pull-secret -n $(NAMESPACE_PREPULLER); \ |
| 318 | + fi |
| 319 | + @kubectl create secret docker-registry containers-instana-io-pull-secret \ |
| 320 | + --docker-server=containers.instana.io \ |
| 321 | + --docker-username="_" \ |
| 322 | + --docker-password=$${INSTANA_API_KEY} \ |
| 323 | + -n $(NAMESPACE_PREPULLER) |
| 324 | + @echo "Start instana-agent-image-prepuller daemonset..." |
| 325 | + @echo "Checking if daemonset instana-agent-image-prepuller exists in namespace $(NAMESPACE_PREPULLER)..." |
| 326 | + @if kubectl get ds instana-agent-image-prepuller -n $(NAMESPACE_PREPULLER) >/dev/null 2>&1; then \ |
| 327 | + echo "Updating existing secret containers-instana-io-pull-secret..."; \ |
| 328 | + kubectl delete ds instana-agent-image-prepuller -n $(NAMESPACE_PREPULLER); \ |
| 329 | + kubectl delete pods -n instana-agent-image-prepuller -l name=instana-agent-image-prepuller --force --grace-period=0; \ |
| 330 | + fi |
| 331 | + @kubectl apply -f ci/scripts/instana-agent-image-prepuller.yaml -n $(NAMESPACE_PREPULLER) |
| 332 | + @echo "Waiting for the instana-agent-prepuller daemonset" |
| 333 | + @kubectl rollout status ds/instana-agent-image-prepuller -n $(NAMESPACE_PREPULLER) --timeout=900s |
| 334 | +# if pods should be deleted without waiting for the pull to stop: kubectl delete pods -n instana-agent-image-prepuller -l name=instana-agent-image-prepuller --force --grace-period=0 && kubectl delete ns instana-agent-image-prepuller |
| 335 | + |
305 | 336 | .PHONY: dev-run-ocp
|
306 | 337 | dev-run-ocp: namespace install create-cr run ## Creates a full dev deployment on OCP from scratch, also useful after purge
|
307 | 338 |
|
|
0 commit comments