Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Commit 7e6bcd3

Browse files
yangcao77jhutar
authored andcommitted
devfile: add svc and endpoint definition (nodeshift-starters#19)
* update resource values * update sample Signed-off-by: Stephanie <[email protected]>
1 parent 5a85014 commit 7e6bcd3

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

outerloop-deploy.yaml renamed to deploy.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,16 @@ spec:
2323
limits:
2424
memory: "1024Mi"
2525
cpu: "500m"
26+
---
27+
kind: Service
28+
apiVersion: v1
29+
metadata:
30+
name: my-nodejs-svc
31+
spec:
32+
ports:
33+
- name: http-3001
34+
port: 3001
35+
protocol: TCP
36+
targetPort: 3001
37+
selector:
38+
app: nodejs-app

devfile.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schemaVersion: 2.2.0
22
metadata:
33
name: nodejs
4-
version: 2.0.0
4+
version: 2.1.0
55
displayName: Node.js Runtime
66
description: Stack with Node.js 16
77
tags: ["NodeJS", "Express", "ubi8"]
@@ -15,14 +15,14 @@ parent:
1515
id: nodejs
1616
registryUrl: "https://registry.devfile.io"
1717
components:
18-
- name: outerloop-build
18+
- name: image-build
1919
image:
2020
imageName: nodejs-image:latest
2121
dockerfile:
2222
uri: Dockerfile
2323
buildContext: .
2424
rootRequired: false
25-
- name: outerloop-deploy
25+
- name: kubernetes-deploy
2626
attributes:
2727
deployment/replicas: 1
2828
deployment/cpuLimit: "100m"
@@ -31,14 +31,18 @@ components:
3131
deployment/memoryRequest: 50Mi
3232
deployment/container-port: 3001
3333
kubernetes:
34-
uri: outerloop-deploy.yaml
34+
uri: deploy.yaml
35+
endpoints:
36+
- name: http-3001
37+
targetPort: 3001
38+
path: /
3539
commands:
3640
- id: build-image
3741
apply:
38-
component: outerloop-build
42+
component: image-build
3943
- id: deployk8s
4044
apply:
41-
component: outerloop-deploy
45+
component: kubernetes-deploy
4246
- id: deploy
4347
composite:
4448
commands:

0 commit comments

Comments
 (0)