Skip to content

Commit

Permalink
Add support for custom extensions repositories across templates
Browse files Browse the repository at this point in the history
In order to support airgap, users will need to be able to specify custom
extensions.imageRepository values and extensions.chartRepository URLs to
be able to download extension images and charts on 'ManagedClusters'.  These
additions across the helm templates allow them to do so.

Signed-off-by: Kyle Squizzato <[email protected]>
  • Loading branch information
squizzi committed Nov 4, 2024
1 parent 04311ce commit b3f489f
Show file tree
Hide file tree
Showing 16 changed files with 179 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,25 @@ spec:
helm:
repositories:
- name: aws-cloud-controller-manager
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://kubernetes.github.io/cloud-provider-aws
{{- end }}
- name: aws-ebs-csi-driver
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://kubernetes-sigs.github.io/aws-ebs-csi-driver
{{- end }}
charts:
- name: aws-cloud-controller-manager
namespace: kube-system
chartname: aws-cloud-controller-manager/aws-cloud-controller-manager
version: "0.0.8"
values: |
image:
repository: {{ .Values.extensions.imageRepository }}
tag: v1.30.3
args:
- --v=2
Expand All @@ -53,6 +62,31 @@ spec:
chartname: aws-ebs-csi-driver/aws-ebs-csi-driver
version: 2.33.0
values: |
image:
repository: {{ .Values.extensions.imageRepository }}
sidecars:
provisioner:
image:
repository: {{ .Values.extensions.imageRepository }}
attacher:
image:
repository: {{ .Values.extensions.imageRepository }}
snapshotter:
image:
repository: {{ .Values.extensions.imageRepository }}
livenessProbe:
image:
repository: {{ .Values.extensions.imageRepository }}
resizer:
image:
repository: {{ .Values.extensions.imageRepository }}
nodeDriverRegistrar:
image:
repository: {{ .Values.extensions.imageRepository }}
volumemodifier:
image:
repository: {{ .Values.extensions.imageRepository }}
# TODO
defaultStorageClass:
enabled: true
node:
Expand Down
6 changes: 6 additions & 0 deletions templates/cluster/aws-hosted-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ k0smotron:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

# extensions defines custom Helm and image repositories to use for pulling
# k0s extensions.
extensions:
chartRepository: ""
imageRepository: ""
33 changes: 33 additions & 0 deletions templates/cluster/aws-standalone-cp/templates/k0scontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@ spec:
helm:
repositories:
- name: aws-cloud-controller-manager
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://kubernetes.github.io/cloud-provider-aws
{{- end }}
- name: aws-ebs-csi-driver
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository}}
{{- else }}
url: https://kubernetes-sigs.github.io/aws-ebs-csi-driver
{{- end }}
charts:
- name: aws-cloud-controller-manager
namespace: kube-system
Expand All @@ -40,6 +48,7 @@ spec:
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
image:
repository: {{ .Values.extensions.imageRepository }}
tag: v1.30.3
args:
- --v=2
Expand All @@ -52,6 +61,30 @@ spec:
chartname: aws-ebs-csi-driver/aws-ebs-csi-driver
version: 2.33.0
values: |
image:
repository: {{ .Values.extensions.imageRepository }}
sidecars:
provisioner:
image:
repository: {{ .Values.extensions.imageRepository }}
attacher:
image:
repository: {{ .Values.extensions.imageRepository }}
snapshotter:
image:
repository: {{ .Values.extensions.imageRepository }}
livenessProbe:
image:
repository: {{ .Values.extensions.imageRepository }}
resizer:
image:
repository: {{ .Values.extensions.imageRepository }}
nodeDriverRegistrar:
image:
repository: {{ .Values.extensions.imageRepository }}
volumemodifier:
image:
repository: {{ .Values.extensions.imageRepository }}
defaultStorageClass:
enabled: true
node:
Expand Down
6 changes: 6 additions & 0 deletions templates/cluster/aws-standalone-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ worker:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

# extensions defines custom Helm and image repositories to use for pulling
# k0s extensions.
extensions:
chartRepository: ""
imageRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ spec:
helm:
repositories:
- name: mirantis
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://charts.mirantis.com
{{- end }}
- name: azuredisk-csi-driver
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts
{{- end }}
charts:
- name: cloud-provider-azure
namespace: kube-system
Expand All @@ -40,12 +48,17 @@ spec:
cloudConfigSecretName: azure-cloud-provider
nodeSelector:
node-role.kubernetes.io/control-plane: null
imageRepository: {{ .Values.extensions.imageRepository }}
cloudNodeManager:
imageRepository: {{ .Values.extensions.imageRepository }}
- name: azuredisk-csi-driver
namespace: kube-system
chartname: azuredisk-csi-driver/azuredisk-csi-driver
version: 1.30.3
order: 2
values: |
image:
baseRepo: {{ .Values.extensions.imageRepository }}
controller:
cloudConfigSecretName: azure-cloud-provider
node:
Expand Down
6 changes: 6 additions & 0 deletions templates/cluster/azure-hosted-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ k0smotron:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

