Skip to content
Snippets Groups Projects
Commit 89ef1ccc authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

address comments + correct the deployment.yaml container liveness and readiness probe configuration

parent ad8f45ed
No related branches found
No related tags found
1 merge request!53customized readiness check to make sure cache layer is ready before serving traffic
......@@ -48,7 +48,14 @@ spec:
cpu: "300m"
readinessProbe:
httpGet:
path: /api/partition/v1/swagger-ui.html
path: {{ .Values.server.servlet.contextPath }}/_ah/readiness_check
port: 80
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
livenessProbe:
httpGet:
path: {{ .Values.server.servlet.contextPath }}/_ah/liveness_check
port: 80
volumeMounts:
- name: azure-keyvault
......
......@@ -36,6 +36,7 @@ public class HealthCheck {
@GetMapping("/liveness_check")
public ResponseEntity<String> livenessCheck() {
healthCheckService.performLivenessCheck();
ResponseEntity responseEntity = new ResponseEntity<>("Partition service is alive", HttpStatus.OK);
this.auditLogger.readServiceLivenessSuccess(Collections.singletonList(responseEntity.toString()));
return responseEntity;
......
package org.opengroup.osdu.partition.provider.interfaces;
public interface IHealthCheckService {
void performLivenessCheck();
void performReadinessCheck();
}
package org.opengroup.osdu.partition.provider.aws.service;
package org.opengroup.osdu.partition.service;
import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
import org.springframework.stereotype.Service;
@Service
public class HealthCheckServiceImpl implements IHealthCheckService {
public class DefaultHealthCheckImpl implements IHealthCheckService {
@Override
public void performLivenessCheck() {
}
@Override
public void performReadinessCheck() {
......
......@@ -16,6 +16,11 @@ public class HealthCheckServiceImpl implements IHealthCheckService {
@Qualifier("partitionServiceCache")
private IPartitionServiceCache<String, PartitionInfo> partitionServiceCache;
@Override
public void performLivenessCheck() {
}
/**
* Cache layer must be ready before the pod can serve the traffic
*/
......
package org.opengroup.osdu.partition.provider.gcp.service;
import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
import org.springframework.stereotype.Service;
@Service
public class HealthCheckServiceImpl implements IHealthCheckService {
@Override
public void performReadinessCheck() {
}
}
package org.opengroup.osdu.partition.provider.ibm.service;
import org.opengroup.osdu.partition.provider.interfaces.IHealthCheckService;
import org.springframework.stereotype.Service;
@Service
public class HealthCheckServiceImpl implements IHealthCheckService {
@Override
public void performReadinessCheck() {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment