Skip to content
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

🌱 clusterctl: add in-cluster ipam provider #8811

Merged
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
12 changes: 12 additions & 0 deletions cmd/clusterctl/client/config/providers_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ const (
K0smotronControlPlaneProviderName = "k0sproject-k0smotron"
)

// IPAM providers.
const (
InClusterIPAMProviderName = "in-cluster"
)

// Add-on providers.
const (
HelmAddonProviderName = "helm"
Expand Down Expand Up @@ -369,6 +374,13 @@ func (p *providersClient) defaults() []Provider {
providerType: clusterctlv1.ControlPlaneProviderType,
},

// IPAM providers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add the provider to the glossary etc.

For reference: #9012 (should be ~ the same)

&provider{
name: InClusterIPAMProviderName,
url: "https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/releases/latest/ipam-components.yaml",
providerType: clusterctlv1.IPAMProviderType,
},

// Add-on providers
&provider{
name: HelmAddonProviderName,
Expand Down
2 changes: 2 additions & 0 deletions cmd/clusterctl/client/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.VclusterProviderName,
config.VirtinkProviderName,
config.VSphereProviderName,
config.InClusterIPAMProviderName,
config.HelmAddonProviderName,
},
wantErr: false,
Expand Down Expand Up @@ -158,6 +159,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.VclusterProviderName,
config.VirtinkProviderName,
config.VSphereProviderName,
config.InClusterIPAMProviderName,
config.HelmAddonProviderName,
},
wantErr: false,
Expand Down
5 changes: 5 additions & 0 deletions cmd/clusterctl/cmd/config_repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ vcd InfrastructureProvider https://github.com/vmware/cluste
vcluster InfrastructureProvider https://github.com/loft-sh/cluster-api-provider-vcluster/releases/latest/ infrastructure-components.yaml
virtink InfrastructureProvider https://github.com/smartxworks/cluster-api-provider-virtink/releases/latest/ infrastructure-components.yaml
vsphere InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/latest/ infrastructure-components.yaml
in-cluster IPAMProvider https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/releases/latest/ ipam-components.yaml
helm AddonProvider https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/releases/latest/ addon-components.yaml
`

Expand Down Expand Up @@ -341,6 +342,10 @@ var expectedOutputYaml = `- File: core_components.yaml
Name: vsphere
ProviderType: InfrastructureProvider
URL: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/latest/
- File: ipam-components.yaml
Name: in-cluster
ProviderType: IPAMProvider
URL: https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/releases/latest/
- File: addon-components.yaml
Name: helm
ProviderType: AddonProvider
Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func init() {
initCmd.PersistentFlags().StringSliceVarP(&initOpts.controlPlaneProviders, "control-plane", "c", nil,
"Control plane providers and versions (e.g. kubeadm:v1.1.5) to add to the management cluster. If unspecified, the Kubeadm control plane provider's latest release is used.")
initCmd.PersistentFlags().StringSliceVar(&initOpts.ipamProviders, "ipam", nil,
"IPAM providers and versions (e.g. infoblox:v0.0.1) to add to the management cluster.")
"IPAM providers and versions (e.g. in-cluster:v0.1.0) to add to the management cluster.")
initCmd.PersistentFlags().StringSliceVar(&initOpts.runtimeExtensionProviders, "runtime-extension", nil,
"Runtime extension providers and versions to add to the management cluster; please note that clusterctl doesn't include any default runtime extensions and thus it is required to use custom configuration files to register runtime extensions.")
initCmd.PersistentFlags().StringSliceVar(&initOpts.addonProviders, "addon", nil,
Expand Down
1 change: 1 addition & 0 deletions docs/book/src/clusterctl/provider-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ providers.
| CAPZ | cluster.x-k8s.io/provider=infrastructure-azure |
| CAPOSC | cluster.x-k8s.io/provider=infrastructure-outscale |
| CAPK0S | cluster.x-k8s.io/provider=infrastructure-k0smotron |
| CAIPAMIC | cluster.x-k8s.io/provider=ipam-in-cluster |

### Workload cluster templates

Expand Down
3 changes: 3 additions & 0 deletions docs/book/src/reference/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ Cluster API Provider VMware Cloud Director
### CAPZ
Cluster API Provider Azure

### CAIPAMIC
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about CAIPAM as a prefix for ipam providers, but probably the best option next to CAIP

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me

Cluster API IPAM Provider In Cluster

### Cloud provider

Or __Cloud service provider__
Expand Down