Make log level configurable via Helm chart parameter
This commit is contained in:
@@ -15,7 +15,7 @@ func main() {
|
||||
metrics.Use(router)
|
||||
|
||||
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")
|
||||
|
||||
@@ -36,6 +36,8 @@ spec:
|
||||
securityContext: # container tase
|
||||
readOnlyRootFilesystem: true
|
||||
env:
|
||||
- name: LOG_LEVEL
|
||||
value: {{ .Values.logLevel }}
|
||||
- name: USERNAME
|
||||
value: {{ .Values.username }}
|
||||
- name: MY_POD_NAME
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
username: world
|
||||
logLevel: info
|
||||
|
||||
Reference in New Issue
Block a user