Skip to content

Commit

Permalink
Add support for custom image.repository and chartExtensionRepository …
Browse files Browse the repository at this point in the history
…across templates

In order to support airgap, users will need to be able to specify custom
image.repository values and chartExtensionRepository 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 Oct 16, 2024
1 parent 3f9a2ad commit c7480ab
Show file tree
Hide file tree
Showing 20 changed files with 167 additions and 37 deletions.
4 changes: 2 additions & 2 deletions config/dev/aws-managedcluster.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: hmc.mirantis.com/v1alpha1
kind: ManagedCluster
metadata:
name: aws-dev
name: squizz-aws-dev
namespace: ${NAMESPACE}
spec:
credential: aws-cluster-identity-cred
Expand All @@ -13,7 +13,7 @@ spec:
instanceType: t3.small
controlPlaneNumber: 1
publicIP: true
region: us-west-2
region: us-west-1
worker:
instanceType: t3.small
workersNumber: 1
Expand Down
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.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://kubernetes.github.io/cloud-provider-aws
{{- end }}
- name: aws-ebs-csi-driver
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- 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.image.repository }}
tag: v1.30.3
args:
- --v=2
Expand All @@ -53,6 +62,8 @@ spec:
chartname: aws-ebs-csi-driver/aws-ebs-csi-driver
version: 2.33.0
values: |
image:
repository: {{ .Values.image.repository }}
defaultStorageClass:
enabled: true
node:
Expand Down
7 changes: 7 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,10 @@ k0smotron:
# K0s parameters
k0s:
version: v1.30.4+k0s.0

image:
repository: ""

# extensionsChartRepository specifies a custom Helm chart repository for
# hosting k0s extension charts
extensionsChartRepository: ""
19 changes: 15 additions & 4 deletions templates/cluster/aws-standalone-cp/templates/k0scontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ spec:
extensions:
helm:
repositories:
- name: aws-cloud-controller-manager
url: https://kubernetes.github.io/cloud-provider-aws
- name: aws-ebs-csi-driver
url: https://kubernetes-sigs.github.io/aws-ebs-csi-driver
- name: aws-cloud-controller-manager
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://kubernetes.github.io/cloud-provider-aws
{{- end }}
- name: aws-ebs-csi-driver
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- 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.image.repository }}
tag: v1.30.3
args:
- --v=2
Expand All @@ -52,6 +61,8 @@ spec:
chartname: aws-ebs-csi-driver/aws-ebs-csi-driver
version: 2.33.0
values: |
image:
repository: {{ .Values.image.repository }}
defaultStorageClass:
enabled: true
node:
Expand Down
7 changes: 7 additions & 0 deletions templates/cluster/aws-standalone-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ k0s:
# Optionally install applications defined under
# templates/beachheadservices into target cluster
installBeachHeadServices: false

image:
repository: ""

# extensionsChartRepository specifies a custom Helm chart repository for
# hosting k0s extension charts
extensionsChartRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ spec:
helm:
repositories:
- name: cloud-provider-azure
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo
{{- end }}
- name: azuredisk-csi-driver
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts
{{- end }}
charts:
- name: cloud-provider-azure
namespace: kube-system
Expand All @@ -37,6 +45,7 @@ spec:
order: 1
values: |
cloudControllerManager:
imageRepository: {{ .Values.image.repository }}
nodeSelector:
node-role.kubernetes.io/control-plane: null
- name: azuredisk-csi-driver
Expand All @@ -45,5 +54,7 @@ spec:
version: 1.30.3
order: 2
values: |
image:
baseRepo: {{ .Values.image.repository }}
linux:
kubelet: "/var/lib/k0s/kubelet"
7 changes: 7 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,10 @@ k0smotron:
# K0s parameters
k0s:
version: v1.30.4+k0s.0

image:
repository: ""

# extensionsChartRepository specifies a custom Helm chart repository for
# hosting k0s extension charts
extensionsChartRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ spec:
helm:
repositories:
- name: cloud-provider-azure
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://raw.githubusercontent.com/kubernetes-sigs/cloud-provider-azure/master/helm/repo
{{- end }}
- name: azuredisk-csi-driver
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts
{{- end }}
charts:
- name: cloud-provider-azure
namespace: kube-system
Expand All @@ -46,14 +54,17 @@ spec:
order: 1
values: |
cloudControllerManager:
imageRepository: {{ .Values.image.repository }}
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
node-role.kubernetes.io/control-plane: null
- name: azuredisk-csi-driver
namespace: kube-system
chartname: azuredisk-csi-driver/azuredisk-csi-driver
version: 1.30.3
order: 2
values: |
image:
baseRepo: {{ .Values.image.repository }}
linux:
kubelet: "/var/lib/k0s/kubelet"
machineTemplate:
Expand Down
7 changes: 7 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,10 @@ worker:
# K0s parameters
k0s:
version: v1.30.4+k0s.0

image:
repository: ""

