-
Notifications
You must be signed in to change notification settings - Fork 24
Add vpcless flavor #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Add vpcless flavor #289
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c9e0385
add kubeadm-vpcless flavor
rahulait 4f2e7a1
add VPC documentation
rahulait 2c71bdd
address review comments
rahulait fff4e67
fix matchexpressions for cilium addons
rahulait 63d65d6
address review comments, fix cni install for dual-stack
rahulait File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# VPCLess | ||
|
||
This flavor supports provisioning k8s clusters outside of VPC. It uses kubeadm for | ||
setting up control plane and uses cilium with VXLAN for pod networking. | ||
|
||
## Specification | ||
| Control Plane | CNI | Default OS | Installs ClusterClass | IPv4 | IPv6 | | ||
|---------------|--------|--------------|-----------------------|------|------| | ||
| Kubeadm | Cilium | Ubuntu 22.04 | No | Yes | No | | ||
## Prerequisites | ||
[Quickstart](../getting-started.md) completed | ||
|
||
## Notes | ||
This flavor is identical to the default flavor with the exception that it provisions | ||
k8s clusters without VPC. Since it runs outside of VPC, native routing is not | ||
supported in this flavor and it uses VXLAN for pod to pod communication. | ||
|
||
## Usage | ||
1. Generate cluster yaml | ||
```bash | ||
clusterctl generate cluster test-cluster \ | ||
--infrastructure linode-linode \ | ||
--flavor vpcless > test-cluster.yaml | ||
``` | ||
2. Apply cluster yaml | ||
```bash | ||
kubectl apply -f test-cluster.yaml | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# VPC | ||
|
||
This guide covers how [VPC](https://www.linode.com/docs/products/networking/vpc/) is used with CAPL clusters. By default, CAPL clusters are provisioned within VPC. | ||
|
||
## Default configuration | ||
Each linode within a cluster gets provisioned with two interfaces: | ||
1. eth0 (for public and nodebalancer traffic) | ||
2. eth1 (connected to VPC, for pod-to-pod traffic) | ||
|
||
Key facts about VPC network configuration: | ||
1. VPCs are provisioned with a private subnet 10.0.0.0/8. | ||
2. All pod-to-pod communication happens over the VPC interface (eth1). | ||
3. We assign a pod CIDR of range 10.192.0.0/10 for pod-to-pod communication. | ||
3. By default, cilium is configured with [native routing](https://docs.cilium.io/en/stable/network/concepts/routing/#native-routing) | ||
4. [Kubernetes host-scope IPAM mode](https://docs.cilium.io/en/stable/network/concepts/ipam/kubernetes/) is used to assign pod CIDRs to nodes. We run [linode CCM](https://github.com/linode/linode-cloud-controller-manager) with [route-controller enabled](https://github.com/linode/linode-cloud-controller-manager?tab=readme-ov-file#routes) which automatically adds/updates routes within VPC when pod cidrs are added/updated by k8s. This enables pod-to-pod traffic to be routable within the VPC. | ||
5. kube-proxy is disabled by default. | ||
|
||
## How VPC is provisioned | ||
A VPC is tied to a region. CAPL generates LinodeVPC manifest which contains the VPC name, region and subnet information. By defult, VPC name is set to cluster name but can be overwritten by specifying relevant environment variable. | ||
|
||
```yaml | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeVPC | ||
metadata: | ||
name: ${VPC_NAME:=${CLUSTER_NAME}} | ||
labels: | ||
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} | ||
spec: | ||
region: ${LINODE_REGION} | ||
subnets: | ||
- ipv4: 10.0.0.0/8 | ||
label: default | ||
``` | ||
|
||
Reference to LinodeVPC object is added to LinodeCluster object which then uses the specified VPC to provision resources. | ||
|
||
## Troubleshooting | ||
### If pod-to-pod connectivity is failing | ||
If a pod can't ping pod ips on different node, check and make sure pod CIDRs are added to ip_ranges of VPC interface. | ||
|
||
```sh | ||
curl --header 'Authorization: Bearer $LINODE_API_TOKEN' -X GET https://api.linode.com/v4/linode/instances/${LINODEID}/configs | jq .data[0].interfaces[].ip_ranges | ||
``` | ||
|
||
```admonish note | ||
CIDR returned in the output of above command should match with the pod CIDR present in node's spec `k get node <nodename> -o yaml | yq .spec.podCIDRs` | ||
``` | ||
|
||
### Running cilium connectivity tests | ||
One can also run cilium connectivity tests to make sure networking works fine within VPC. Follow the steps defined in [cilium e2e tests](https://docs.cilium.io/en/stable/contributing/testing/e2e/) guide to install cilium binary, set the KUBECONFIG variable and then run `cilium connectivity tests`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: addons.cluster.x-k8s.io/v1alpha1 | ||
kind: HelmChartProxy | ||
metadata: | ||
name: cilium-vxlan | ||
spec: | ||
clusterSelector: | ||
matchExpressions: | ||
- {key: vxlan, operator: In, values: ['true']} | ||
- {key: cni, operator: In, values: ['cilium']} | ||
- {key: ipv6, operator: DoesNotExist} | ||
repoURL: https://helm.cilium.io/ | ||
chartName: cilium | ||
namespace: kube-system | ||
version: ${CILIUM_VERSION:=1.15.0} | ||
options: | ||
waitForJobs: true | ||
wait: true | ||
timeout: 5m | ||
valuesTemplate: | | ||
bgpControlPlane: | ||
enabled: true | ||
ipam: | ||
mode: kubernetes | ||
k8s: | ||
requireIPv4PodCIDR: true | ||
hubble: | ||
relay: | ||
enabled: true | ||
ui: | ||
enabled: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ kind: Kustomization | |
resources: | ||
- cilium.yaml | ||
- cilium-ipv6.yaml | ||
- cilium-vxlan.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: addons.cluster.x-k8s.io/v1alpha1 | ||
kind: HelmChartProxy | ||
metadata: | ||
name: linode-cloud-controller-manager-vpcless | ||
eljohnson92 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
spec: | ||
clusterSelector: | ||
matchLabels: | ||
ccm: linode | ||
vpcless: "true" | ||
repoURL: https://linode.github.io/linode-cloud-controller-manager/ | ||
chartName: ccm-linode | ||
namespace: kube-system | ||
version: ${LINODE_CCM_VERSION:=v0.4.4} | ||
options: | ||
waitForJobs: true | ||
wait: true | ||
timeout: 5m | ||
valuesTemplate: | | ||
secretRef: | ||
name: "linode-token-region" | ||
image: | ||
pullPolicy: IfNotPresent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../default | ||
|
||
patches: | ||
- target: | ||
kind: LinodeVPC | ||
patch: |- | ||
$patch: delete | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 | ||
kind: LinodeVPC | ||
metadata: | ||
name: ${VPC_NAME:=${CLUSTER_NAME}} | ||
- target: | ||
group: infrastructure.cluster.x-k8s.io | ||
version: v1alpha1 | ||
kind: LinodeCluster | ||
patch: |- | ||
- op: remove | ||
path: /spec/vpcRef | ||
- target: | ||
group: controlplane.cluster.x-k8s.io | ||
version: v1beta1 | ||
kind: KubeadmControlPlane | ||
patch: |- | ||
- op: remove | ||
path: /spec/kubeadmConfigSpec/initConfiguration/skipPhases | ||
- target: | ||
group: cluster.x-k8s.io | ||
version: v1beta1 | ||
kind: Cluster | ||
patch: |- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: Cluster | ||
metadata: | ||
name: ${CLUSTER_NAME} | ||
labels: | ||
vxlan: "true" | ||
vpcless: "true" | ||
AshleyDumaine marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.