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 22, 2024
1 parent 351dc53 commit afcb387
Show file tree
Hide file tree
Showing 20 changed files with 176 additions and 45 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.31.1+k0s.1

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 @@ -47,3 +47,10 @@ worker:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

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 @@ -25,19 +25,28 @@ spec:
extensions:
helm:
repositories:
- name: mirantis
- name: cloud-provider-azure
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://charts.mirantis.com
{{- 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
chartname: mirantis/cloud-provider-azure
chartname: cloud-provider-azure/cloud-provider-azure
version: 1.31.2
order: 1
values: |
cloudControllerManager:
cloudConfigSecretName: azure-cloud-provider
imageRepository: {{ .Values.image.repository }}
nodeSelector:
node-role.kubernetes.io/control-plane: null
- name: azuredisk-csi-driver
Expand All @@ -46,9 +55,7 @@ spec:
version: 1.30.3
order: 2
values: |
controller:
cloudConfigSecretName: azure-cloud-provider
node:
cloudConfigSecretName: azure-cloud-provider
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.31.1+k0s.1

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 @@ -27,10 +27,18 @@ spec:
extensions:
helm:
repositories:
- name: mirantis
- name: cloud-provider-azure
{{- if .Values.extensionsChartRepository }}
url: {{ .Values.extensionsChartRepository }}
{{- else }}
url: https://charts.mirantis.com
{{- 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 @@ -40,8 +48,9 @@ spec:
values: |
cloudControllerManager:
cloudConfigSecretName: azure-cloud-provider
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
Expand All @@ -52,6 +61,8 @@ spec:
cloudConfigSecretName: azure-cloud-provider
node:
cloudConfigSecretName: azure-cloud-provider
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.31.1+k0s.1

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 @@ -39,6 +47,7 @@ spec:
config:
enabled: false
daemonset:
image: {{ .Values.image.repository }}/cloud-provider-vsphere
affinity: null
tolerations:
- effect: NoSchedule
Expand Down Expand Up @@ -72,6 +81,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 @@ -42,3 +42,10 @@ k0smotron:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

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,46 +34,30 @@ 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:
enabled: false
daemonset:
image: {{ .Values.image.repository }}/cloud-provider-vsphere
affinity: null
tolerations:
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
Expand All @@ -93,20 +77,41 @@ spec:
- name: vsphere-csi
chartname: mirantis/vsphere-csi-driver
version: 0.0.2
order: 3
order: 2
namespace: kube-system
values: |
vcenterConfig:
enabled: false
enabled: true
clusterID: {{ include "cluster.name" . }}
vcenter: {{ .Values.vsphere.server }}
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 @@ -46,3 +46,10 @@ worker:
# K0s parameters
k0s:
version: v1.31.1+k0s.1

image:
repository: ""

# extensionsChartRepository specifies a custom Helm chart repository for
# hosting k0s extension charts
extensionsChartRepository: ""
Loading

0 comments on commit afcb387

Please sign in to comment.