-
Notifications
You must be signed in to change notification settings - Fork 4
/
gorestapi.yml
106 lines (106 loc) · 3.1 KB
/
gorestapi.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: gorestapi
labels:
app: gorestapi
component: gorestapi
spec:
serviceName: svc-gorestapi
podManagementPolicy: Parallel # Default is OrderedReady
replicas: 2 # Default is 1
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
app: gorestapi # Has to match .spec.template.metadata.labels
component: gorestapi
template:
metadata:
labels:
app: gorestapi # Has to match .spec.selector.matchLabels
component: gorestapi
spec:
terminationGracePeriodSeconds: 10
# affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: app
# operator: In
# values:
# - gorestapi
# topologyKey: "kubernetes.io/hostname"
containers:
- name: gorestapi
image: khteh/gorestapi:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
name: https
protocol: TCP
# hostPort: 8082
readinessProbe:
httpGet:
path: /ready
port: https
scheme: HTTPS
initialDelaySeconds: 20
periodSeconds: 5
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
livenessProbe:
httpGet:
path: /live
port: https
scheme: HTTPS
initialDelaySeconds: 20
periodSeconds: 3
timeoutSeconds: 10
failureThreshold: 3
successThreshold: 1
resources:
limits:
cpu: 500m
memory: 2Gi
- name: fluentd
image: khteh/fluentd:latest
volumeMounts:
- name: log
mountPath: /var/log/gorestapi
- name: fluentd-config
mountPath: /etc/td-agent
- name: access-log-template
mountPath: /tmp/access_log_template.json
subPath: access_log_template.json
readOnly: true
- mountPath: /fluentd/elastic/tls.crt
name: elasticsearch-ca
subPath: tls.crt
readOnly: true
resources:
limits:
cpu: 500m
memory: 2Gi
volumes:
- name: mysql-connection
secret:
secretName: gorestapi
items:
- key: gorestapi.mysql.json
path: appsettings.mysql.json
- name: fluentd-config
configMap:
name: fluentd-config
- name: access-log-template
configMap:
name: access-log-template
- name: log
emptyDir: {}
- name: elasticsearch-ca
secret:
defaultMode: 420
optional: false
secretName: elasticsearch-eck-ca # This is the secret that holds the Elasticsearch CA cert