Skip to content

Commit

Permalink
move logic for overriding CCM into kustomize instead of separate helm…
Browse files Browse the repository at this point in the history
…ChartProxies (#298)

* move logic for overriding CCM into kustomize instead of separate helmChartProxies
  • Loading branch information
eljohnson92 authored May 1, 2024
1 parent 3bc1f07 commit 5180d4c
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ metadata:
name: ${CLUSTER_NAME}-linode-cloud-controller-manager
spec:
clusterSelector:
matchExpressions:
- {key: vpcless, operator: DoesNotExist}
- {key: ccm, operator: In, values: ["${CLUSTER_NAME}-linode"]}
matchLabels:
ccm: "${CLUSTER_NAME}-linode"
repoURL: https://linode.github.io/linode-cloud-controller-manager/
chartName: ccm-linode
namespace: kube-system
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- linode-ccm.yaml
- linode-ccm-vpcless.yaml
- ccm-linode.yaml
32 changes: 0 additions & 32 deletions templates/addons/cilium/cilium-ipv6.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions templates/addons/cilium/cilium-vxlan.yaml

This file was deleted.

6 changes: 2 additions & 4 deletions templates/addons/cilium/cilium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ metadata:
name: ${CLUSTER_NAME}-cilium
spec:
clusterSelector:
matchExpressions:
- {key: ipv6, operator: DoesNotExist}
- {key: vxlan, operator: DoesNotExist}
- {key: cni, operator: In, values: ["${CLUSTER_NAME}-cilium"]}
matchLabels:
cni: "${CLUSTER_NAME}-cilium"
repoURL: https://helm.cilium.io/
chartName: cilium
namespace: kube-system
Expand Down
2 changes: 0 additions & 2 deletions templates/addons/cilium/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cilium.yaml
- cilium-ipv6.yaml
- cilium-vxlan.yaml
22 changes: 0 additions & 22 deletions templates/addons/provider-linode/linode-ccm-vpcless.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion templates/flavors/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resources:
- kubeadmControlPlane.yaml
- ../../addons/cilium
- ../../addons/csi-driver-linode
- ../../addons/provider-linode
- ../../addons/ccm-linode
- ../../addons/cluster-resource-set
patches:
- target:
Expand Down
22 changes: 20 additions & 2 deletions templates/flavors/dual-stack/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ patches:
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
labels:
ipv6: "true"
spec:
clusterNetwork:
pods:
Expand Down Expand Up @@ -48,3 +46,23 @@ patches:
controllerManager:
extraArgs:
node-cidr-mask-size-ipv6: "96"
- target:
kind: HelmChartProxy
name: .*-cilium
patch: |-
- op: replace
path: /spec/valuesTemplate
value: |
bgpControlPlane:
enabled: true
ipv6:
enabled: true
ipam:
mode: kubernetes
k8s:
requireIPv4PodCIDR: true
hubble:
relay:
enabled: true
ui:
enabled: true
32 changes: 32 additions & 0 deletions templates/flavors/vpcless/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@ resources:
- ../default

patches:
- target:
kind: HelmChartProxy
name: .*-cilium
patch: |-
- op: replace
path: /spec/valuesTemplate
value: |
bgpControlPlane:
enabled: true
ipam:
mode: kubernetes
k8s:
requireIPv4PodCIDR: true
hubble:
relay:
enabled: true
ui:
enabled: true
- target:
kind: HelmChartProxy
name: .*-linode-cloud-controller-manager
patch: |-
- op: replace
path: /spec/valuesTemplate
value: |
secretRef:
name: "linode-token-region"
image:
pullPolicy: IfNotPresent
- target:
kind: LinodeVPC
patch: |-
Expand Down

0 comments on commit 5180d4c

Please sign in to comment.