Add airgap support to chart

Signed-off-by: meldafrawi <mohamed.eldafrawi@rancher.com>
This commit is contained in:
meldafrawi 2020-03-20 00:20:09 +02:00 committed by Sheng Yang
parent 57785d98b8
commit 6b990aea63
10 changed files with 124 additions and 1 deletions

View File

@ -4,6 +4,54 @@ labels:
io.rancher.certified: experimental
namespace: longhorn-system
questions:
- variable: image.longhorn.manager
default: longhornio/longhorn-manager
description: "Specify Longhorn Manager Image Name"
type: string
label: Longhorn Manager Image Name
group: "Longhorn Images Settings"
- variable: image.longhorn.managerTag
default: v0.8.0
description: "Specify Longhorn Manager Image Tag"
type: string
label: Longhorn Manager Image Tag
group: "Longhorn Images Settings"
- variable: image.longhorn.engine
default: longhornio/longhorn-engine
description: "Specify Longhorn Engine Image Name"
type: string
label: Longhorn Engine Image Name
group: "Longhorn Images Settings"
- variable: image.longhorn.engineTag
default: v0.8.0
description: "Specify Longhorn Engine Image Tag"
type: string
label: Longhorn Engine Image Tag
group: "Longhorn Images Settings"
- variable: image.longhorn.ui
default: longhornio/longhorn-ui
description: "Specify Longhorn UI Image Name"
type: string
label: Longhorn UI Image Name
group: "Longhorn Images Settings"
- variable: image.longhorn.uiTag
default: v0.8.0
description: "Specify Longhorn UI Image Tag"
type: string
label: Longhorn UI Image Tag
group: "Longhorn Images Settings"
- variable: image.longhorn.instanceManager
default: longhornio/longhorn-instance-manager
description: "Specify Longhorn Instance Manager Image Name"
type: string
label: Longhorn Instance Manager Image Name
group: "Longhorn Images Settings"
- variable: image.longhorn.instanceManagerTag
default: v1_20200301
description: "Specify Longhorn Instance Manager Image Tag"
type: string
label: Longhorn Manager Image Tag
group: "Longhorn Images Settings"
- variable: csi.attacherImage
default:
description: "Specify CSI attacher image. Leave blank to autodetect."
@ -22,6 +70,12 @@ questions:
type: string
label: Longhorn CSI Driver Registrar Image
group: "Longhorn CSI Driver Settings"
- variable: csi.resizerImage
default:
description: "Specify CSI Driver Resizer image. Leave blank to autodetect."
type: string
label: Longhorn CSI Driver Resizer Image
group: "Longhorn CSI Driver Settings"
- variable: csi.kubeletRootDir
default:
description: "Specify kubelet root-dir. Leave blank to autodetect."
@ -59,7 +113,6 @@ questions:
min: 1
max: 10
label: Default Storage Class Replica Count
- variable: defaultSettings.backupTarget
label: Backup Target
description: "The target used for backup. Support NFS or S3."
@ -144,6 +197,30 @@ questions:
group: "Longhorn Default Settings"
type: string
default: ""
- variable: defaultSettings.registrySecret
label: Private registry secret
description: "The Kubernetes Secret name"
group: "Longhorn Default Settings"
type: string
default: ""
- variable: privateRegistry.registryUrl
label: Private registry URL
description: "URL of private registry"
group: "Private Registry Settings"
type: string
default: ""
- variable: privateRegistry.registryUser
label: Private registry user
description: "User used to authenticate to private registry"
group: "Private Registry Settings"
type: string
default: ""
- variable: privateRegistry.registryPasswd
label: Private registry password
description: "Password used to authenticate to private registry"
group: "Private Registry Settings"
type: password
default: ""
- variable: ingress.enabled
default: "false"
description: "Expose app using Layer 7 Load Balancer - ingress"

View File

@ -20,3 +20,8 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $fullname := (include "longhorn.fullname" .) -}}
{{- printf "http://%s-backend:9500" $fullname | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "secret" }}
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.privateRegistry.registryUrl (printf "%s:%s" .Values.privateRegistry.registryUser .Values.privateRegistry.registryPasswd | b64enc) | b64enc }}
{{- end }}

View File

@ -80,6 +80,10 @@ spec:
- name: longhorn-default-setting
configMap:
name: longhorn-default-setting
{{- if .Values.defaultSettings.registrySecret }}
imagePullSecrets:
- name: {{ .Values.defaultSettings.registrySecret }}
{{- end }}
serviceAccountName: longhorn-service-account
updateStrategy:
rollingUpdate:

View File

@ -18,3 +18,4 @@ data:
default-longhorn-static-storage-class: {{ .Values.defaultSettings.defaultLonghornStaticStorageClass }}
backupstore-poll-interval: {{ .Values.defaultSettings.backupstorePollInterval }}
taint-toleration: {{ .Values.defaultSettings.taintToleration }}
registry-secret: {{ .Values.defaultSettings.registrySecret }}

View File

@ -58,6 +58,10 @@ spec:
- name: CSI_DRIVER_REGISTRAR_IMAGE
value: {{ .Values.csi.driverRegistrarImage }}
{{- end }}
{{- if .Values.csi.resizerImage }}
- name: CSI_RESIZER_IMAGE
value: {{ .Values.csi.resizerImage }}
{{- end }}
{{- if .Values.csi.attacherReplicaCount }}
- name: CSI_ATTACHER_REPLICA_COUNT
value: "{{ .Values.csi.attacherReplicaCount }}"
@ -66,4 +70,8 @@ spec:
- name: CSI_PROVISIONER_REPLICA_COUNT
value: "{{ .Values.csi.provisionerReplicaCount }}"
{{- end }}
{{- if .Values.defaultSettings.registrySecret }}
imagePullSecrets:
- name: {{ .Values.defaultSettings.registrySecret }}
{{- end }}
serviceAccountName: longhorn-service-account

View File

@ -24,6 +24,10 @@ spec:
env:
- name: LONGHORN_MANAGER_IP
value: "http://longhorn-backend:9500"
{{- if .Values.defaultSettings.registrySecret }}
imagePullSecrets:
- name: {{ .Values.defaultSettings.registrySecret }}
{{- end }}
---
kind: Service
apiVersion: v1

View File

@ -26,4 +26,8 @@ spec:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: OnFailure
{{- if .Values.defaultSettings.registrySecret }}
imagePullSecrets:
- name: {{ .Values.defaultSettings.registrySecret }}
{{- end }}
serviceAccountName: longhorn-service-account

View File

@ -0,0 +1,9 @@
{{- if .Values.defaultSettings.registrySecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.defaultSettings.registrySecret }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ template "secret" . }}
{{- end }}

View File

@ -27,4 +27,8 @@ spec:
fieldRef:
fieldPath: metadata.namespace
restartPolicy: OnFailure
{{- if .Values.defaultSettings.registrySecret }}
imagePullSecrets:
- name: {{ .Values.defaultSettings.registrySecret }}
{{- end }}
serviceAccountName: longhorn-service-account

View File

@ -29,6 +29,7 @@ csi:
attacherImage:
provisionerImage:
driverRegistrarImage:
resizerImage:
kubeletRootDir:
attacherReplicaCount:
provisionerReplicaCount:
@ -47,6 +48,12 @@ defaultSettings:
defaultLonghornStaticStorageClass:
backupstorePollInterval:
taintToleration:
registrySecret:
privateRegistry:
registryUrl:
registryUser:
registryPasswd:
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious