Make log level configurable via Helm chart parameter
This commit is contained in:
@@ -15,7 +15,7 @@ func main() {
|
|||||||
metrics.Use(router)
|
metrics.Use(router)
|
||||||
|
|
||||||
router.GET("/api/v1/gin", func(c *gin.Context) {
|
router.GET("/api/v1/gin", func(c *gin.Context) {
|
||||||
c.String(http.StatusOK, "Hello " + os.Getenv("USERNAME") + " from " + os.Getenv("MY_POD_NAME"))
|
c.String(http.StatusOK, "Hello " + os.Getenv("USERNAME") + " from " + os.Getenv("MY_POD_NAME") + " with log level " + os.Getenv("LOG_LEVEL"))
|
||||||
})
|
})
|
||||||
|
|
||||||
router.Run(":8000")
|
router.Run(":8000")
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ spec:
|
|||||||
securityContext: # container tase
|
securityContext: # container tase
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
env:
|
env:
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: {{ .Values.logLevel }}
|
||||||
- name: USERNAME
|
- name: USERNAME
|
||||||
value: {{ .Values.username }}
|
value: {{ .Values.username }}
|
||||||
- name: MY_POD_NAME
|
- name: MY_POD_NAME
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
username: world
|
username: world
|
||||||
|
logLevel: info
|
||||||
|
|||||||
Reference in New Issue
Block a user