Skip to content

Commit

Permalink
k8s 컨테이너 상태 모니터링 (#23)
Browse files Browse the repository at this point in the history
* add: ping 200만 응답하도록 수정

* add: 컨테이너 모니터링 추가

* fix: 잘못 입력한 엔드포인트 수정
  • Loading branch information
parkgang committed Nov 27, 2021
1 parent 2a69a96 commit 8efe9cf
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 54 deletions.
17 changes: 1 addition & 16 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,13 @@ var doc = `{
"/ping": {
"get": {
"description": "server의 헬스를 체크합니다.",
"produces": [
"application/json"
],
"tags": [
"App"
],
"summary": "server 헬스 체크",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Pong"
}
"description": ""
}
}
}
Expand Down Expand Up @@ -622,15 +616,6 @@ var doc = `{
}
}
},
"models.Pong": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "pong"
}
}
},
"models.UserInfo": {
"type": "object",
"required": [
Expand Down
17 changes: 1 addition & 16 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,13 @@
"/ping": {
"get": {
"description": "server의 헬스를 체크합니다.",
"produces": [
"application/json"
],
"tags": [
"App"
],
"summary": "server 헬스 체크",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Pong"
}
"description": ""
}
}
}
Expand Down Expand Up @@ -602,15 +596,6 @@
}
}
},
"models.Pong": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "pong"
}
}
},
"models.UserInfo": {
"type": "object",
"required": [
Expand Down
12 changes: 1 addition & 11 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ definitions:
example: 111aaaa1a111aaa1a111a1a1a11a1a11
type: string
type: object
models.Pong:
properties:
message:
example: pong
type: string
type: object
models.UserInfo:
properties:
avatarImage:
Expand Down Expand Up @@ -179,13 +173,9 @@ paths:
/ping:
get:
description: server의 헬스를 체크합니다.
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Pong'
description: ""
summary: server 헬스 체크
tags:
- App
Expand Down
8 changes: 2 additions & 6 deletions internal/app/handlers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/gin-gonic/gin"

"github.com/belf-kr/oauth-server/internal/app/models"
"github.com/belf-kr/oauth-server/internal/pkg/project"
)

Expand All @@ -23,13 +22,10 @@ func AppName(c *gin.Context) {
// @Summary server 헬스 체크
// @Description server의 헬스를 체크합니다.
// @Tags App
// @Produce json
// @Success 200 {object} models.Pong
// @Success 200
// @Router /ping [get]
func Ping(c *gin.Context) {
c.JSON(http.StatusOK, models.Pong{
Message: "pong",
})
c.Status(http.StatusOK)
}

// @Summary 앱 버전
Expand Down
5 changes: 0 additions & 5 deletions internal/app/models/pong.go

This file was deleted.

8 changes: 8 additions & 0 deletions k8s/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ spec:
imagePullPolicy: "Always"
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /api/ping
port: 8080
readinessProbe:
httpGet:
path: /api/ping
port: 8080
resources:
requests:
cpu: 5m
Expand Down
8 changes: 8 additions & 0 deletions k8s/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ spec:
imagePullPolicy: "Always"
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /api/ping
port: 8080
readinessProbe:
httpGet:
path: /api/ping
port: 8080
resources:
requests:
cpu: 5m
Expand Down

0 comments on commit 8efe9cf

Please sign in to comment.