support global images registry for chart

Signed-off-by: calvin0327 <wen.chen@daocloud.io>
This commit is contained in:
calvin0327 2022-06-05 19:41:06 +08:00 committed by calvin
parent 5c3336e84c
commit 7332170603
18 changed files with 266 additions and 67 deletions

View File

@ -40,6 +40,10 @@ jobs:
with:
version: v3.6.0
- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-testing (list-changed)
id: list-changed
run: |

View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

View File

@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.16.0
digest: sha256:edc0e9ee0573d1be77048bdf765947ede8be456b86eb8e166d8d132a1f4ca885
generated: "2022-06-05T19:10:54.600317+08:00"

View File

@ -20,13 +20,20 @@ kubeVersion: ">= 1.16.0-0"
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.4
version: 0.0.5
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: v1.1.0
# This is karmada dependencies
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.x.x
# This is karmada maintainers
maintainers:
- name: jrkeen
email: jrkeen@hotmail.com

View File

@ -125,6 +125,16 @@ helm install karmada-scheduler-estimator -n karmada-system ./charts/karmada
```
## Configuration
### Global parameters
| Name | Description | Value |
| ------------------------- | ----------------------------------------------- | ----- |
| `global.imageRegistry` | Global Docker image registry | `""` |
### Common parameters
| Name | Description | Value |
|-------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `installMode` | InstallMode "host", "agent" and "component" are provided, "host" means install karmada in the control-cluster, "agent" means install agent client in the member cluster, "component" means install selected components in the control-cluster | `"host"` |

View File

@ -227,3 +227,83 @@ app: {{- include "karmada.name" .}}-search
{{- end }}
{{- end }}
{{- end -}}
{{/*
Return the proper karmada internal etcd image name
*/}}
{{- define "karmada.internal.etcd.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.etcd.internal.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada agent image name
*/}}
{{- define "karmada.agent.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.agent.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada apiServer image name
*/}}
{{- define "karmada.apiServer.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.apiServer.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada controllerManager image name
*/}}
{{- define "karmada.controllerManager.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.controllerManager.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada descheduler image name
*/}}
{{- define "karmada.descheduler.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.descheduler.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada schedulerEstimator image name
*/}}
{{- define "karmada.schedulerEstimator.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.schedulerEstimator.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada scheduler image name
*/}}
{{- define "karmada.scheduler.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.scheduler.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada webhook image name
*/}}
{{- define "karmada.webhook.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.webhook.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada aggregatedApiServer image name
*/}}
{{- define "karmada.aggregatedApiServer.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.aggregatedApiServer.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada search image name
*/}}
{{- define "karmada.search.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.search.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper karmada kubeControllerManager image name
*/}}
{{- define "karmada.kubeControllerManager.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.kubeControllerManager.image "global" .Values.global) }}
{{- end -}}

View File

@ -42,7 +42,7 @@ spec:
- operator: Exists
containers:
- name: etcd
image: "{{ .Values.etcd.internal.image.repository }}:{{ .Values.etcd.internal.image.tag | default "latest" }}"
image: {{ template "karmada.internal.etcd.image" . }}
imagePullPolicy: {{ .Values.etcd.internal.image.pullPolicy }}
livenessProbe:
exec:

View File

@ -103,7 +103,7 @@ spec:
serviceAccountName: {{ $name }}
containers:
- name: {{ $name }}
image: {{ .Values.agent.image.repository}}:{{ .Values.agent.image.tag | default "latest" }}
image: {{ template "karmada.agent.image" . }}
imagePullPolicy: {{ .Values.agent.image.pullPolicy }}
command:
- /bin/karmada-agent

View File

@ -30,7 +30,7 @@ spec:
automountServiceAccountToken: false
containers:
- name: {{ $name }}-aggregated-apiserver
image: "{{ .Values.aggregatedApiServer.image.repository }}:{{ .Values.aggregatedApiServer.image.tag | default "latest" }}"
image: {{ template "karmada.aggregatedApiServer.image" . }}
imagePullPolicy: {{ .Values.aggregatedApiServer.image.pullPolicy }}
volumeMounts:
{{- include "karmada.kubeconfig.volumeMount" . | nindent 12 }}

View File

@ -32,7 +32,7 @@ spec:
{{- end }}
containers:
- name: {{ $name }}-apiserver
image: "{{ .Values.apiServer.image.repository }}:{{ .Values.apiServer.image.tag | default "latest" }}"
image: {{ template "karmada.apiServer.image" . }}
imagePullPolicy: {{ .Values.apiServer.image.pullPolicy }}
command:
- kube-apiserver

View File

@ -53,7 +53,7 @@ spec:
{{- include "karmada.kubeconfig.volume" . | nindent 8 }}
containers:
- name: {{ $name }}-controller-manager
image: "{{ .Values.controllerManager.image.repository }}:{{ .Values.controllerManager.image.tag | default "latest" }}"
image: {{ template "karmada.controllerManager.image" . }}
imagePullPolicy: {{ .Values.controllerManager.image.pullPolicy }}
command:
- /bin/karmada-controller-manager

View File

@ -44,7 +44,7 @@ spec:
{{- end }}
containers:
- name: {{ $name }}
image: {{ .Values.descheduler.image.repository}}:{{ .Values.descheduler.image.tag | default "latest" }}
image: {{ template "karmada.descheduler.image" . }}
imagePullPolicy: {{ .Values.descheduler.image.pullPolicy }}
command:
- /bin/karmada-descheduler

View File

@ -37,7 +37,7 @@ spec:
{{- end }}
containers:
- name: karmada-scheduler-estimator
image: "{{ .Values.schedulerEstimator.image.repository }}:{{ .Values.schedulerEstimator.image.tag | default "latest" }}"
image: {{ template "karmada.schedulerEstimator.image" . }}
imagePullPolicy: {{ .Values.schedulerEstimator.image.pullPolicy }}
command:
- /bin/karmada-scheduler-estimator

View File

@ -52,7 +52,7 @@ spec:
serviceAccountName: {{ $name}}-scheduler
containers:
- name: {{ $name }}-scheduler
image: {{ .Values.scheduler.image.repository}}:{{ .Values.scheduler.image.tag | default "latest" }}
image: {{ template "karmada.scheduler.image" .}}
imagePullPolicy: {{ .Values.scheduler.image.pullPolicy }}
command:
- /bin/karmada-scheduler

View File

@ -42,7 +42,7 @@ spec:
automountServiceAccountToken: false
containers:
- name: {{ $name }}-search
image: {{ .Values.search.image.repository}}:{{ .Values.search.image.tag | default "latest" }}
image: {{ template "karmada.search.image" . }}
imagePullPolicy: {{ .Values.search.image.pullPolicy }}
volumeMounts:
- name: k8s-certs

View File

@ -53,7 +53,7 @@ spec:
{{- end }}
containers:
- name: {{ $name }}-webhook
image: {{ .Values.webhook.image.repository}}:{{ .Values.webhook.image.tag | default "latest" }}
image: {{ template "karmada.webhook.image" . }}
imagePullPolicy: {{ .Values.webhook.image.pullPolicy }}
command:
- /bin/karmada-webhook

View File

@ -72,7 +72,7 @@ spec:
- --service-cluster-ip-range=10.96.0.0/12
- --use-service-account-credentials=true
- --v=5
image: {{ .Values.kubeControllerManager.image.repository}}:{{ .Values.kubeControllerManager.image.tag | default "latest" }}
image: {{ template "karmada.kubeControllerManager.image" . }}
livenessProbe:
failureThreshold: 8
httpGet:

View File

@ -2,6 +2,11 @@
## This is a YAML-formatted file.
## Declare variables to be passed into your templates.
## @param global karmada global config
global:
## @param global.imageRegistry Global Docker image registry
imageRegistry: ""
## @param installMode "host" and "agent" are provided
## "host" means install karmada in the control-cluster
## "agent" means install agent client in the member cluster
@ -99,13 +104,19 @@ scheduler:
podLabels: {}
## @param scheduler.imagePullSecrets image pull secret of the scheduler
imagePullSecrets: []
## @param image.registry karmada scheduler image registry
## @param image.repository karmada scheduler image repository
## @param image.tag karmada scheduler image tag (immutable tags are recommended)
## @param image.pullPolicy karmada scheduler image pull policy
##
image:
## @param scheduler.image.repository image of the scheduler
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-scheduler
## @param scheduler.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param scheduler.image.tag overrides the image tag whose default is the latest
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-scheduler
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param scheduler.resources resource quota of the scheduler
resources: {}
# If you do want to specify resources, uncomment the following
@ -144,13 +155,19 @@ webhook:
podLabels: {}
## @param webhook.imagePullSecrets image pull secret of the webhook
imagePullSecrets: []
## @param image.registry karmada webhook image registry
## @param image.repository karmada webhook image repository
## @param image.tag karmada webhook image tag (immutable tags are recommended)
## @param image.pullPolicy karmada webhook image pull policy
##
image:
## @param webhook.image.repository image of the webhook
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-webhook
## @param webhook.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param webhook.image.tag overrides the image tag whose default is the latest
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-webhook
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param webhook.resources resource quota of the webhook
resources: {}
# If you do want to specify resources, uncomment the following
@ -189,13 +206,19 @@ controllerManager:
podLabels: {}
## @param controllerManager.imagePullSecrets image pull secret of the karmada-controller-manager
imagePullSecrets: []
## @param image.registry karmada controller manager image registry
## @param image.repository karmada controller manager image repository
## @param image.tag karmada controller manager image tag (immutable tags are recommended)
## @param image.pullPolicy karmada controller manager image pull policy
##
image:
## @param controllerManager.image.repository image of the controller manager
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-controller-manager
## @param controllerManager.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param controllerManager.image.tag overrides the image tag whose default is the latest
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-controller-manager
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param controllerManager.resources resource quota of the karmada-controller-manager
resources: {}
# If you do want to specify resources, uncomment the following
@ -234,13 +257,19 @@ apiServer:
podLabels: {}
## @param apiServer.imagePullSecrets image pull secret of the karmada-apiserver
imagePullSecrets: []
## @param image.registry keube-apiserver image registry
## @param image.repository keube-apiserver image repository
## @param image.tag keube-apiserver image tag (immutable tags are recommended)
## @param image.pullPolicy keube-apiserver image pull policy
##
image:
## @param apiServer.image.repository image of the apiserver
repository: k8s.gcr.io/kube-apiserver
## @param apiServer.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param apiServer.image.tag overrides the image tag whose default is the latest
registry: k8s.gcr.io
repository: kube-apiserver
tag: "v1.22.10"
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param apiServer.resources resource quota of the karmada-apiserver
resources: {}
# If you do want to specify resources, uncomment the following
@ -303,13 +332,19 @@ aggregatedApiServer:
podLabels: {}
## @param aggregatedApiServer.imagePullSecrets image of the karmada-aggregated-apiserver
imagePullSecrets: []
## @param image.registry karmada aggregatedApiServer image registry
## @param image.repository karmada aggregatedApiServer image repository
## @param image.tag karmada aggregatedApiServer image tag (immutable tags are recommended)
## @param image.pullPolicy karmada aggregatedApiServer image pull policy
##
image:
## @param aggregatedApiServer.image.repository image of the apiserver
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-aggregated-apiserver
## @param aggregatedApiServer.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param aggregatedApiServer.image.tag overrides the image tag whose default is the latest
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-aggregated-apiserver
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param aggregatedApiServer.resources resource quota of the karmada-aggregated-apiserver
resources:
requests:
@ -350,13 +385,19 @@ kubeControllerManager:
podLabels: {}
## @param kubeControllerManager.imagePullSecrets image pull secret of the kube-controller-manager
imagePullSecrets: []
## @param image.registry kubeControllerManager image registry
## @param image.repository kubeControllerManager image repository
## @param image.tag kubeControllerManager image tag (immutable tags are recommended)
## @param image.pullPolicy kubeControllerManager image pull policy
##
image:
## @param kubeControllerManager.image.repository image of the kube controller manager
repository: k8s.gcr.io/kube-controller-manager
## @param kubeControllerManager.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param kubeControllerManager.image.tag overrides the image tag whose default is the latest
registry: k8s.gcr.io
repository: kube-controller-manager
tag: "v1.22.10"
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param kubeControllerManager.resources resource quota of the kube-controller-manager
resources:
# If you do want to specify resources, uncomment the following
@ -413,13 +454,19 @@ etcd:
internal:
## @param etcd.internal.replicaCount target replicas
replicaCount: 1
## @param image.registry etcd image registry
## @param image.repository etcd image repository
## @param image.tag etcd image tag (immutable tags are recommended)
## @param image.pullPolicy etcd image pull policy
##
image:
## @param etcd.internal.image.repository image of the etcd
repository: k8s.gcr.io/etcd
## @param etcd.internal.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param etcd.internal.image.tag overrides the image tag whose default is the latest
registry: k8s.gcr.io
repository: etcd
tag: "3.5.3-0"
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param etcd.internal.storageType storage type for etcd data
## "pvc" means using volumeClaimTemplates
## "hostPath" means using hostPath
@ -474,13 +521,19 @@ agent:
podLabels: {}
## @param agent.imagePullSecrets image pull secret of the agent
imagePullSecrets: []
## @param image.registry karmada agent image registry
## @param image.repository karmada agent image repository
## @param image.tag karmada agent image tag (immutable tags are recommended)
## @param image.pullPolicy karmada agent image pull policy
##
image:
## @param agent.image.repository image of the agent
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-agent
## @param agent.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param agent.image.tag overrides the image tag whose default is the latest
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-agent
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param agent.resources
resources: {}
# If you do want to specify resources, uncomment the following
@ -539,13 +592,19 @@ schedulerEstimator:
podLabels: {}
## @param schedulerEstimator.imagePullSecrets image pull secret of the scheduler-estimator
imagePullSecrets: []
## @param image.registry karmada schedulerEstimator image registry
## @param image.repository karmada schedulerEstimator image repository
## @param image.tag karmada schedulerEstimator image tag (immutable tags are recommended)
## @param image.pullPolicy karmada schedulerEstimator image pull policy
##
image:
## @param schedulerEstimator.image.repository image of the apiserver
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-scheduler-estimator
## @param schedulerEstimator.image.pullPolicy pull policy of image
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-scheduler-estimator
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param schedulerEstimator.image.tag overrides the image tag whose default is the latest
tag: "latest"
## @param schedulerEstimator.resources resource quota of the scheduler-estimator
resources: {}
# If you do want to specify resources, uncomment the following
@ -584,13 +643,19 @@ descheduler:
podLabels: {}
## @param descheduler.imagePullSecrets image pull secret of the descheduler
imagePullSecrets: []
## @param image.registry karmada descheduler image registry
## @param image.repository karmada descheduler image repository
## @param image.tag karmada descheduler image tag (immutable tags are recommended)
## @param image.pullPolicy karmada descheduler image pull policy
##
image:
## @param descheduler.image.repository image of the descheduler
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-descheduler
## @param descheduler.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param descheduler.image.tag overrides the image tag whose default is the latest
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-descheduler
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param descheduler.resources resource quota of the descheduler
resources: {}
# If you do want to specify resources, uncomment the following
@ -630,13 +695,19 @@ search:
podLabels: {}
## @param search.imagePullSecrets image pull secret of the search
imagePullSecrets: []
## @param image.registry karmada search image registry
## @param image.repository karmada search image repository
## @param image.tag karmada search image tag (immutable tags are recommended)
## @param image.pullPolicy karmada search image pull policy
##
image:
## @param search.image.repository image of the descheduler
repository: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-search
## @param search.image.pullPolicy pull policy of image
pullPolicy: IfNotPresent
## @param search.image.tag overrides the image tag whose default is the latest
registry: swr.ap-southeast-1.myhuaweicloud.com
repository: karmada/karmada-search
tag: latest
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
##
pullPolicy: IfNotPresent
## @param search.resources resource quota of the search
resources: {}
# If you do want to specify resources, uncomment the following