java
# ConfigMap
kind: ConfigMap
apiVersion: v1
metadata:
name: birenchong-test-java-conf
namespace: birenchong-test
annotations:
kubesphere.io/creator: admin
data:
birenchong-chat-application: |
spring:
application:
name: birenchong-chat
profiles:
active: dev
mvc:
pathmatch:
matching-strategy: ant_path_matcher
main:
allow-circular-references: true
rabbitmq:
host: birenchong-test-rabbitmq.birenchong-test
port: 5672
username: username
password: password
virtual-host: /
publisher-returns: true
publisher-confirm-type: correlated
requested-heartbeat: 60
listener:
direct:
acknowledge-mode: manual
simple:
acknowledge-mode: manual
prefetch: 1
cloud:
nacos:
discovery:
server-addr: birenchong-devops-tool-nacos.birenchong-devops:8848 # Nacos
service: ${spring.application.name}
namespace: 8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf # Nacos ${env}
datasource:
masterdb:
driverClassName: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://birenchong-test-mysql.birenchong-test/birenchong?serverTimezone=GMT%2b3&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
username: root
password: birenchong_password
type: com.alibaba.druid.pool.DruidDataSource
autoCommit: false
minimumIdle: 2
maximumPoolSize: 20
poolName: marx-db-poll
logging:
config: classpath:logback-spring.xml
level:
com.xinguaizhu.orm: debug
org.springframework.jdbc.core.JdbcTemplate: debug
server:
port: 18081
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.renxing.birenchongchat.persistence.mapper
feign:
hystrix:
enabled: true
client:
config:
default:
connectTimeout: 60000
readTimeout: 60000
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
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
# Deployment
kind: Deployment
apiVersion: apps/v1
metadata:
name: birenchong-test-java-chat-v1
namespace: birenchong-test
labels:
app: birenchong-test-java-chat
version: v1
annotations:
kubesphere.io/creator: admin
spec:
replicas: 1
selector:
matchLabels:
app: birenchong-test-java-chat
version: v1
template:
metadata:
creationTimestamp: null
labels:
app: birenchong-test-java-chat
version: v1
annotations:
logging.kubesphere.io/logsidecar-config: '{}'
spec:
volumes:
- name: volume-2rl6kl
configMap:
name: birenchong-test-java-conf
items:
- key: birenchong-chat-application
path: application.yml
defaultMode: 420
containers:
- name: birenchong-java-chat
image: 'harbor.birenchong.cn/birenchong/birenchong-java-chat:SNAPSHOT-dev-30'
ports:
- name: tcp-18081
containerPort: 18081
protocol: TCP
resources:
limits:
cpu: 700m
memory: 4Gi
requests:
cpu: 500m
memory: 2730Mi
volumeMounts:
- name: volume-2rl6kl
readOnly: true
mountPath: /var/www/java/web/application.yml
subPath: application.yml
livenessProbe:
httpGet:
path: /healthcheck
port: 18081
scheme: HTTP
initialDelaySeconds: 300
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /healthcheck
port: 18081
scheme: HTTP
initialDelaySeconds: 30
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
lifecycle:
preStop:
exec:
command:
- /bin/bash
- '-c'
- sleep 30
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 35
dnsPolicy: ClusterFirst
nodeSelector:
env: test
serviceAccountName: default
serviceAccount: default
securityContext: {}
imagePullSecrets:
- name: harbor-devops
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
revisionHistoryLimit: 10
progressDeadlineSeconds: 600
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
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
将nodeSelector改为affinity
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: env
operator: In
values:
- prod
- test
- devops
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# Service
kind: Service
apiVersion: v1
metadata:
name: birenchong-test-java-chat
namespace: birenchong-test
labels:
app: birenchong-test-java-chat
version: v1
annotations:
kubesphere.io/creator: admin
kubesphere.io/serviceType: statelessservice
spec:
ports:
- name: tcp-18081
protocol: TCP
port: 18081
targetPort: 18081
selector:
app: birenchong-test-java-chat
clusterIP: 10.100.37.224
clusterIPs:
- 10.100.37.224
type: ClusterIP
sessionAffinity: None
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
internalTrafficPolicy: Cluster
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
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
Last Updated: 2023/11/08, 14:45:54