-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yaml
121 lines (121 loc) · 2.82 KB
/
deploy.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
kind: Deployment
apiVersion: apps/v1
metadata:
name: bet-k8s-api
labels:
app.kubernetes.io/name: "bet-k8s-api"
app.kubernetes.io/part-of: "bet.k8s"
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: bet-k8s-api
template:
metadata:
labels:
app.kubernetes.io/name: "bet-k8s-api"
app.kubernetes.io/part-of: "bet.k8s"
spec:
containers:
- name: bet-k8s-api
image: kdcllc/bet:apihpa
imagePullPolicy: Always
env:
- name: DOTNET_LOGGING__CONSOLE__DISABLECOLORS
value: "true"
- name: ASPNETCORE_URLS
value: "http://*"
- name: PORT
value: "80"
- name: SERVICE__BET-K8S-API__PROTOCOL
value: "http"
- name: SERVICE__BET-K8S-API__PORT
value: "80"
- name: SERVICE__BET-K8S-API__HOST
value: "bet-k8s-api"
ports:
- containerPort: 80
resources:
requests:
memory: "64Mi"
cpu: "150m"
limits:
memory: "128Mi"
cpu: "250m"
---
kind: Service
apiVersion: v1
metadata:
name: bet-k8s-api
labels:
app.kubernetes.io/name: "bet-k8s-api"
app.kubernetes.io/part-of: "bet.k8s"
spec:
selector:
app.kubernetes.io/name: bet-k8s-api
type: ClusterIP
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
---
# https://cert-manager.io/docs/usage/ingress/
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: bet-k8s-api
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod-v1
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/$2"
labels:
app.kubernetes.io/part-of: "bet.k8s"
spec:
tls:
- hosts:
- betapi.kingdavidconsulting.com
secretName: betapi-secret-tls
rules:
- http:
paths:
- backend:
service:
name: bet-k8s-api
port:
number: 80
pathType: Prefix
path: /()(.*)
- host: betapi.kingdavidconsulting.com
http:
paths:
- backend:
service:
name: bet-k8s-api
port:
number: 80
pathType: Prefix
path: /()(.*)
---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: bet-k8s-api-hpa
spec:
maxReplicas: 10
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: bet-k8s-api
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 60
behavior:
scaleDown:
stabilizationWindowSeconds: 60