Skip to content

Commit 468bd0b

Browse files
committed
minor updates for istio configs and context scraper
1 parent 75071b3 commit 468bd0b

File tree

14 files changed

+70
-102
lines changed

14 files changed

+70
-102
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ Apache 2.0.
9696
[1]: https://github.com/dudash/openshift-microservices/issues
9797
[2]: https://github.com/dudash/openshift-microservices/labels/discussion
9898

99-
[openshift-heximage]: https://img.shields.io/badge/openshift-3.11-BB261A.svg
100-
[openshift-url]: https://docs.openshift.com/container-platform/3.11/welcome/index.html
99+
[openshift-heximage]: https://img.shields.io/badge/openshift-4.3-BB261A.svg
100+
[openshift-url]: https://docs.openshift.com/container-platform/4.3/welcome/index.html

Diff for: code/context-scraper/.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,9 @@ testem.log
4444
Thumbs.db
4545

4646
# Mock API
47-
/api/node_modules
47+
/api/node_modules
48+
49+
# nodeshift and odo
50+
tmp/*
51+
.odo/*
52+
.odo/odo-file-index.json

Diff for: code/context-scraper/README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,18 @@ In another terminal you can test with:
5858
$ http GET localhost:8080/scrape/custom_search?term==YOUR_TERM_HERE
5959
```
6060

61-
### Running on OpenShift
61+
### Deploy / Run / Test Local Code to OpenShift - The easy way
62+
We can use odo to do our OpenShift deployments and iterations on code/test:
63+
```
64+
odo component create nodejs context-scraper --now
65+
```
66+
67+
### Deploy / Run / Test Local Code to OpenShift - The complicated but configurable YAML way
6268
You can use a template to create all the build and deployment resources for OpenShift. Here's an example that overrides the defaults:
6369
```bash
6470
oc new-app -f ../../deployment/install/microservices/openshift-configuration/context-scraper-fromsource.yaml \
6571
-p APPLICATION_NAME=context-scraper \
66-
-p NODEJS_VERSION_TAG=8-RHOAR \
72+
-p NODEJS_VERSION_TAG=12 \
6773
-p GIT_BRANCH=develop \
6874
-p GIT_URI=https://github.com/dudash/openshift-microservices.git
6975
```
@@ -74,7 +80,7 @@ Note: the template uses S2I which pulls from git and builds the container image
7480
You can use [s2i][5] to easily build this into a container image. For example to use the OpenShift runtimes node.js as our base:
7581
```bash
7682
rm -rf node_modules
77-
s2i build . registry.access.redhat.com/ubi7/nodejs-8 openshift-microservices-context-scraper --loglevel 3
83+
s2i build . registry.access.redhat.com/ubi8/nodejs-12 openshift-microservices-context-scraper --loglevel 3
7884
```
7985
Note: we remove the node_modules to avoid conflicts during the build process
8086

Diff for: code/context-scraper/package-lock.json

+29-43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: deployment/install/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ This folder contains instructions on how to configure and install dependencies o
33

44
Some notes on configuration file paths:
55
- `.s2i` folders will go in each microservice along with the code (because it's a service specific build-time config)
6+
- other openshift build-time resources can live with the microservice in a `.openshift` folder (if it has something to do with the build)
7+
- `.odo` folders are config we are currently considering developer specific (so currently `.gitignore'd`)
68
- openshift/kubernetes resources required for running will live in `deployment/install/microservices/openshift-configuration/*.yaml`
79
- istio resources will live in the folders `deployment/install/microservices/istio-configuration/*.yaml`
810
- optional openshift resources for specific demo purposes can live in `deployment/demos/DEMOXYZ/openshift-configuration/*.yaml`
911
- optional istio resources for specific demo purposes can live in `deployment/demos/DEMOXYZ/istio-configuration/*.yaml`
10-
- openshift build-time resources can live with the microservice in a `.openshift` folder (if it has something to do with the build)
1112

1213
To get up and running you'll need to setup the platform dependencies on your cluster. Once those are available, follow the steps to install the application.
1314

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Istio configuration
2-
The files in here configure the microservices demo app to leverage Istio capabilities as part of OpenShift. Note that OpenShift provides some additional capability beyond community Istio that might affect the config. Things like automatic route creation, this is outlined [in the docs](https://docs.openshift.com/container-platform/3.11/servicemesh-install/servicemesh-install.html#servicemesh-istio-comparison).
2+
The files in here configure the microservices demo app to leverage Istio capabilities as part of OpenShift. Note that OpenShift provides some additional capability beyond community Istio that might affect the config. Things like automatic route creation, this is outlined [in the docs](https://docs.openshift.com/container-platform/4.3/service_mesh/service_mesh_arch/ossm-vs-community.html).

Diff for: deployment/install/microservices/istio-configuration/destinationrules.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# These are a set of destination rules that can be used
22
# as a simple base for more advanced demos to build upon
3+
#
4+
# you use destination rules to configure what happens to traffic (the destination itself is set in a virtual service)
5+
# Destination rules are applied after virtual service routing rules are evaluated
6+
# read more here: https://istio.io/docs/reference/config/networking/destination-rule/
37
apiVersion: networking.istio.io/v1alpha3
48
kind: DestinationRule
59
metadata:
@@ -27,3 +31,10 @@ metadata:
2731
name: context-scraper
2832
spec:
2933
host: context-scraper
34+
---
35+
apiVersion: networking.istio.io/v1alpha3
36+
kind: DestinationRule
37+
metadata:
38+
name: userprofile
39+
spec:
40+
host: userprofile

Diff for: deployment/install/microservices/istio-configuration/ingress-gateway.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
# around from domain to domain and cluster to cluster. You can easily scope it
1212
# to run with custom ingress by adding one or more explicit hosts in place of '*'.
1313
#
14-
# Also, OpenShift *should* automatically create routes for me based on this:
15-
# https://docs.openshift.com/container-platform/3.11/servicemesh-install/servicemesh-install.html#automatic-route-creation
1614
apiVersion: networking.istio.io/v1alpha3
1715
kind: Gateway
1816
metadata:

Diff for: deployment/install/microservices/istio-configuration/virtual-services.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# These are a set of virtual service routes that can be used
22
# as a simple base for more advanced demos to build upon
3+
#
4+
# A virtual service lets you configure how requests are routed to a service within the service mesh
5+
# They decouple where a client sends a request from the actual destination that processes the request
36
apiVersion: networking.istio.io/v1alpha3
47
kind: VirtualService
58
metadata:

Diff for: deployment/install/microservices/openshift-configuration/auth-sso73-x509.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ objects:
4343
ports:
4444
- port: 8443
4545
targetPort: 8443
46+
name: https
4647
selector:
4748
deploymentConfig: ${APPLICATION_NAME}
4849
- apiVersion: v1
@@ -57,6 +58,7 @@ objects:
5758
ports:
5859
- port: 5432
5960
targetPort: 5432
61+
name: tcp-postgres
6062
selector:
6163
deploymentConfig: ${APPLICATION_NAME}-postgresql
6264
- apiVersion: v1

Diff for: deployment/install/microservices/openshift-configuration/userprofile-fromsource-jvm.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ objects:
3232
name: ${APPLICATION_NAME}
3333
spec:
3434
ports:
35-
- name: 8080-tcp
35+
- name: http
3636
port: 8080
37-
protocol: TCP
3837
targetPort: 8080
3938
selector:
4039
deploymentconfig: ${APPLICATION_NAME}

Diff for: deployment/install/microservices/openshift-configuration/userprofile-fromsource.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ objects:
3333
name: ${APPLICATION_NAME}
3434
spec:
3535
ports:
36-
- name: 8080-tcp
36+
- name: http
3737
port: 8080
38-
protocol: TCP
3938
targetPort: 8080
4039
selector:
4140
deploymentconfig: ${APPLICATION_NAME}
@@ -248,7 +247,7 @@ objects:
248247
name: '${DATABASE_SERVICE_NAME}'
249248
spec:
250249
ports:
251-
- name: postgresql
250+
- name: tcp-postgresql
252251
nodePort: 0
253252
port: 5432
254253
protocol: TCP

Diff for: deployment/install/microservices/openshift-configuration/userprofile.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ objects:
3030
name: ${APPLICATION_NAME}
3131
spec:
3232
ports:
33-
- name: 8080-tcp
33+
- name: http
3434
port: 8080
35-
protocol: TCP
3635
targetPort: 8080
3736
selector:
3837
deploymentconfig: ${APPLICATION_NAME}
@@ -170,7 +169,7 @@ objects:
170169
name: '${DATABASE_SERVICE_NAME}'
171170
spec:
172171
ports:
173-
- name: postgresql
172+
- name: tcp-postgresql
174173
nodePort: 0
175174
port: 5432
176175
protocol: TCP

Diff for: deployment/install/sso/README.md

-41
This file was deleted.

0 commit comments

Comments
 (0)