Skip to content

Commit 7841656

Browse files
author
José Carlos Chávez
committed
chore: drops ingress and uses trafficgen.
1 parent a582e98 commit 7841656

File tree

8 files changed

+43
-69
lines changed

8 files changed

+43
-69
lines changed

examples/istio/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,15 @@ patch-envoy-extauthz:
5353

5454
install-istio:
5555
@$(ISTIOCTL) install --set profile=demo -c $(KUBECONFIG) -y
56-
# follows https://medium.com/@s4l1h/how-to-install-kind-and-istio-ingress-controller-3b510834c762
57-
@$(KUBECTL) patch deployments.apps -o yaml -n istio-system istio-ingressgateway -p '{"spec":{"template":{"spec":{"containers":[{"name":"istio-proxy","ports":[{"containerPort":8080,"hostPort":80},{"containerPort":8443,"hostPort":443}]}]}}}}'
5856

5957
deploy: install-istio
6058
@$(MAKE) -C ../../extauthz docker BUILD_OS=linux BUILD_ARCH=$(BUILD_ARCH) DOCKER_VERSION=example-istio
6159
@docker tag ghcr.io/openfga/openfga-extauthz:example-istio ghcr.io/openfga/openfga-extauthz:0.0.1
6260
@$(KIND) load docker-image --name $(CLUSTER_NAME) ghcr.io/openfga/openfga-extauthz:0.0.1
6361

6462
@docker rmi ghcr.io/jcchavezs/httpmole:0.0.1 > /dev/null || true
65-
@docker pull --platform=linux/$(BUILD_ARCH) ghcr.io/jcchavezs/httpmole:main
66-
@docker tag ghcr.io/jcchavezs/httpmole:main ghcr.io/jcchavezs/httpmole:0.0.1
63+
@docker pull --platform=linux/$(BUILD_ARCH) ghcr.io/jcchavezs/httpmole:0.2.0
64+
@docker tag ghcr.io/jcchavezs/httpmole:0.2.0 ghcr.io/jcchavezs/httpmole:0.0.1
6765
@$(KIND) load docker-image --name $(CLUSTER_NAME) ghcr.io/jcchavezs/httpmole:0.0.1
6866

6967
@$(KUBECTL) apply -f ./manifests/apps
@@ -78,6 +76,6 @@ destroy-cluster:
7876
@$(KIND) delete cluster --name $(CLUSTER_NAME)
7977

8078
kubeconfig:
81-
@echo "ACTION REQUIRED: Paste from clipboard in your terminal and hit 'return/enter'"
79+
@echo "\nACTION REQUIRED: Paste from clipboard in your terminal and hit 'return/enter'\n"
8280
@echo "export KUBECONFIG=\"$(KUBECONFIG)\"" | pbcopy
8381

examples/istio/kind-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@ nodes:
1616
hostPort: 80
1717
protocol: TCP
1818
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
19-
- containerPort: 8080
20-
hostPort: 8080
21-
protocol: TCP
22-
listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
2319
- containerPort: 443
2420
hostPort: 443
2521
protocol: TCP
2622
- role: worker
27-
- role: worker
23+
- role: worker

examples/istio/manifests/apps/ingress.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

examples/istio/manifests/apps/service-a.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ metadata:
3131
spec:
3232
ports:
3333
- name: web
34-
port: 10080
34+
port: 80
3535
targetPort: web
3636
selector:
3737
app: app-a

examples/istio/manifests/apps/service-b.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ metadata:
3131
spec:
3232
ports:
3333
- name: web
34-
port: 10080
34+
port: 80
3535
targetPort: web
3636
selector:
3737
app: app-b
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: trafficgen
5+
labels:
6+
istio-injection: enabled
7+
---
8+
apiVersion: apps/v1
9+
kind: Deployment
10+
metadata:
11+
name: trafficgenerator
12+
namespace: trafficgen
13+
labels:
14+
app: trafficgenerator
15+
spec:
16+
replicas: 1
17+
selector:
18+
matchLabels:
19+
app: trafficgenerator
20+
template:
21+
metadata:
22+
labels:
23+
app: trafficgenerator
24+
spec:
25+
containers:
26+
- name: trafficgenerator
27+
image: appropriate/curl
28+
args:
29+
- /bin/sh
30+
- -c
31+
- |
32+
while :; do
33+
curl -i http://app-a.apps.svc/proxy/app-b.apps.svc
34+
sleep 20
35+
done

examples/istio/manifests/extauthz/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: v1
22
kind: ConfigMap
33
metadata:
44
name: exthauthz-config
5+
namespace: openfga
56
data:
67
config.yaml: |
78
server:

examples/istio/manifests/extauthz/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
- image: ghcr.io/openfga/openfga-extauthz:0.0.1
3636
command:
3737
- "/envoy-extauthz"
38-
- "--config-path"
38+
- "--config"
3939
- "/etc/extauthz/config.yaml"
4040
imagePullPolicy: IfNotPresent
4141
name: extauthz

0 commit comments

Comments
 (0)