Skip to content

chore: adding nodeshift features back to the example #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .nodeshift/credentials-secret.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: "v1"
kind: "Secret"
metadata:
name: "my-database-secret"
stringData:
user: "luke"
password: "secret"
35 changes: 35 additions & 0 deletions .nodeshift/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
spec:
template:
spec:
containers:
- env:
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: my-database-secret
key: user
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: my-database-secret
key: password
readinessProbe:
httpGet:
path: /ready
port: 8080
scheme: HTTP
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
livenessProbe:
httpGet:
path: /live
port: 8080
scheme: HTTP
failureThreshold: 2
initialDelaySeconds: 60
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 1
5 changes: 5 additions & 0 deletions .nodeshift/route.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
spec:
port:
targetPort: 8080
to:
kind: Service
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,19 @@ You can then start the application like this:


Then go to http://localhost:8080

#### Running on OpenShift

First, make sure you have an instance of OpenShift setup and are logged in using `oc login`.

Then create a new project using the `oc` commands

`oc new-project fun-node-fun`

For this example, you will also need a postgres db running on your OpenShift cluster.

`oc new-app -e POSTGRESQL_USER=luke -ePOSTGRESQL_PASSWORD=secret -ePOSTGRESQL_DATABASE=my_data centos/postgresql-10-centos7 --name=my-database`

Then run `npm run openshift` to deploy your app

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
Loading