Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ jobs:
- name: Set up Mise
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0

- name: Build and push the CCM PR image
run: mise run ko-publish

- name: Setup CAPL Management Kind Cluster and CAPL Child Cluster For Testing
run: mise run mgmt-and-capl-cluster

Expand Down
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ IPV6_CLUSTER_NAME ?= ipv6-$(shell git rev-parse --short HEAD)
IPV6_MANIFEST_NAME ?= ipv6-manifests

# renovate: datasource=github-tags depName=kubernetes/kubernetes
K8S_VERSION ?= "v1.31.2"
K8S_VERSION ?= "v1.36.2"

# renovate: datasource=github-tags depName=kubernetes-sigs/cluster-api
CAPI_VERSION ?= "v1.8.5"

# renovate: datasource=github-tags depName=kubernetes-sigs/cluster-api-addon-provider-helm
CAAPH_VERSION ?= "v0.2.1"
CAPI_VERSION ?= "v1.13.3"

# renovate: datasource=github-tags depName=linode/cluster-api-provider-linode
CAPL_VERSION ?= "v0.8.5"
CAPL_VERSION ?= "v0.10.8"

CONTROLPLANE_NODES ?= 1
WORKER_NODES ?= 1
Expand Down Expand Up @@ -142,7 +139,7 @@ run-debug: build
#####################################################################

.PHONY: mgmt-and-capl-cluster
mgmt-and-capl-cluster: ko-publish mgmt-cluster
mgmt-and-capl-cluster: mgmt-cluster
$(MAKE) -j2 capl-ipv6-cluster capl-cluster

.PHONY: capl-cluster
Expand All @@ -167,14 +164,14 @@ generate-capl-cluster-manifests:
generate-capl-ipv6-cluster-manifests:
LINODE_FIREWALL_ENABLED=$(LINODE_FIREWALL_ENABLED) LINODE_OS=$(LINODE_OS) VPC_NAME=$(IPV6_CLUSTER_NAME) clusterctl generate cluster $(IPV6_CLUSTER_NAME) \
--kubernetes-version $(K8S_VERSION) --infrastructure linode-linode:$(CAPL_VERSION) \
--control-plane-machine-count $(CONTROLPLANE_NODES) --worker-machine-count $(WORKER_NODES) --flavor kubeadm-dual-stack > $(IPV6_MANIFEST_NAME).yaml
--control-plane-machine-count $(CONTROLPLANE_NODES) --worker-machine-count $(WORKER_NODES) --flavor kubeadm-dual-stack-vpcless > $(IPV6_MANIFEST_NAME).yaml
IMG=$(IMG) ./hack/patch-capl-manifest.sh $(IPV6_MANIFEST_NAME).yaml

.PHONY: create-capl-cluster
create-capl-cluster:
# Create a CAPL cluster with updated CCM and wait for it to be ready
kubectl apply -f $(MANIFEST_NAME).yaml
kubectl wait --for=condition=ControlPlaneReady cluster/$(CLUSTER_NAME) --timeout=600s || (kubectl get cluster -o yaml; kubectl get linodecluster -o yaml; kubectl get linodemachines -o yaml; kubectl logs -n capl-system deployments/capl-controller-manager --tail=50)
kubectl wait --for=condition=ControlPlaneInitialized cluster/$(CLUSTER_NAME) --timeout=600s || (kubectl get cluster -o yaml; kubectl get linodecluster -o yaml; kubectl get linodemachines -o yaml; kubectl logs -n capl-system deployments/capl-controller-manager --tail=100)
kubectl wait --for=condition=NodeHealthy=true machines -l cluster.x-k8s.io/cluster-name=$(CLUSTER_NAME) --timeout=900s
clusterctl get kubeconfig $(CLUSTER_NAME) > $(KUBECONFIG_PATH)
KUBECONFIG=$(KUBECONFIG_PATH) kubectl wait --for=condition=Ready nodes --all --timeout=600s
Expand All @@ -199,7 +196,7 @@ mgmt-cluster:
--core cluster-api:$(CAPI_VERSION) \
--bootstrap kubeadm:$(CAPI_VERSION) \
--control-plane kubeadm:$(CAPI_VERSION) \
--addon helm:$(CAAPH_VERSION) \
--addon helm \
--infrastructure linode-linode:$(CAPL_VERSION)
kind get kubeconfig --name=caplccm > $(MGMT_KUBECONFIG_PATH)

