-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathk8s.yml
142 lines (140 loc) · 3.66 KB
/
k8s.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
apiVersion: v1
kind: Service
metadata:
name: vertx-server-push
spec:
ports:
- name: http
targetPort: 8080
protocol: TCP
port: 80
selector:
app: vertx-server-push
---
#kind: PersistentVolumeClaim
#apiVersion: v1
#metadata:
# name: vertx-server-push-init-script
#spec:
# accessModes:
# - ReadWriteOnce
# volumeMode: Filesystem
# resources:
# requests:
# storage: 50Mi
---
#apiVersion: autoscaling/v2
#kind: HorizontalPodAutoscaler
#metadata:
# name: vertx-server-push
#spec:
# scaleTargetRef:
# apiVersion: apps/v1
# kind: Deployment
# name: vertx-server-push
# minReplicas: 1
# maxReplicas: 3
# metrics:
# - type: Resource
# resource:
# name: cpu
# target:
# type: Utilization
# averageUtilization: 50
# - type: Resource
# resource:
# name: memory
# target:
# type: Utilization
# averageUtilization: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: vertx-server-push
spec:
selector:
matchLabels:
app: vertx-server-push
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2
maxUnavailable: 1
template:
metadata:
labels:
app: vertx-server-push
spec:
restartPolicy: Always
shareProcessNamespace: true
containers:
- name: vertx-server-push
image: ghcr.io/zuisong/vertx-server-push:latest
startupProbe:
httpGet:
port: 8080
path: /health
readinessProbe:
httpGet:
port: 8080
path: /health
livenessProbe:
httpGet:
port: 8080
path: /health
resources:
requests:
memory: 350Mi
cpu: 200m
limits:
memory: 500Mi
cpu: 1000m
env:
- name: PUSH_PORT
value: "8080"
# - name: OTEL_LOGS_EXPORTER
# value: logging
# - name: OTEL_METRICS_EXPORTER
# value: logging
# - name: OTEL_TRACES_EXPORTER
# value: logging
# - name: OTEL_EXPORTER_OTLP_PROTOCOL
# value: grpc
# - name: OTEL_EXPORTER_OTLP_ENDPOINT
# value: http://grafana-agent:4317
# - name: OTEL_EXPORTER_JAEGER_ENDPOINT
# value: http://10.42.0.14:14250
# - name: OTEL_TRACES_EXPORTER
# value: jaeger
- name: OTEL_RESOURCE_ATTRIBUTES
value: service.name=vertx-server-push
- name: TZ
value: Asia/Shanghai
- name: JAVA_OPTS
value: |
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath="./"
-XX:MaxRAMPercentage=90.0
ports:
# - containerPort: 8088
# protocol: TCP
# name: jmx-metrics
- containerPort: 8080
name: http
protocol: TCP
# volumeMounts:
# - mountPath: /logback-config/
# name: logback-config
# readOnly: true
# - name: vertx-server-push-init-script
# mountPath: /java-agent-files/
# readOnly: true
# volumes:
# - name: vertx-server-push-init-script
# persistentVolumeClaim:
# claimName: vertx-server-push-init-script
# - name: logback-config
# configMap:
# name: logback-config