diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index c6e6ea908..1040c2d02 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -89,6 +89,11 @@ type ProxyConfig struct { Host string `yaml:"host" json:"host" default:"127.0.0.1"` } +type OverrideImageConfig struct { + Worker string `yaml:"worker" json:"worker"` + Hub string `yaml:"hub" json:"hub"` + Front string `yaml:"front" json:"front"` +} type OverrideTagConfig struct { Worker string `yaml:"worker" json:"worker"` Hub string `yaml:"hub" json:"hub"` @@ -96,12 +101,13 @@ type OverrideTagConfig struct { } type DockerConfig struct { - Registry string `yaml:"registry" json:"registry" default:"docker.io/kubeshark"` - Tag string `yaml:"tag" json:"tag" default:""` - TagLocked bool `yaml:"tagLocked" json:"tagLocked" default:"true"` - ImagePullPolicy string `yaml:"imagePullPolicy" json:"imagePullPolicy" default:"Always"` - ImagePullSecrets []string `yaml:"imagePullSecrets" json:"imagePullSecrets"` - OverrideTag OverrideTagConfig `yaml:"overrideTag" json:"overrideTag"` + Registry string `yaml:"registry" json:"registry" default:"docker.io/kubeshark"` + Tag string `yaml:"tag" json:"tag" default:""` + TagLocked bool `yaml:"tagLocked" json:"tagLocked" default:"true"` + ImagePullPolicy string `yaml:"imagePullPolicy" json:"imagePullPolicy" default:"Always"` + ImagePullSecrets []string `yaml:"imagePullSecrets" json:"imagePullSecrets"` + OverrideImage OverrideImageConfig `yaml:"overrideImage" json:"overrideImage"` + OverrideTag OverrideTagConfig `yaml:"overrideTag" json:"overrideTag"` } type ResourcesConfig struct { diff --git a/helm-chart/README.md b/helm-chart/README.md index 3263fc5a4..e0befa082 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -104,6 +104,20 @@ helm install kubeshark kubeshark/kubeshark \ Please refer to [metrics](./metrics.md) documentation for details. +## Override Tag, Tags, Images + +In addition to using a private registry, you can further override the images' tag, specific image tags and specific image names. + +Example for overriding image names: + +```yaml + docker: + overrideImage: + worker: docker.io/kubeshark/worker:v52.3.87 + front: docker.io/kubeshark/front:v52.3.87 + hub: docker.io/kubeshark/hub:v52.3.87 +``` + ## Configuration | Parameter | Description | Default | @@ -114,7 +128,8 @@ Please refer to [metrics](./metrics.md) documentation for details. | `tap.docker.tagLocked` | If `false` - use latest minor tag | `true` | | `tap.docker.imagePullPolicy` | Kubernetes image pull policy | `Always` | | `tap.docker.imagePullSecrets` | Kubernetes secrets to pull the images | `[]` | -| `tap.docker.overrideTag` | DANGER: Used to override specific images, when testing custom features from the Kubeshark team | `""` | +| `tap.docker.overrideImage` | Can be used to directly override image names | `""` | +| `tap.docker.overrideTag` | Can be used to override image tags | `""` | | `tap.proxy.hub.srvPort` | Hub server port. Change if already occupied. | `8898` | | `tap.proxy.worker.srvPort` | Worker server port. Change if already occupied.| `30001` | | `tap.proxy.front.port` | Front service port. Change if already occupied.| `8899` | diff --git a/helm-chart/templates/04-hub-deployment.yaml b/helm-chart/templates/04-hub-deployment.yaml index 8cf8ea39c..5bef71628 100644 --- a/helm-chart/templates/04-hub-deployment.yaml +++ b/helm-chart/templates/04-hub-deployment.yaml @@ -51,7 +51,9 @@ spec: value: 'https://api.kubeshark.co' - name: PROFILING_ENABLED value: '{{ .Values.tap.pprof.enabled }}' - {{- if .Values.tap.docker.overrideTag.hub }} + {{- if .Values.tap.docker.overrideImage.hub }} + image: '{{ .Values.tap.docker.overrideImage.hub }}' + {{- else if .Values.tap.docker.overrideTag.hub }} image: '{{ .Values.tap.docker.registry }}/hub:{{ .Values.tap.docker.overrideTag.hub }}' {{ else }} image: '{{ .Values.tap.docker.registry }}/hub:{{ not (eq .Values.tap.docker.tag "") | ternary .Values.tap.docker.tag (include "kubeshark.defaultVersion" .) }}' diff --git a/helm-chart/templates/06-front-deployment.yaml b/helm-chart/templates/06-front-deployment.yaml index 25b061d79..59fde16d1 100644 --- a/helm-chart/templates/06-front-deployment.yaml +++ b/helm-chart/templates/06-front-deployment.yaml @@ -66,7 +66,9 @@ spec: value: '{{ (include "sentry.enabled" .) }}' - name: REACT_APP_SENTRY_ENVIRONMENT value: '{{ .Values.tap.sentry.environment }}' - {{- if .Values.tap.docker.overrideTag.front }} + {{- if .Values.tap.docker.overrideImage.front }} + image: '{{ .Values.tap.docker.overrideImage.front }}' + {{- else if .Values.tap.docker.overrideTag.front }} image: '{{ .Values.tap.docker.registry }}/front:{{ .Values.tap.docker.overrideTag.front }}' {{ else }} image: '{{ .Values.tap.docker.registry }}/front:{{ not (eq .Values.tap.docker.tag "") | ternary .Values.tap.docker.tag (include "kubeshark.defaultVersion" .) }}' diff --git a/helm-chart/templates/09-worker-daemon-set.yaml b/helm-chart/templates/09-worker-daemon-set.yaml index 298ef5d6f..87db7a85b 100644 --- a/helm-chart/templates/09-worker-daemon-set.yaml +++ b/helm-chart/templates/09-worker-daemon-set.yaml @@ -83,7 +83,9 @@ spec: {{- if .Values.tap.debug }} - -debug {{- end }} - {{- if .Values.tap.docker.overrideTag.worker }} + {{- if .Values.tap.docker.overrideImage.worker }} + image: '{{ .Values.tap.docker.overrideImage.worker }}' + {{- else if .Values.tap.docker.overrideTag.worker }} image: '{{ .Values.tap.docker.registry }}/worker:{{ .Values.tap.docker.overrideTag.worker }}{{ include "kubeshark.dockerTagDebugVersion" . }}' {{ else }} image: '{{ .Values.tap.docker.registry }}/worker:{{ not (eq .Values.tap.docker.tag "") | ternary .Values.tap.docker.tag (include "kubeshark.defaultVersion" .) }}{{ include "kubeshark.dockerTagDebugVersion" . }}' diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 8b364574f..1c33ef446 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -6,6 +6,10 @@ tap: tagLocked: true imagePullPolicy: Always imagePullSecrets: [] + overrideImage: + worker: "" + hub: "" + front: "" overrideTag: worker: "" hub: ""