-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebdemo.yaml
More file actions
71 lines (67 loc) · 1.41 KB
/
webdemo.yaml
File metadata and controls
71 lines (67 loc) · 1.41 KB
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
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${APP_NAME}
spec:
replicas: 1
selector:
matchLabels:
app: ${APP_NAME}
template:
metadata:
labels:
app: ${APP_NAME}
spec:
containers:
- name: ${APP_NAME}
DOCKER_IMAGE_NAME: ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}
imagePullPolicy: Always
env:
- name: env
value: "testing"
ports:
- containerPort: 18080
name: ${APP_NAME}
protocol: TCP
resources:
limits:
cpu: 1.5
requests:
cpu: 500m
volumeMounts:
- name: app-log-volume
mountPath: /var/log/webDemo/
volumes:
- name: app-log-volume
hostPath:
# directory location on host
path: /var/log/k8s-mount/webDemo
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: ${APP_NAME}
spec:
selector:
app: ${APP_NAME}
type: NodePort
ports:
- name: ${APP_NAME}
port: 18080
nodePort: ${HOST_PORT}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: ${APP_NAME}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: ${APP_NAME}
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 50