# extensionsChartRepository specifies a custom Helm chart repository for
# hosting k0s extension charts
extensionsChartRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ spec:
helm:
repositories:
- name: vsphere-cpi
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://kubernetes.github.io/cloud-provider-vsphere
- name: mirantis
{{- end }}
- name: vsphere-csi-driver
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://charts.mirantis.com
{{- end }}
charts:
- name: vsphere-cpi
chartname: vsphere-cpi/vsphere-cpi
Expand All @@ -43,6 +51,7 @@ spec:
username: "{{ .Values.vsphere.username }}"
password: "{{ .Values.vsphere.password }}"
daemonset:
image: {{ .Values.image.repository }}/cloud-provider-vsphere
affinity: null
tolerations:
- effect: NoSchedule
Expand Down Expand Up @@ -81,6 +90,20 @@ spec:
enabled: true
images:
driver:
repo: {{ .Values.image.repository }}/csi-vsphere/driver
tag: v3.1.2
syncer:
repo: {{ .Values.image.repository }}/csi-vsphere/syncer
tag: v3.1.2
nodeDriverRegistrar:
repo: {{ .Values.image.repository }}/sig-storage/csi-node-driver-registrar
csiAttacher:
repo: {{ .Values.image.repository }}/sig-storage/csi-attacher
csiResizer:
repo: {{ .Values.image.repository }}/sig-storage/csi-resizer
csiProvisioner:
repo: {{ .Values.image.repository }}/sig-storage/csi-provisioner
csiSnapshotter:
repo: {{ .Values.image.repository }}/sig-storage/csi-snapshotter
livenessProbe:
repo: {{ .Values.image.repository }}/csi-vsphere/livenessprobe
7 changes: 7 additions & 0 deletions templates/cluster/vsphere-hosted-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ k0smotron:
# K0s parameters
k0s:
version: v1.30.4+k0s.0

image:
repository: ""

# extensionsChartRepository specifies a custom Helm chart repository for
# hosting k0s extension charts
extensionsChartRepository: ""
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,23 @@ spec:
extensions:
helm:
repositories:
- name: kube-vip
url: https://kube-vip.github.io/helm-charts
- name: vsphere-cpi
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://kubernetes.github.io/cloud-provider-vsphere
- name: mirantis
{{- end }}
- name: vsphere-csi-driver
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://charts.mirantis.com
{{- end }}
charts:
- name: kube-vip
chartname: kube-vip/kube-vip
version: 0.6.1
order: 1
namespace: kube-system
values: |
config:
address: {{ .Values.controlPlaneEndpointIP }}
env:
svc_enable: "true"
cp_enable: "true"
lb_enable: "false"
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
operator: Exists
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
value: "true"
- name: vsphere-cpi
chartname: vsphere-cpi/vsphere-cpi
version: 1.31.0
order: 2
order: 1
namespace: kube-system
values: |
config:
Expand All @@ -78,6 +60,8 @@ spec:
username: "{{ .Values.vsphere.username }}"
password: "{{ .Values.vsphere.password }}"
daemonset:
image: {{ .Values.image.repository }}/cloud-provider-vsphere
affinity: null
tolerations:
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
Expand All @@ -97,7 +81,7 @@ spec:
- name: vsphere-csi
chartname: mirantis/vsphere-csi-driver
version: 0.0.2
order: 3
order: 2
namespace: kube-system
values: |
vcenterConfig:
Expand All @@ -107,15 +91,31 @@ spec:
user: "{{ .Values.vsphere.username }}"
password: "{{ .Values.vsphere.password }}"
datacenters: {{ .Values.vsphere.datacenter }}
controller:
nodeAffinity: null
node:
kubeletPath: /var/lib/k0s/kubelet
defaultStorageClass:
enabled: true
images:
driver:
repo: {{ .Values.image.repository }}/csi-vsphere/driver
tag: v3.1.2
syncer:
repo: {{ .Values.image.repository }}/csi-vsphere/syncer
tag: v3.1.2
nodeDriverRegistrar:
repo: {{ .Values.image.repository }}/sig-storage/csi-node-driver-registrar
csiAttacher:
repo: {{ .Values.image.repository }}/sig-storage/csi-attacher
csiResizer:
repo: {{ .Values.image.repository }}/sig-storage/csi-resizer
csiProvisioner:
repo: {{ .Values.image.repository }}/sig-storage/csi-provisioner
csiSnapshotter:
repo: {{ .Values.image.repository }}/sig-storage/csi-snapshotter
livenessProbe:
repo: {{ .Values.image.repository }}/csi-vsphere/livenessprobe
machineTemplate:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
Expand Down
7 changes: 7 additions & 0 deletions templates/cluster/vsphere-standalone-cp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ worker:
# K0s parameters
k0s:
version: v1.30.4+k0s.0

image:
repository: ""

# extensionsChartRepository specifies a custom Helm chart repository for
# hosting k0s extension charts
extensionsChartRepository: ""
3 changes: 3 additions & 0 deletions templates/provider/cluster-api-provider-aws/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ configSecret:

config:
AWS_B64ENCODED_CREDENTIALS: Cg==

image:
repository: ""
Loading

0 comments on commit c7480ab

Please sign in to comment.