Skip to content

Commit e571f4f

Browse files
committed
add proxy path example
1 parent 0d2e2ee commit e571f4f

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

ff-test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# /bin/sh
2+
3+
4+
PROXY_HOST=ff-proxy.k8s.rileysnyder.dev
5+
PROXY_PATH=ff-proxy
6+
TARGET=proxytest
7+
API_KEY=b89d7f72-547f-49df-b8a4-70a24efd2171
8+
9+
# Authenticate as Client SDK with target
10+
AUTH_TOKEN=$(curl -s -X POST "https://$PROXY_HOST/$PROXY_PATH/client/auth" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"apiKey\":\"$API_KEY\",\"target\":{\"identifier\":\"$TARGET\"}}" | jq -r '.authToken')
11+
12+
# Get custer id and env id from the token
13+
CLUSTER_ID=$(echo $AUTH_TOKEN | jq -R 'split(".") | .[1] | @base64d | fromjson' | jq -r '.clusterIdentifier')
14+
ENV_ID=$(echo $AUTH_TOKEN | jq -R 'split(".") | .[1] | @base64d | fromjson' | jq -r '.environment')
15+
16+
echo "auth token: $AUTH_TOKEN"
17+
echo "cluster id: $CLUSTER_ID"
18+
echo "env id: $ENV_ID"

k8s/ff-proxy.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
apiVersion: helm.cattle.io/v1
3+
kind: HelmChart
4+
metadata:
5+
name: ff-proxy
6+
spec:
7+
repo: https://rssnyder.github.io/charts
8+
chart: ff-proxy
9+
targetNamespace: default
10+
valuesContent: |-
11+
proxyKey: 55f07224-59bc-430c-abad-c0c631252fb2
12+
authSecret: fooBar
13+
redis:
14+
address: redis.redis:6379
15+
16+
---
17+
apiVersion: networking.k8s.io/v1
18+
kind: Ingress
19+
metadata:
20+
name: ff-proxy
21+
annotations:
22+
nginx.ingress.kubernetes.io/use-regex: "true"
23+
nginx.ingress.kubernetes.io/rewrite-target: /$2
24+
spec:
25+
ingressClassName: nginx
26+
rules:
27+
- host: ff-proxy.k8s.rileysnyder.dev
28+
http:
29+
paths:
30+
- path: /ff-proxy(/|$)(.*)
31+
pathType: ImplementationSpecific
32+
backend:
33+
service:
34+
name: ff-proxy-read-replica
35+
port:
36+
number: 7000

0 commit comments

Comments
 (0)