Allow using an existing private registry secret (#3673)

Co-authored-by: David Ko <dko@suse.com>
Co-authored-by: JenTing Hsiao <jenting.hsiao@suse.com>
This commit is contained in:
wilson1999112 2022-03-18 13:50:45 +08:00 committed by GitHub
parent ae4df55ae4
commit 049a4ea974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 13 deletions

View File

@ -148,24 +148,30 @@ questions:
group: "Private Registry Settings"
type: string
default: ""
- variable: privateRegistry.registrySecret
label: Private registry secret name
description: "If create a new private registry secret is true, create a Kubernetes secret with this name; else use the existing secret of this name. Use it to pull images from your private registry."
group: "Private Registry Settings"
type: string
default: ""
- variable: privateRegistry.createSecret
default: "true"
description: "Create a new private registry secret"
type: boolean
group: "Private Registry Settings"
label: Create Secret for Private Registry Settings
show_subquestion_if: true
subquestions:
- variable: privateRegistry.registryUser
label: Private registry user
description: "User used to authenticate to private registry"
group: "Private Registry Settings"
description: "User used to authenticate to private registry."
type: string
default: ""
- variable: privateRegistry.registryPasswd
label: Private registry password
description: "Password used to authenticate to private registry"
group: "Private Registry Settings"
description: "Password used to authenticate to private registry."
type: password
default: ""
- variable: privateRegistry.registrySecret
label: Private registry secret name
description: "Longhorn will automatically generate a Kubernetes secret with this name and use it to pull images from your private registry."
group: "Private Registry Settings"
type: string
default: ""
- variable: longhorn.default_setting
default: "false"
description: "Customize the default settings before installing Longhorn for the first time. This option will only work if the cluster hasn't installed Longhorn."

View File

@ -1,3 +1,4 @@
{{- if .Values.privateRegistry.createSecret }}
{{- if .Values.privateRegistry.registrySecret }}
apiVersion: v1
kind: Secret
@ -9,3 +10,4 @@ type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ template "secret" . }}
{{- end }}
{{- end }}

View File

@ -114,6 +114,7 @@ defaultSettings:
guaranteedEngineManagerCPU: ~
guaranteedReplicaManagerCPU: ~
privateRegistry:
createSecret: ~
registryUrl: ~
registryUser: ~
registryPasswd: ~