-
Notifications
You must be signed in to change notification settings - Fork 260
Create script to set up BYO Cilium cluster with Azure CNS #3774
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aab2b46
Initial plan
Copilot ca91563
Create BYO Cilium cluster setup script with comprehensive functionality
Copilot 0c31164
Fix shellcheck warnings in BYO Cilium cluster script
Copilot c925023
Make BYO CNI script universal to support multiple scenarios
Copilot b333e25
Add kubernetes version config option to BYO CNI cluster script
Copilot 5e5e43f
Update BYO CNI script: K8s 1.33 default, Cilium 1.17 default, LTS log…
Copilot cda52a1
Add resource group configuration option to BYO CNI cluster script
Copilot 5f31b62
Add VM size parameter and clarify defaults in BYO CNI cluster script
Copilot ca05852
Automate kube-proxy configuration and add ipconfigupdate for nodesubnet
Copilot 0d6b1e9
Fix CNS scenario mapping and remove invalid Azure CNI manifest deploy…
Copilot 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| # BYO Cilium Cluster Setup Script | ||
|
|
||
| The `create-byocilium-cluster.sh` script automates the creation of a BYO (Bring Your Own) Cilium cluster on Azure Kubernetes Service (AKS). It orchestrates the following steps: | ||
|
|
||
| 1. **Cluster Creation**: Creates an AKS cluster with overlay networking and no kube-proxy using the `overlay-byocni-nokubeproxy-up` make target | ||
| 2. **CNS Deployment**: Deploys Azure Container Networking Service (CNS) to the cluster using the `test-load` make command | ||
| 3. **Cilium Installation**: Installs Cilium networking components using manifests from the `test/integration/manifests/cilium/` directory | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before running the script, ensure you have: | ||
|
|
||
| - Azure CLI installed and logged in (`az login`) | ||
| - kubectl installed and configured | ||
| - make utility installed | ||
| - gettext package installed (for `envsubst` command) | ||
| - Proper Azure subscription permissions to create AKS clusters | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Basic Usage | ||
|
|
||
| Create a cluster with default settings: | ||
| ```bash | ||
| ./create-byocilium-cluster.sh --subscription YOUR_SUBSCRIPTION_ID | ||
| ``` | ||
|
|
||
| ### Advanced Usage | ||
|
|
||
| Create a cluster with custom configuration: | ||
| ```bash | ||
| ./create-byocilium-cluster.sh \ | ||
| --cluster my-cilium-cluster \ | ||
| --subscription YOUR_SUBSCRIPTION_ID \ | ||
| --cns-version v1.6.0 \ | ||
| --cilium-dir 1.16 \ | ||
| --cilium-version-tag v1.16.5 | ||
| ``` | ||
|
|
||
| ### Dry Run | ||
|
|
||
| Preview the commands that would be executed without actually running them: | ||
| ```bash | ||
| ./create-byocilium-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run | ||
| ``` | ||
|
|
||
| ## Configuration Options | ||
|
|
||
| | Parameter | Description | Default | | ||
| |-----------|-------------|---------| | ||
| | `--cluster` | Name of the AKS cluster | `byocni-cluster` | | ||
| | `--subscription` | Azure subscription ID | *Required* | | ||
| | `--azcli` | Azure CLI command | `az` | | ||
| | `--cns-version` | CNS version to deploy | `v1.5.38` | | ||
| | `--azure-ipam-version` | Azure IPAM version | `v0.3.0` | | ||
| | `--cilium-dir` | Cilium version directory | `1.14` | | ||
| | `--cilium-registry` | Cilium image registry | `acnpublic.azurecr.io` | | ||
| | `--cilium-version-tag` | Cilium version tag | Auto-detected | | ||
| | `--ipv6-hp-bpf-version` | IPv6 HP BPF version | Auto-detected | | ||
| | `--cns-image-repo` | CNS image repository | `MCR` | | ||
| | `--dry-run` | Show commands without executing | `false` | | ||
|
|
||
vipul-21 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ## Supported Cilium Versions | ||
|
|
||
| The script supports the following Cilium versions based on available manifests: | ||
| - v1.12 | ||
| - v1.13 | ||
| - v1.14 (default) | ||
| - v1.16 | ||
| - v1.17 | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Example 1: Basic cluster creation | ||
| ```bash | ||
| ./create-byocilium-cluster.sh --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f | ||
| ``` | ||
|
|
||
| ### Example 2: Custom cluster with specific CNS version | ||
| ```bash | ||
| ./create-byocilium-cluster.sh \ | ||
| --cluster production-cilium \ | ||
| --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \ | ||
| --cns-version v1.6.0 \ | ||
| --azure-ipam-version v0.4.0 | ||
| ``` | ||
|
|
||
| ### Example 3: Latest Cilium version | ||
| ```bash | ||
| ./create-byocilium-cluster.sh \ | ||
| --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \ | ||
| --cilium-dir 1.17 \ | ||
| --cilium-version-tag v1.17.0 | ||
| ``` | ||
|
|
||
| ### Example 4: Using different image registry | ||
| ```bash | ||
| ./create-byocilium-cluster.sh \ | ||
| --subscription 9b8218f9-902a-4d20-a65c-e98acec5362f \ | ||
| --cilium-registry mcr.microsoft.com/containernetworking \ | ||
| --cilium-version-tag v1.14.8 | ||
| ``` | ||
|
|
||
| ## Post-Installation | ||
|
|
||
| After successful cluster creation, you can: | ||
|
|
||
| 1. Get the kubeconfig: | ||
| ```bash | ||
| az aks get-credentials --resource-group CLUSTER_NAME --name CLUSTER_NAME | ||
| ``` | ||
|
|
||
| 2. Verify the installation: | ||
| ```bash | ||
| kubectl get pods -n kube-system | ||
| kubectl get nodes | ||
| ``` | ||
|
|
||
| 3. Check Cilium status: | ||
| ```bash | ||
| kubectl get pods -n kube-system | grep cilium | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Common Issues | ||
|
|
||
| 1. **Azure CLI not logged in**: Run `az login` before executing the script | ||
| 2. **Missing permissions**: Ensure your Azure account has permissions to create AKS clusters | ||
| 3. **Invalid Cilium version**: Use `--dry-run` to test configuration before running | ||
| 4. **kubectl not found**: Install kubectl and ensure it's in your PATH | ||
|
|
||
| ### Debugging | ||
|
|
||
| Use the `--dry-run` flag to see exactly what commands would be executed: | ||
| ```bash | ||
| ./create-byocilium-cluster.sh --subscription YOUR_SUBSCRIPTION_ID --dry-run | ||
| ``` | ||
|
|
||
| Check the logs for detailed information about each step of the process. | ||
|
|
||
| ## Contributing | ||
|
|
||
| When modifying the script, please: | ||
| 1. Test with `--dry-run` first | ||
| 2. Ensure all error handling works correctly | ||
| 3. Update this documentation for any new features | ||
| 4. Test with different Cilium versions to ensure compatibility | ||
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.