Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tridentImageRegistry to Helm chart (trident-image-registry to cli) #774

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

[Releases](https://github.com/NetApp/trident/releases)

## Changes since v23.07.1

**Enhancements**
- **Kubernetes:** Added `--trident-image-registry` switch to installer
and value tridentImageRegistry to Helm chart. (Issue [#772](https://github.com/NetApp/trident/issues/772))

## Changes since v23.04.0

**Fixes:**
Expand Down
16 changes: 12 additions & 4 deletions cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var (
enableForceDetach bool
disableAuditLog bool
tridentImage string
tridentImageRegistry string
autosupportImage string
autosupportProxy string
autosupportCustomURL string
Expand Down Expand Up @@ -192,6 +193,8 @@ func init() {
installCmd.Flags().BoolVar(&disableAuditLog, "disable-audit-log", true, "Disable the audit logger.")
installCmd.Flags().StringVar(&tridentImage, "trident-image", "",
"Trident container image. When installing Trident from a private image registry, this flag must be set to the path of the container image.")
installCmd.Flags().StringVar(&tridentImageRegistry, "trident-image-registry", "",
"The address/port of an internal image registry containing trident images.")
installCmd.Flags().StringVar(&logFormat, "log-format", "text", "The Trident logging format (text, json).")
installCmd.Flags().StringVar(&logWorkflows, "log-workflows", "", "A comma-delimited list of Trident "+
"workflows for which to enable trace logging.")
Expand All @@ -202,8 +205,9 @@ func init() {
installCmd.Flags().StringVar(&kubeletDir, "kubelet-dir", "/var/lib/kubelet",
"The host location of kubelet's internal state.")
installCmd.Flags().StringVar(&imageRegistry, "image-registry", "",
"The address/port of an internal image registry location. For more information on specifying image locations, "+
"consult the Trident documentation.")
"The address/port of an internal image registry location containing csi sidecar images. If trident-image-registry "+
"is not set this is also used for trident images. For more information on specifying image locations, "+
"consult the Trident documentation.")
installCmd.Flags().StringVar(&autosupportProxy, "autosupport-proxy", "",
"The address/port of a proxy for sending Autosupport Telemetry")
installCmd.Flags().StringVar(&autosupportCustomURL, "autosupport-custom-url", "", "Custom Autosupport endpoint")
Expand Down Expand Up @@ -323,7 +327,9 @@ func discoverInstallationEnvironment() error {
tridentImage = tridentconfig.BuildImage

// Override registry only if using the default Trident image name and an alternate registry was supplied
if imageRegistry != "" {
if tridentImageRegistry != "" {
tridentImage = utils.ReplaceImageRegistry(tridentImage, tridentImageRegistry)
} else if imageRegistry != "" {
tridentImage = utils.ReplaceImageRegistry(tridentImage, imageRegistry)
}
}
Expand All @@ -332,7 +338,9 @@ func discoverInstallationEnvironment() error {
if autosupportImage == "" {
autosupportImage = tridentconfig.DefaultAutosupportImage

if imageRegistry != "" {
if tridentImageRegistry != "" {
autosupportImage = utils.ReplaceImageRegistry(autosupportImage, tridentImageRegistry)
} else if imageRegistry != "" {
autosupportImage = utils.ReplaceImageRegistry(autosupportImage, imageRegistry)
}
}
Expand Down
12 changes: 3 additions & 9 deletions helm/trident-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ Trident operator image
{{- define "trident-operator.image" -}}
{{- if .Values.operatorImage }}
{{- .Values.operatorImage }}
{{- else if .Values.imageRegistry }}
{{- .Values.imageRegistry }}/trident-operator:{{ .Values.operatorImageTag | default .Chart.AppVersion }}
{{- else }}
{{- "" }}docker.io/netapp/trident-operator:{{ .Values.operatorImageTag | default .Chart.AppVersion }}
{{- .Values.tridentImageRegistry | default .Values.imageRegistry | default "docker.io/netapp" }}/trident-operator:{{ .Values.operatorImageTag | default .Chart.AppVersion }}
{{- end }}
{{- end }}

Expand Down Expand Up @@ -116,10 +114,8 @@ Trident AutoSupport image
{{- define "trident.autosupportImage" -}}
{{- if .Values.tridentAutosupportImage }}
{{- .Values.tridentAutosupportImage }}
{{- else if .Values.imageRegistry }}
{{- .Values.imageRegistry }}/trident-autosupport:{{ .Values.tridentAutosupportImageTag | default .Chart.AppVersion | trunc 5}}
{{- else }}
{{- "" }}docker.io/netapp/trident-autosupport:{{ .Values.tridentAutosupportImageTag | default .Chart.AppVersion | trunc 5}}
{{- .Values.tridentImageRegistry | default .Values.imageRegistry | default "docker.io/netapp" }}/trident-autosupport:{{ .Values.tridentAutosupportImageTag | default .Chart.AppVersion | trunc 5}}
{{- end }}
{{- end }}

Expand Down Expand Up @@ -190,10 +186,8 @@ Trident image
{{- define "trident.image" -}}
{{- if .Values.tridentImage }}
{{- .Values.tridentImage }}
{{- else if .Values.imageRegistry }}
{{- .Values.imageRegistry }}/trident:{{ .Values.tridentImageTag | default .Chart.AppVersion }}
{{- else }}
{{- "" }}docker.io/netapp/trident:{{ .Values.tridentImageTag | default .Chart.AppVersion }}
{{- .Values.tridentImageRegistry | default .Values.imageRegistry | default "docker.io/netapp" }}/trident:{{ .Values.tridentImageTag | default .Chart.AppVersion }}
{{- end }}
{{- end }}

Expand Down
5 changes: 4 additions & 1 deletion helm/trident-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ affinity: {}



# imageRegistry identifies the registry for the trident-operator, trident, and other images. Leave empty to accept the default.
# imageRegistry identifies the registry for official kubernetes csi sidecar images. Value is also used for tridentImageRegistry if this is not set. Leave empty to accept the default.
imageRegistry: ""

# imagePullPolicy sets the image pull policy for the trident-operator.
Expand Down Expand Up @@ -103,6 +103,9 @@ tridentLogLayers: ""
# tridentImage allows the complete override of the image for Trident.
tridentImage: ""

# tridentImageRegistry identifies the registry for the trident-operator, trident, and other images. Leave empty to accept the default.
tridentImageRegistry: ""

# tridentImageTag allows overriding the tag of the image for Trident.
tridentImageTag: ""

Expand Down