Skip to content

Commit

Permalink
fix istioctl deployment (#371)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Cattermole <[email protected]>
  • Loading branch information
eguzki and adam-cattermole authored Dec 14, 2023
1 parent 0355953 commit 78b3b9e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,13 @@ local-deploy: ## Deploy Kuadrant Operator in the cluster pointed by KUBECONFIG
@echo
@echo "Now you can export the kuadrant gateway by doing:"
@echo "kubectl port-forward -n istio-system service/istio-ingressgateway-istio 9080:80 &"
@echo "after that, you can curl -H \"Host: myhost.com\" localhost:9080"
@echo "-- Linux only -- Ingress gateway is exported using nodePort service in port 9080"
@echo "curl -H \"Host: myhost.com\" localhost:9080"
@echo "export GATEWAY_URL=localhost:9080"
@echo "after that, you can curl -H \"Host: myhost.com\" \$$GATEWAY_URL"
@echo "-- Linux only -- Ingress gateway is exported using loadbalancer service in port 80"
@echo "export INGRESS_HOST=\$$(kubectl get gtw istio-ingressgateway -n istio-system -o jsonpath='{.status.addresses[0].value}')"
@echo "export INGRESS_PORT=\$$(kubectl get gtw istio-ingressgateway -n istio-system -o jsonpath='{.spec.listeners[?(@.name==\"http\")].port}')"
@echo "export GATEWAY_URL=\$$INGRESS_HOST:\$$INGRESS_PORT"
@echo "curl -H \"Host: myhost.com\" \$$GATEWAY_URL"
@echo

.PHONY: local-setup
Expand All @@ -305,6 +309,7 @@ local-cluster-setup: ## Sets up Kind cluster with GatewayAPI manifests and istio
$(MAKE) kind-create-cluster
$(MAKE) namespace
$(MAKE) gateway-api-install
$(MAKE) install-metallb
$(MAKE) istio-install
$(MAKE) install-cert-manager
$(MAKE) deploy-gateway
Expand All @@ -320,6 +325,7 @@ local-env-setup: ## Deploys all services and manifests required by kuadrant to r
test-env-setup: ## Deploys all services and manifests required by kuadrant to run on CI.
$(MAKE) namespace
$(MAKE) gateway-api-install
$(MAKE) install-metallb
$(MAKE) istio-install
$(MAKE) install-cert-manager
$(MAKE) deploy-gateway
Expand Down
27 changes: 1 addition & 26 deletions config/dependencies/istio/istio-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,8 @@ spec:
- enabled: false
name: istio-egressgateway
ingressGateways:
- enabled: true
- enabled: false
name: istio-ingressgateway
k8s:
service:
type: NodePort
ports:
- name: status-port
port: 15021
protocol: TCP
targetPort: 15021
- name: http2
port: 80
protocol: TCP
targetPort: 8080
nodePort: 30950
- name: https
port: 443
protocol: TCP
targetPort: 8443
nodePort: 30951
resources:
requests:
cpu: "0"
pilot:
enabled: true
k8s:
Expand All @@ -48,9 +27,5 @@ spec:
values:
pilot:
autoscaleEnabled: false
gateways:
istio-ingressgateway:
type: ClusterIP
autoscaleEnabled: false
global:
istioNamespace: istio-system
7 changes: 5 additions & 2 deletions doc/user-guides/authenticated-rl-for-app-developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toy -i
> **Note**: If the command above fails to hit the Toy Store API on your environment, try forwarding requests to the service and accessing over localhost:
>
> ```sh
> kubectl port-forward -n istio-system service/istio-ingressgateway 9080:80 2>&1 >/dev/null &
> curl -H 'Host: api.toystore.com' http://localhost:9080/toy -i
> kubectl port-forward -n istio-system service/istio-ingressgateway-istio 9080:80 2>&1 >/dev/null &
> export GATEWAY_URL=localhost:9080
> ```
> ```sh
> curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toy -i
> # HTTP/1.1 200 OK
> ```
Expand Down
7 changes: 5 additions & 2 deletions doc/user-guides/authenticated-rl-with-jwt-and-k8s-authnz.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ It should return `200 OK`.
> **Note**: If the command above fails to hit the Toy Store API on your environment, try forwarding requests to the service and accessing over localhost:
>
> ```sh
> kubectl port-forward -n istio-system service/istio-ingressgateway 9080:80 2>&1 >/dev/null &
> curl -H 'Host: api.toystore.com' http://localhost:9080/toy -i
> kubectl port-forward -n istio-system service/istio-ingressgateway-istio 9080:80 2>&1 >/dev/null &
> export GATEWAY_URL=localhost:9080
> ```
> ```sh
> curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toy -i
> # HTTP/1.1 200 OK
> ```
Expand Down
9 changes: 7 additions & 2 deletions doc/user-guides/simple-rl-for-app-developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,15 @@ curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toys -i
# HTTP/1.1 200 OK
```

> **Note**: If the command above fails to hit the Toy Store API on your environment, try forwarding requests to the service:
> **Note**: If the command above fails to hit the Toy Store API on your environment, try forwarding requests to the service and accessing over localhost:
>
> ```sh
> kubectl port-forward -n istio-system service/istio-ingressgateway 9080:80 2>&1 >/dev/null &
> kubectl port-forward -n istio-system service/istio-ingressgateway-istio 9080:80 2>&1 >/dev/null &
> export GATEWAY_URL=localhost:9080
> ```
> ```sh
> curl -H 'Host: api.toystore.com' http://$GATEWAY_URL/toys -i
> # HTTP/1.1 200 OK
> ```
### ③ Enforce rate limiting on requests to the Toy Store API
Expand Down
2 changes: 0 additions & 2 deletions make/istio.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ istioctl-verify-install: istioctl ## Verify istio installation.

.PHONY: sail-install
sail-install: kustomize
$(MAKE) install-metallb
$(KUSTOMIZE) build $(ISTIO_INSTALL_DIR)/sail | kubectl apply -f -
kubectl -n istio-system wait --for=condition=Available deployment istio-operator --timeout=300s
kubectl apply -f $(ISTIO_INSTALL_DIR)/sail/istio.yaml
Expand All @@ -50,7 +49,6 @@ sail-install: kustomize
sail-uninstall: kustomize
kubectl delete -f $(ISTIO_INSTALL_DIR)/sail/istio.yaml
$(KUSTOMIZE) build $(ISTIO_INSTALL_DIR)/sail | kubectl delete -f -
$(MAKE) uninstall-metallb

.PHONY: istio-install
istio-install:
Expand Down

0 comments on commit 78b3b9e

Please sign in to comment.