Skip to content

Commit

Permalink
fix(k8s-manager): add krt-files-downloader images, tag and pull polic…
Browse files Browse the repository at this point in the history
…y configurable via Helm (#622)
  • Loading branch information
JYisus authored Jun 29, 2022
1 parent 5b21fc5 commit e1e12f7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions engine/k8s-manager/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ type Config struct {
Size string `yaml:"size" envconfig:"KRE_INFLUXDB_STORAGE_SIZE"`
} `yaml:"persistentVolume"`
} `yaml:"influxdb"`
KrtFilesDownloader struct {
Image string `yaml:"image" envconfig:"KRE_KRT_FILES_DOWNLOADER_IMAGE"`
Tag string `yaml:"tag" envconfig:"KRE_KRT_FILES_DOWNLOADER_TAG"`
PullPolicy string `yaml:"pullPolicy" envconfig:"KRE_KRT_FILES_DOWNLOADER_PULL_POLICY"`
} `yaml:"krtFilesDownloader"`
}

// NewConfig will read the config.yml file and override values with env vars.
Expand Down
9 changes: 6 additions & 3 deletions engine/k8s-manager/kubernetes/version/containers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package version

import apiv1 "k8s.io/api/core/v1"
import (
"fmt"
apiv1 "k8s.io/api/core/v1"
)

func (m *Manager) getFluentBitContainer(envVars []apiv1.EnvVar) apiv1.Container {
return apiv1.Container{
Expand Down Expand Up @@ -39,8 +42,8 @@ func (m *Manager) getFluentBitContainer(envVars []apiv1.EnvVar) apiv1.Container
func (m *Manager) getKRTFilesDownloaderContainer(envVars []apiv1.EnvVar) apiv1.Container {
return apiv1.Container{
Name: "krt-files-downloader",
Image: "konstellation/krt-files-downloader:latest",
ImagePullPolicy: apiv1.PullIfNotPresent,
Image: fmt.Sprintf("%s:%s", m.config.KrtFilesDownloader.Image, m.config.KrtFilesDownloader.Tag),
ImagePullPolicy: apiv1.PullPolicy(m.config.KrtFilesDownloader.PullPolicy),
Env: envVars,
VolumeMounts: []apiv1.VolumeMount{
m.getKRTFilesVolumeMount(),
Expand Down
3 changes: 3 additions & 0 deletions helm/kre/CHART.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
| k8sManager.serviceAccount.annotations | object | `{}` | The Service Account annotations |
| k8sManager.serviceAccount.create | bool | `true` | Whether to create the Service Account |
| k8sManager.serviceAccount.name | string | `""` | The name of the service account. @default: A pre-generated name based on the chart relase fullname sufixed by `-k8s-manager` |
| k8sManager.krtFilesDownloader.image.repository | string | `""` | Image repository for `krt-files-downloader` |
| k8sManager.krtFilesDownloader.image.tag | string | `""` | Image tag for `krt-files-downloader` |
| k8sManager.krtFilesDownloader.image.pullPolicy | string | `""` | Image pull policy for `krt-files-downloader` |
| kapacitor.enabled | bool | `false` | Whether to enable Kapacitor |
| kapacitor.persistence.enabled | bool | `false` | Whether to enable persistence [Details](https://github.com/influxdata/helm-charts/blob/master/charts/kapacitor/values.yaml) |
| mongoWriter.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
Expand Down
4 changes: 4 additions & 0 deletions helm/kre/templates/config/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ data:
KRE_INFLUXDB_ADDRESS: {{ include "runtime.influxURL" . }}
KRE_INFLUXDB_STORAGECLASS: "{{ .Values.influxdb.persistence.storageClass }}"
KRE_INFLUXDB_STORAGE_SIZE: "{{ .Values.influxdb.persistence.size }}"
#KRTFilesDownloader
KRE_KRT_FILES_DOWNLOADER_IMAGE: "{{ .Values.k8sManager.krtFilesDownloader.image.repository }}"
KRE_KRT_FILES_DOWNLOADER_TAG: "{{ .Values.k8sManager.krtFilesDownloader.image.tag }}"
KRE_KRT_FILES_DOWNLOADER_PULL_POLICY: "{{ .Values.k8sManager.krtFilesDownloader.image.pullPolicy }}"
8 changes: 8 additions & 0 deletions helm/kre/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ k8sManager:
name: ""
# -- The Service Account annotations
annotations: {}
krtFilesDownloader:
image:
# -- Image repository for `krt-files-downloader`
repository: konstellation/krt-files-downloader
# -- Image tag for `krt-files-downloader`
tag: latest
# -- Image pull policy for `krt-files-downloader`
pullPolicy: Always

mongoWriter:
image:
Expand Down

0 comments on commit e1e12f7

Please sign in to comment.