Skip to content

Commit

Permalink
deploy: 무중단배포의 안정성을 위한 health check 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
GitJIHO committed Jan 5, 2025
1 parent c937a7c commit 381b442
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
}

tasks.named('test') {
Expand Down
21 changes: 21 additions & 0 deletions k8s/deployment.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ spec:
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1"
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 3
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
failureThreshold: 3
strategy:
type: RollingUpdate
rollingUpdate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public class testController {

@GetMapping("/api")
public ResponseEntity<String> mainPage() {
return ResponseEntity.ok().body("test2");
return ResponseEntity.ok().body("test3");
}

@GetMapping("/api/oh")
public ResponseEntity<String> sidePage() {
return ResponseEntity.ok().body("new test3");
return ResponseEntity.ok().body("new test4");
}
}

0 comments on commit 381b442

Please sign in to comment.