-
Notifications
You must be signed in to change notification settings - Fork 2
/
dotnet-core-on-k8s.yaml
93 lines (92 loc) · 1.85 KB
/
dotnet-core-on-k8s.yaml
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
85
86
87
88
89
90
91
92
93
apiVersion: v1
kind: Namespace
metadata:
name: fire-ug
---
apiVersion: v1
kind: Service
metadata:
name: dotnetcoreonk8s
namespace: fire-ug
spec:
selector:
app: dotnetcoreonk8s
type: NodePort
ports:
- port: 80
targetPort: 80
nodePort: 30080
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: log-pvc
namespace: fire-ug
spec:
accessModes:
- ReadWriteMany
storageClassName: manual
resources:
requests:
storage: 1Gi
selector:
matchLabels:
pv: log
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dotnetcoreonk8s
namespace: fire-ug
spec:
selector:
matchLabels:
app: dotnetcoreonk8s
replicas: 2
minReadySeconds: 5
strategy:
# indicate which strategy we want for rolling update
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
app: dotnetcoreonk8s
spec:
containers:
- name: dotnetcoreonk8s
image: liuzhenyulive/dotnet-core-on-k8s:10
resources:
requests:
cpu: 100m
limits:
cpu: 200m
ports:
- containerPort: 80
name: dotnetcoreonk8s
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- mountPath: /app/log
name: log-pvc
volumes:
- name: log-pvc
persistentVolumeClaim:
claimName: log-pvc