Skip to content

Commit

Permalink
Standalone app router:
Browse files Browse the repository at this point in the history
- Update the README.md
- Use newest app router image
  • Loading branch information
abbi-gaurav committed Dec 27, 2023
1 parent c5830d7 commit 3ff3d09
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 32 deletions.
52 changes: 28 additions & 24 deletions standalone-approuter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,44 +40,48 @@ As a simple backend, we will use an HttpBin application that returns the request

## Steps

- Create a namespace dev
- Export environment variables

```shell script
kubectl create namespace dev
kubectl label namespaces dev istio-injection=enabled
```
```shell
export NS={your-namespace}
```

- Create the namespace and enable istio-injection if not already done.

```shell
kubectl create namespace ${NS}
kubectl label namespaces ${NS} istio-injection=enabled
```

- Deploy the backend service

```shell script
kubectl -n dev apply -f k8s/httpbin.yaml
```
```shell
kubectl -n ${NS} apply -f k8s/httpbin.yaml
```

- Create the XSUAA Instance.
- Update the [service instance definition](k8s/xsuaa-service-instance.yaml). Replace {CLUSTER_DOMAIN} with the domain of your cluster.
- Create the XSUAA Instance. Update the [service instance definition](k8s/xsuaa-service-instance.yaml). Replace {CLUSTER_DOMAIN} with the domain of your cluster.

```shell script
kubectl -n dev apply -f k8s/xsuaa-service-instance.yaml
```
```shell
kubectl -n ${NS} apply -f k8s/xsuaa-service-instance.yaml
```

- Create the destinations and routes configurations for the approuter

```shell script
kubectl -n dev apply -f k8s/config.yaml
```
```shell
kubectl -n ${NS} apply -f k8s/config.yaml
```

- Deploy the approuter

```shell script
kubectl -n dev apply -f k8s/deployment.yaml
```
```shell
kubectl -n ${NS} apply -f k8s/deployment.yaml
```

- Expose the approuter via APIRule
- Update the [APIRule](k8s/api-rule.yaml). Replace {CLUSTER_DOMAIN} with the domain of your cluster.
- Expose the approuter via APIRule.

```shell script
kubectl -n dev apply -f k8s/api-rule.yaml
```
```shell
kubectl -n ${NS} apply -f k8s/api-rule.yaml
```

## Accessing the Application

Expand Down
7 changes: 1 addition & 6 deletions standalone-approuter/k8s/api-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,4 @@ spec:
name: my-approuter
port: 5000
accessStrategies:
- handler: noop
mutators:
- handler: header
config:
headers:
x-forwarded-host: "my-approuter.{CLUSTER_DOMAIN}"
- handler: allow
2 changes: 1 addition & 1 deletion standalone-approuter/k8s/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
[
{
"name": "httpbin",
"url": "http://httpbin.dev.svc.cluster.local:8000",
"url": "http://httpbin:8000",
"forwardAuthToken": true
}
]
Expand Down
2 changes: 1 addition & 1 deletion standalone-approuter/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
secret:
secretName: my-xsuaa-binding
containers:
- image: sapse/approuter:11.3.2
- image: sapse/approuter:15.0.0
name: my-approuter
imagePullPolicy: Always
ports:
Expand Down

0 comments on commit 3ff3d09

Please sign in to comment.