Expand Down
6 changes: 3 additions & 3 deletions e2e/test/lb-with-node-addition/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ spec:
content: |
set -euo pipefail

current_replicas=$(KUBECONFIG=$MGMT_KUBECONFIG kubectl get machinedeployment ${CLUSTER_NAME}-md-0 -o=jsonpath='{.spec.replicas}')
current_replicas=$(KUBECONFIG=$MGMT_KUBECONFIG kubectl get machinedeployment ${CLUSTER_NAME} -o=jsonpath='{.spec.replicas}')
required_replicas=$((current_replicas + 1))
KUBECONFIG=$MGMT_KUBECONFIG kubectl patch machinedeployment ${CLUSTER_NAME}-md-0 --type='merge' -p "{\"spec\":{\"replicas\":$required_replicas}}"
KUBECONFIG=$MGMT_KUBECONFIG kubectl patch machinedeployment ${CLUSTER_NAME} --type='merge' -p "{\"spec\":{\"replicas\":$required_replicas}}"

sleep 180

Expand Down Expand Up @@ -120,7 +120,7 @@ spec:
fi
done

#KUBECONFIG=$MGMT_KUBECONFIG kubectl patch machinedeployment ${CLUSTER_NAME}-md-0 --type='merge' -p "{\"spec\":{\"replicas\":$current_replicas}}"
#KUBECONFIG=$MGMT_KUBECONFIG kubectl patch machinedeployment ${CLUSTER_NAME} --type='merge' -p "{\"spec\":{\"replicas\":$current_replicas}}"
check:
($error == null): true
(contains($stdout, 'all nodes up')): true
18 changes: 18 additions & 0 deletions hack/cilium-values-ipv6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
bgpControlPlane:
enabled: true
policyAuditMode: true
hostFirewall:
enabled: true
extraConfig:
allow-localhost: policy
ipv6:
enabled: true
ipam:
mode: kubernetes
k8s:
requireIPv4PodCIDR: true
hubble:
relay:
enabled: true
ui:
enabled: true
6 changes: 6 additions & 0 deletions hack/patch-capl-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ patch_ccm_values_template() {
' "${MANIFEST_PATH}"
}

patch_cilium_values_template() {
yq -i e 'select(.kind == "HelmChartProxy" and .spec.chartName == "cilium" and (.metadata.name | test("^ipv6"))).spec.valuesTemplate =
load_str("hack/cilium-values-ipv6.yaml")' "${MANIFEST_PATH}"
}

patch_vpc_resources() {
yq -i e '
select(.kind == "LinodeVPC") |= (
Expand All @@ -73,3 +78,4 @@ patch_vpc_resources() {

patch_vpc_resources
patch_ccm_values_template
patch_cilium_values_template
6 changes: 3 additions & 3 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ GOTOOLCHAIN = "auto"
go = "1.26.4"
golangci-lint = "2.11.4"
helm = "3.16.3"
kubectl = "1.35.5"
kubectl = "1.36.2"
kustomize = "5.8.1"
kind = "0.31.0"
kind = "0.32.0"
ctlptl = "0.9.0"
clusterctl = "1.8.5"
clusterctl = "1.13.3"
ko = "0.19.1"
"go:github.com/kyverno/chainsaw" = "0.2.15"
"go:github.com/golang/mock/mockgen" = "1.6.0"
Expand Down
Loading