暫無描述

Haytham Mohamed 6a70536f67 apply path rewrite to ingress and use nginx 3 年之前
.mvn 3c4854211d init 3 年之前
backend-service 8c86e97125 enable k8s probes 3 年之前
documentation a5a53a0c62 kubernetes version 3 年之前
frontend-service 8c86e97125 enable k8s probes 3 年之前
gateway a5a53a0c62 kubernetes version 3 年之前
infrastructure 6a70536f67 apply path rewrite to ingress and use nginx 3 年之前
k8s 6a70536f67 apply path rewrite to ingress and use nginx 3 年之前
.DS_Store 3c4854211d init 3 年之前
.gitignore 3c4854211d init 3 年之前
README.adoc aeac5b4f3d doc 3 年之前
mvnw 3c4854211d init 3 年之前
mvnw.cmd 3c4854211d init 3 年之前
pom.xml c9f20670c8 update 3 年之前

README.adoc


# Spring Cloud Gateway for Kubernetes

* make sure you have Docker running

* install Kind and a local registry in your local machine. You can use the provided script:

```shell
$ ./infrastructure/start-kind-registry.sh
```

* provided also the options to use either contour or ambassador ingress controller. Use either one of the following scripts to configure an ingress controller in Kind cluster. If you use contour ingress controller, then edit the
ingress YAML file `./k8s/install-ingress.yml` and make sure you use `ingressClassName: contour`, otherwise it should be
`ingressClassName: embassador`.

```shell
$ ./infrastructure/config-contour-ingress.sh
```

or

```shell
$ ./infrastructure/config-ambassador-ingress.sh
```

## Automatic

You can use the provided script `./k8s/setup.sh` to deploy SCG for k8s, a workload gateway instance
configured with routes, deploy the services and ingress. In the script, replace the variable `installer_dir`
to point to a directory where you extract SCG for k8s installer. The installer could be downloaded from
https://docs.pivotal.io/scg-k8s/1-0/installation.html[here]. You can follow the steps below to perform
all steps manually.

## Manual

* follow the instructions https://docs.pivotal.io/scg-k8s/1-0/installation.html[here] to install Spring Cloud Gateway for Kubernetes.

** per the instructions: to relocate the images do the following (installer_dir is where you extract SCG for K8s installer)
```shell
$ {installer_dir}/scripts/relocate-images.sh localhost:5000
```

** then run the installation

```shell
$ {installer_dir}/script/install-spring-cloud-gateway.sh
```

* create a gateway instance:

```shell
$ kubectl apply -f ./k8s/install-gateway.yml
```

* create gateway route configuration:

```shell
$ kubectl apply -f ./k8s/install-gateway-routes-config.yml
```

* create gateway route configuration and mappings:

```shell
$ kubectl apply -f ./k8s/install-gateway-mappings.yml
```

* build the project to create and push the images to the local registry. The plugin should create and push the image automatically by running this command (on the project root folder)

```shell
$ ./mvnw spring-boot:build-image
```

* install the frontend and backend services

```shell
$ kubectl apply -f ./k8s/install-services.yml
```

* create ingress

```shell
$ kubectl apply -f ./k8s/install-ingress.yml
```

* test by accessing the frontend service through ingress

```shell
$ curl http://localhost:80/frontend/
```