-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.yml
84 lines (81 loc) · 1.87 KB
/
api.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
apiVersion: apps/v1
kind: Deployment
metadata:
# Replace NEW with your API name
name: NEW-api
labels:
app: NEW-api
spec:
replicas: 1
selector:
matchLabels:
app: NEW-api
template:
metadata:
labels:
app: NEW-api
spec:
terminationGracePeriodSeconds: 10
volumes:
- name: keyfiles
secret:
secretName: keyfile
containers:
- name: NEW-api
# This is the docker image name from your Makefile
image: projectepic/API_NAME:1.0.0
imagePullPolicy: Always
volumeMounts:
- mountPath: /private
name: keyfiles
resources:
limits:
memory: 700Mi
cpu: "80m"
requests:
memory: 500Mi
cpu: "80m"
ports:
- containerPort: 8080
- containerPort: 8081
livenessProbe:
periodSeconds: 60
httpGet:
path: /healthcheck
port: 8081
initialDelaySeconds: 120
timeoutSeconds: 5
readinessProbe:
periodSeconds: 20
httpGet:
path: /healthcheck
port: 8081
initialDelaySeconds: 40
timeoutSeconds: 5
env:
# Google credentials for authentification
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /private/keyfile.json
# Credentials to access database as environment variables
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: credentials
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: credentials
key: password
---
apiVersion: v1
kind: Service
metadata:
name: NEW-api
spec:
type: NodePort
ports:
- port: 8080
name: client
selector:
app: NEW-api