Skip to content

Commit f912262

Browse files
committed
added health endpoint
1 parent a30cbff commit f912262

File tree

5 files changed

+63
-3
lines changed

5 files changed

+63
-3
lines changed

kotlin-wot-integration-wot-agent/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies {
1919

2020
implementation("org.springframework.boot:spring-boot-starter-web")
2121
implementation("org.springframework.boot:spring-boot-starter-webflux")
22+
implementation("org.springframework.boot:spring-boot-starter-actuator")
2223

2324
implementation("ai.ancf.lmos:arc-azure-client:0.111.0")
2425
}

kotlin-wot-integration-wot-agent/src/main/helm/templates/deployment.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ spec:
1717
{{- with .Values.podAnnotations }}
1818
annotations:
1919
{{- toYaml . | nindent 8 }}
20+
deploymentTimestamp: "{{ now | date "2006-01-02T15:04:05Z07:00" }}"
2021
{{- end }}
2122
labels:
2223
{{- include "wot-agent.labels" . | nindent 8 }}
@@ -46,9 +47,25 @@ spec:
4647
containerPort: {{ .Values.service.port }}
4748
protocol: TCP
4849
livenessProbe:
49-
{{- toYaml .Values.livenessProbe | nindent 12 }}
50+
httpGet:
51+
path: /health
52+
port: 9090
53+
scheme: HTTP
54+
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
55+
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
56+
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
57+
successThreshold: {{ .Values.livenessProbe.successThreshold }}
58+
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
5059
readinessProbe:
51-
{{- toYaml .Values.readinessProbe | nindent 12 }}
60+
httpGet:
61+
path: /health
62+
port: 9090
63+
scheme: HTTP
64+
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
65+
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
66+
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
67+
successThreshold: {{ .Values.readinessProbe.successThreshold }}
68+
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
5269
resources:
5370
{{- toYaml .Values.resources | nindent 12 }}
5471
{{- with .Values.volumeMounts }}

kotlin-wot-integration-wot-agent/src/main/helm/templates/service.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ metadata:
44
name: {{ include "wot-agent.fullname" . }}
55
labels:
66
{{- include "wot-agent.labels" . | nindent 4 }}
7+
wot-agent: "true"
78
spec:
89
type: {{ .Values.service.type }}
910
ports:
1011
- port: {{ .Values.service.port }}
1112
targetPort: {{ .Values.service.port }}
1213
protocol: TCP
13-
name: http
14+
name: http-wot
15+
- port: 8181
16+
targetPort: 8181
17+
protocol: TCP
18+
name: http-capabilities
19+
- port: 9090
20+
targetPort: 9090
21+
protocol: TCP
22+
name: http-health
1423
selector:
1524
{{- include "wot-agent.selectorLabels" . | nindent 4 }}

kotlin-wot-integration-wot-agent/src/main/helm/values.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ resources: {}
8686
# periodSeconds: 10
8787
# failureThreshold: 3
8888

89+
livenessProbe:
90+
initialDelaySeconds: 1
91+
periodSeconds: 15
92+
timeoutSeconds: 5
93+
successThreshold: 1
94+
failureThreshold: 6
95+
96+
readinessProbe:
97+
initialDelaySeconds: 1
98+
periodSeconds: 15
99+
timeoutSeconds: 1
100+
successThreshold: 1
101+
failureThreshold: 3
102+
89103
autoscaling:
90104
enabled: false
91105
minReplicas: 1

kotlin-wot-integration-wot-agent/src/main/resources/application.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,22 @@ wot:
3535
host: localhost
3636
port: 54801
3737
clientId: wot-client
38+
39+
management:
40+
server:
41+
port: 9090
42+
endpoints:
43+
web:
44+
base-path: /
45+
exposure:
46+
include: prometheus,metrics,info,health
47+
endpoint:
48+
metrics:
49+
access: read_only
50+
health:
51+
probes:
52+
enabled: true
53+
prometheus:
54+
metrics:
55+
export:
56+
enabled: true

0 commit comments

Comments
 (0)