Skip to content

Commit

Permalink
added CORS for actuator and header for liveness probe #EA-3284
Browse files Browse the repository at this point in the history
  • Loading branch information
gsergiu committed Mar 10, 2023
1 parent e365d95 commit b8312ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions k8s/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ spec:
httpGet:
port: 8080
path: /actuator/health/liveness
httpHeaders:
- name: Accept
value: application/json
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
httpGet:
port: 8080
path: /actuator/health/readiness
httpHeaders:
- name: Accept
value: application/json
initialDelaySeconds: 30
periodSeconds: 30
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public void addCorsMappings(CorsRegistry registry) {
.exposedHeaders(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS)
.allowCredentials(false).maxAge(600L); // in seconds

registry.addMapping("/actuator/**").allowedOrigins("*").allowedMethods("GET")
.exposedHeaders(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS)
.allowCredentials(false).maxAge(600L); // in seconds

// create method
// delete user's sets by admin, delete by user's sets by
registry.addMapping("/set/").allowedOrigins("*").allowedMethods("POST", "DELETE")
Expand Down

0 comments on commit b8312ee

Please sign in to comment.