Skip to content

Commit

Permalink
first istio steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dbadura committed Dec 30, 2024
1 parent 3f42b81 commit 7875c80
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 39 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ To install busola on k8s cluster run:
(cd resources && kustomize build base/ | kubectl apply -f- )
```

To install busola with istio gateway please prepare `DOMAIN`, go to `resources` and run:
To install busola using specific environment configuration, set `ENVIRONMENT` environment variable and run:

```shell
./apply-resources-istio.sh ${YOUR_DOMAIN}
(cd resources && kustomize build environments/${ENVIRONMENT} | kubectl apply -f- )
```

### Access busola installed on Kubernetes
Expand All @@ -214,9 +214,13 @@ Install ingress resources by running:

Then go to `localhost`

### Istio-ingress gateway
### Istio

TODO: access via istio ingress
To install Istio needed resources, prepare `DOMAIN`and run:

```shell
(cd resources && ./apply-resources-istio.sh ${YOUR_DOMAIN})
```

## Troubleshooting

Expand Down
11 changes: 7 additions & 4 deletions resources/apply-resources-istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ if [ -z "$1" ] ; then
fi

export DOMAIN=$1
export NAMESPACE=${2:-busola}
export ENVIRONMENT=$3
export NAMESPACE=${2:-default}
TMP_DIR="../temp/resources"

./apply-resources.sh "$@"

envsubst < "${TMP_DIR}"/istio/virtualservice-busola.tpl.yaml > "${TMP_DIR}"/istio/virtualservice-busola.yaml
mkdir -p "${TMP_DIR}"
cp -rf . "${TMP_DIR}"
#./apply-resources.sh "$@"

envsubst < "${TMP_DIR}"/istio/gateway.tpl.yaml > "${TMP_DIR}"/istio/gateway.yaml
envsubst < "${TMP_DIR}"/istio/http_route.tpl.yaml > "${TMP_DIR}"/istio/http_route.yaml

kubectl apply -k "${TMP_DIR}"/istio --namespace=$NAMESPACE
9 changes: 0 additions & 9 deletions resources/istio/destinationrule-busola-backend.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions resources/istio/gateway.tpl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: busola
namespace: ${NAMESPACE}
spec:
gatewayClassName: istio
listeners:
- name: http
hostname: ${DOMAIN}
port: 80
protocol: HTTP
allowedRoutes:
namespaces:
from: Same
18 changes: 18 additions & 0 deletions resources/istio/http_route.tpl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: httproute
namespace: ${NAMESPACE}
spec:
parentRefs:
- name: gateway
hostnames: ['${DOMAIN}']
rules:
- matches:
- path:
type: PathPrefix
value: /headers
backendRefs:
- name: busola
namespace: ${NAMESPACE}
port: 3001
3 changes: 2 additions & 1 deletion resources/istio/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- virtualservice-busola.yaml
- gateway.yaml
- http_route.yaml
# Add the destinationrule for TLS into the backend pod.
# This will tell the istio sidecar to use TLS to connect to the backend service.
# For this to work, you need to enable TLS in the backend. See docs/install-kyma-dashboard-manually.md for more information.
Expand Down
21 changes: 0 additions & 21 deletions resources/istio/virtualservice-busola.tpl.yaml

This file was deleted.

0 comments on commit 7875c80

Please sign in to comment.