Skip to content

Commit

Permalink
chore: align makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
  • Loading branch information
oliverbaehler committed Jan 13, 2025
1 parent 5760e0a commit 405f4de
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ helm-lint: docker

helm-test: helm-controller-version ct ko-build-all helm-create helm-install helm-destroy

helm-install:
@kubectl apply --server-side=true -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml
@make install-capsule
@kubectl apply --server-side=true -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.58.0/bundle.yaml
helm-install: install-dependencies
@$(CT) install --config $(SRC_ROOT)/.github/configs/ct.yaml --namespace=capsule-system --all --debug

helm-create: kind
Expand Down Expand Up @@ -142,15 +139,10 @@ e2e-build: kind
@echo "Building kubernetes env using Kind $${KIND_K8S_VERSION:-v1.27.0}..."
@$(KIND) create cluster --name capsule --image kindest/node:$${KIND_K8S_VERSION:-v1.27.0} --config ./e2e/kind.yaml --wait=120s \
&& kubectl taint nodes capsule-worker2 key1=value1:NoSchedule
@helm repo add bitnami https://charts.bitnami.com/bitnami
@helm repo update
@helm upgrade --install --namespace metrics-system --create-namespace metrics-server bitnami/metrics-server \
--set apiService.create=true --set "extraArgs[0]=--kubelet-insecure-tls=true" --version 6.2.9
@echo "Waiting for metrics-server pod to be ready for listing metrics"
@kubectl --namespace metrics-system wait --for=condition=ready --timeout=320s pod -l app.kubernetes.io/instance=metrics-server

.PHONY: e2e-install
e2e-install: install-capsule install-capsule-proxy rbac-fix
e2e-install: install-capsule install-dependencies install-capsule-proxy rbac-fix

.PHONY: e2e-load-image
e2e-load-image: kind ko-build-all
Expand Down Expand Up @@ -184,12 +176,14 @@ ifeq ($(CAPSULE_PROXY_MODE),http)
--set "image.tag=$(VERSION)" \
--set "options.enableSSL=false" \
--set "options.logLevel=10" \
--set "options.pprof=true" \
--set "service.type=NodePort" \
--set "service.nodePort=" \
--set "kind=DaemonSet" \
--set "daemonset.hostNetwork=true" \
--set "serviceMonitor.enabled=false" \
--set "options.generateCertificates=false" \
--set "webhooks.enabled=true" \
--set "options.extraArgs={--feature-gates=ProxyClusterScoped=true,--feature-gates=ProxyAllNamespaced=true}"
else
@echo "Running in HTTPS mode"
Expand Down Expand Up @@ -220,15 +214,27 @@ else
--set "image.pullPolicy=Never" \
--set "image.tag=$(VERSION)" \
--set "options.logLevel=10" \
--set "options.pprof=true" \
--set "service.type=NodePort" \
--set "service.nodePort=" \
--set "kind=DaemonSet" \
--set "daemonset.hostNetwork=true" \
--set "serviceMonitor.enabled=false" \
--set "webhooks.enabled=true" \
--set "options.extraArgs={--feature-gates=ProxyClusterScoped=true,--feature-gates=ProxyAllNamespaced=true}"
endif
@kubectl rollout restart ds capsule-proxy -n capsule-system || true

install-dependencies: install-capsule
@helm repo add cert-manager https://charts.jetstack.io
@helm repo add bitnami https://charts.bitnami.com/bitnami
@helm repo update
@helm upgrade --install cert-manager cert-manager/cert-manager --namespace cert-manager --create-namespace --version 1.16.2 --set crds.enabled=true
@helm upgrade --install --namespace metrics-system --create-namespace metrics-server bitnami/metrics-server \
--set apiService.create=true --set "extraArgs[0]=--kubelet-insecure-tls=true" --version 6.2.9
@kubectl --namespace metrics-system wait --for=condition=ready --timeout=320s pod -l app.kubernetes.io/instance=metrics-server


rbac-fix:
@echo "RBAC customization..."
@kubectl create clusterrole capsule-selfsubjectaccessreviews --verb=create --resource=selfsubjectaccessreviews.authorization.k8s.io
Expand Down

0 comments on commit 405f4de

Please sign in to comment.