Make log level configurable via Helm chart parameter

This commit is contained in:
2024-08-22 16:28:24 +03:00
parent 7531433a68
commit 252312f948
3 changed files with 4 additions and 1 deletions

View File

@@ -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")

View File

@@ -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

View File

@@ -1 +1,2 @@
username: world username: world
logLevel: info