Skip to content

Commit e14a51a

Browse files
committed
chore: adding nodeshift features back to the example
1 parent b25f437 commit e14a51a

File tree

6 files changed

+2971
-25
lines changed

6 files changed

+2971
-25
lines changed

Diff for: .nodeshift/credentials-secret.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: "v1"
2+
kind: "Secret"
3+
metadata:
4+
name: "my-database-secret"
5+
stringData:
6+
user: "luke"
7+
password: "secret"

Diff for: .nodeshift/deployment.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
spec:
2+
template:
3+
spec:
4+
containers:
5+
- env:
6+
- name: DB_USERNAME
7+
valueFrom:
8+
secretKeyRef:
9+
name: my-database-secret
10+
key: user
11+
- name: DB_PASSWORD
12+
valueFrom:
13+
secretKeyRef:
14+
name: my-database-secret
15+
key: password
16+
readinessProbe:
17+
httpGet:
18+
path: /ready
19+
port: 8080
20+
scheme: HTTP
21+
failureThreshold: 3
22+
initialDelaySeconds: 10
23+
periodSeconds: 5
24+
successThreshold: 1
25+
timeoutSeconds: 1
26+
livenessProbe:
27+
httpGet:
28+
path: /live
29+
port: 8080
30+
scheme: HTTP
31+
failureThreshold: 2
32+
initialDelaySeconds: 60
33+
periodSeconds: 3
34+
successThreshold: 1
35+
timeoutSeconds: 1

Diff for: .nodeshift/route.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
spec:
2+
port:
3+
targetPort: 8080
4+
to:
5+
kind: Service

Diff for: README.md

+16
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,19 @@ You can then start the application like this:
2424

2525

2626
Then go to http://localhost:8080
27+
28+
#### Running on OpenShift
29+
30+
First, make sure you have an instance of OpenShift setup and are logged in using `oc login`.
31+
32+
Then create a new project using the `oc` commands
33+
34+
`oc new-project fun-node-fun`
35+
36+
For this example, you will also need a postgres db running on your OpenShift cluster.
37+
38+
`oc new-app -e POSTGRESQL_USER=luke -ePOSTGRESQL_PASSWORD=secret -ePOSTGRESQL_DATABASE=my_data centos/postgresql-10-centos7 --name=my-database`
39+
40+
Then run `npm run openshift` to deploy your app
41+
42+
Then you can navigate to the newly exposed route, something similar to "http://nodejs-rest-http-crud-boosters.192.168.99.100.nip.io/", this will probably be different based on your OpenShift IP address

0 commit comments

Comments
 (0)