# extensions defines custom Helm and image repositories to use for pulling
# k0s extensions.
extensions:
chartRepository: ""
imageRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@ spec:
helm:
repositories:
- name: mirantis
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://charts.mirantis.com
{{- end }}
- name: azuredisk-csi-driver
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts
{{- end }}
charts:
- name: cloud-provider-azure
namespace: kube-system
Expand All @@ -42,12 +50,17 @@ spec:
cloudConfigSecretName: azure-cloud-provider
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
imageRepository: {{ .Values.extensions.imageRepository }}
cloudNodeManager:
imageRepository: {{ .Values.extensions.imageRepository }}
- name: azuredisk-csi-driver
namespace: kube-system
chartname: azuredisk-csi-driver/azuredisk-csi-driver
version: 1.30.3
order: 2
values: |
image:
baseRepo: {{ .Values.extensions.imageRepository }}
controller:
cloudConfigSecretName: azure-cloud-provider
node:
Expand Down
6 changes: 6 additions & 0 deletions templates/cluster/azure-standalone-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ worker:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

# extensions defines custom Helm and image repositories to use for pulling
# k0s extensions.
extensions:
chartRepository: ""
imageRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ spec:
helm:
repositories:
- name: vsphere-cpi
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://kubernetes.github.io/cloud-provider-vsphere
{{- end }}
- name: mirantis
{{- if .Values.extensions.chartRepository }}
url: {{ .Values.extensions.chartRepository }}
{{- else }}
url: https://charts.mirantis.com
{{- end }}
charts:
- name: vsphere-cpi
chartname: vsphere-cpi/vsphere-cpi
Expand All @@ -40,6 +48,7 @@ spec:
enabled: false
daemonset:
affinity: null
image: {{ .Values.extensions.imageRepository }}/cloud-provider-vsphere
tolerations:
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
Expand Down Expand Up @@ -72,6 +81,20 @@ spec:
enabled: true
images:
driver:
repo: {{ .Values.extensions.imageRepository }}/csi-vsphere/driver
tag: v3.1.2
syncer:
repo: {{ .Values.extensions.imageRepository }}/csi-vsphere/syncer
tag: v3.1.2
nodeDriverRegistrar:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-node-driver-registrar
csiAttacher:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-attacher
csiResizer:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-resizer
csiProvisioner:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-provisioner
csiSnapshotter:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-snapshotter
livenessProbe:
repo: {{ .Values.extensions.imageRepository }}/csi-vsphere/livenessprobe
6 changes: 6 additions & 0 deletions templates/cluster/vsphere-hosted-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ k0smotron:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

# extensions defines custom Helm and image repositories to use for pulling
# k0s extensions.
extensions:
chartRepository: ""
imageRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ spec:
order: 1
namespace: kube-system
values: |
image:
repository: {{ .Values.extensions.imageRepository }}
config:
address: {{ .Values.controlPlaneEndpointIP }}
env:
Expand Down Expand Up @@ -74,6 +76,7 @@ spec:
config:
enabled: false
daemonset:
image: {{ .Values.extensions.imageRepository }}/cloud-provider-vsphere
tolerations:
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
Expand Down Expand Up @@ -104,9 +107,23 @@ spec:
enabled: true
images:
driver:
repo: {{ .Values.extensions.imageRepository }}/csi-vsphere/driver
tag: v3.1.2
syncer:
repo: {{ .Values.extensions.imageRepository }}/csi-vsphere/syncer
tag: v3.1.2
nodeDriverRegistrar:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-node-driver-registrar
csiAttacher:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-attacher
csiResizer:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-resizer
csiProvisioner:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-provisioner
csiSnapshotter:
repo: {{ .Values.extensions.imageRepository }}/sig-storage/csi-snapshotter
livenessProbe:
repo: {{ .Values.extensions.imageRepository }}/csi-vsphere/livenessprobe
machineTemplate:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
Expand Down
6 changes: 6 additions & 0 deletions templates/cluster/vsphere-standalone-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ worker:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

# extensions defines custom Helm and image repositories to use for pulling
# k0s extensions.
extensions:
chartRepository: ""
imageRepository: ""
2 changes: 1 addition & 1 deletion templates/provider/hmc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
env:
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ quote .Values.kubernetesClusterDomain }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag
image: {{ .Values.extensions.imageRepository }}:{{ .Values.image.tag
| default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.admissionWebhook.enabled }}
Expand Down
3 changes: 3 additions & 0 deletions templates/service/ingress-nginx-4-11-0/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global:
image:
registry: ""
3 changes: 3 additions & 0 deletions templates/service/ingress-nginx-4-11-3/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global:
image:
registry: ""
3 changes: 3 additions & 0 deletions templates/service/kyverno/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
global:
image:
registry: ""

0 comments on commit b3f489f

Please sign in to comment.