Skip to content

Commit 1f377ea

Browse files
committed
add health check
1 parent f332df1 commit 1f377ea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

deployment/app-k8s.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ items:
1919
type: NodePort
2020
selector:
2121
app: spring-boot-kubernetes-mysql
22+
- apiVersion: v1
23+
kind: ServiceAccount
24+
metadata:
25+
name: spring-boot-kubernetes-mysql
26+
labels:
27+
account: spring-boot-kubernetes-mysql
2228
- apiVersion: apps/v1
2329
kind: Deployment
2430
metadata:
@@ -36,6 +42,7 @@ items:
3642
app: spring-boot-kubernetes-mysql
3743
version: 5.0.0
3844
spec:
45+
serviceAccountName: spring-boot-kubernetes-mysql
3946
containers:
4047
- name: spring-boot-kubernetes-mysql
4148
image: ashutoshsahoo/spring-boot-kubernetes-mysql:5.0.0
@@ -69,3 +76,13 @@ items:
6976
secretKeyRef:
7077
name: mysql-secret
7178
key: MYSQL_PASSWORD
79+
securityContext:
80+
# runAsUser: 1000
81+
# readOnlyRootFilesystem: true
82+
allowPrivilegeEscalation: false
83+
livenessProbe:
84+
httpGet:
85+
path: /api/v1/actuator/health
86+
port: 8080
87+
initialDelaySeconds: 15
88+
periodSeconds: 5

0 commit comments

Comments
 (0)