Skip to content

Commit c395b67

Browse files
authored
Merge pull request #13 from codezeron/test-dev
fix: fix deploy manifest files
2 parents 6b4ac37 + 06eac9a commit c395b67

File tree

8 files changed

+59
-85
lines changed

8 files changed

+59
-85
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ COPY ./todos.js todos.js
1414
COPY ./cron.js cron.js
1515

1616
EXPOSE 80
17-
ENTRYPOINT [ "node", "server" ]
17+
ENTRYPOINT [ "node", "cron" ]

cron.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
var CronJob = require('cron').CronJob;
2+
let porta = process.env.PORT || 80;
23
const { default: axios } = require('axios');
34
var express = require('express');
45
const http = require(`http`);
56
const app = express();
67
app.get(`/health`, (req, res) => res.status(200).json(`OK`));
78
const server = http.createServer(app);
89
server.listen(
9-
80,
10-
() => console.log(`-- Backend Service (80) --`)
10+
porta,
11+
() => console.log(`-- Backend Service (${porta}) --`)
1112
);
1213

1314
const job = new CronJob('0 */1 * * * *', async function () {

kustom-webapp/base/configmap.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

kustom-webapp/base/deployment.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

kustom-webapp/base/ingress.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

kustom-webapp/base/service.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.
File renamed without changes.

webapp/deployment.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: employee-app
5+
labels:
6+
app: employee-app
7+
spec:
8+
type: NodePort
9+
selector:
10+
app: employee-app
11+
ports:
12+
- port: 80
13+
targetPort: 80
14+
name: http
15+
---
16+
kind: Deployment
17+
apiVersion: apps/v1
18+
metadata:
19+
name: employee-app
20+
spec:
21+
replicas: 1
22+
selector:
23+
matchLabels:
24+
app: employee-app
25+
template:
26+
metadata:
27+
labels:
28+
app: employee-app
29+
version: v1
30+
spec:
31+
containers:
32+
- name: employee-app
33+
image: enzoyh/teste-repo:latest
34+
imagePullPolicy: Always
35+
ports:
36+
- containerPort: 80
37+
---
38+
apiVersion: networking.k8s.io/v1
39+
kind: Ingress
40+
metadata:
41+
name: example-ingress
42+
annotations:
43+
kubernetes.io/ingress.class: "nginx"
44+
nginx.ingress.kubernetes.io/rewrite-target: /$1
45+
spec:
46+
rules:
47+
- http:
48+
paths:
49+
- path: /testando
50+
pathType: Prefix
51+
backend:
52+
service:
53+
name: employee-app
54+
port:
55+
number: 80

0 commit comments

Comments
 (0)