Add UI configuration

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2023-09-23 10:04:56 +03:00
parent 6316e213d1
commit e816d1b5bc
4 changed files with 48 additions and 1 deletions
+9 -1
View File
@@ -19,7 +19,7 @@ timoni -n default apply podinfo oci://ghcr.io/stefanprodan/modules/podinfo
To install a specific module version:
```shell
timoni -n default apply podinfo oci://ghcr.io/stefanprodan/modules/podinfo -v 6.3.5
timoni -n default apply podinfo oci://ghcr.io/stefanprodan/modules/podinfo -v 6.5.0
```
To change the [default configuration](#configuration),
@@ -129,3 +129,11 @@ values: {
|----------------------|----------|---------|---------------------------------------------------------|
| `caching: enabled:` | `bool` | `false` | Enable Redis caching |
| `caching: redisURL:` | `string` | `""` | Redis URL in the format `tcp://:[password]@host[:port]` |
### UI values
| Key | Type | Default | Description |
|----------------|----------|-----------|------------------|
| `ui: color:` | `string` | `#34577c` | Background color |
| `ui: message:` | `string` | `""` | Greeting message |
| `ui: backend:` | `string` | `""` | Backend URL |
+7
View File
@@ -7,6 +7,13 @@ import (
// Config defines the schema and defaults for the Instance values.
#Config: {
// UI setting
ui: {
color: *"#34577c" | string
message?: string
backend?: string
}
// Runtime version info
moduleVersion!: string
kubeVersion!: string
+30
View File
@@ -76,6 +76,24 @@ import (
if _config.securityContext != _|_ {
securityContext: _config.securityContext
}
env: [
{
name: "PODINFO_UI_COLOR"
value: _config.ui.color
},
if _config.ui.message != _|_ {
{
name: "PODINFO_UI_MESSAGE"
value: _config.ui.message
}
},
if _config.ui.backend != _|_ {
{
name: "PODINFO_BACKEND_URL"
value: _config.ui.backend
}
},
]
command: [
"./podinfo",
"--level=info",
@@ -85,6 +103,12 @@ import (
"--cache-server=\(_config.caching.redisURL)"
},
]
volumeMounts: [
{
name: "data"
mountPath: "/data"
},
]
},
]
if _config.podSecurityContext != _|_ {
@@ -102,6 +126,12 @@ import (
if _config.imagePullSecrets != _|_ {
imagePullSecrets: _config.imagePullSecrets
}
volumes: [
{
name: "data"
emptyDir: {}
},
]
}
}
}
+2
View File
@@ -3,6 +3,8 @@
package main
values: {
ui: backend: "http://backend.default.svc.cluster.local/echo"
metadata: {
labels: "app.kubernetes.io/part-of": "podinfo"
annotations: "app.kubernetes.io/team": "dev"