Skip to content

Commit 50ab3fa

Browse files
authored
Merge pull request #199 from kubernetes-sigs/update-readme
📖 Update readme
2 parents 3e808b5 + 0ba4d78 commit 50ab3fa

File tree

3 files changed

+61
-35
lines changed

3 files changed

+61
-35
lines changed

CODEOWNERS

-12
This file was deleted.

NOTICE

-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,3 @@ Copyright (c) 2023 The Kubernetes Authors.
33

44
This project is licensed under Apache License, Version 2.0;
55
you may not use them except in compliance with the License.
6-
7-
Contributors:
8-
-------------
9-
10-
Jakob Schrettenbrunner [schrej], Deutsche Telekom AG

README.md

+61-18
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# Cluster API IPAM Provider In Cluster
22

3-
This is a IPAM provider for Cluster API that manages pools of IP addresses using Kubernetes resources. It serves as a reference implementation for IPAM providers, but can also be used as a simple replacement for DHCP.
3+
This is an [IPAM provider](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20220125-ipam-integration.md#ipam-provider) for [Cluster API](https://github.com/kubernetes-sigs/cluster-api) that manages pools of IP addresses using Kubernetes resources. It serves as a reference implementation for IPAM providers, but can also be used as a simple replacement for DHCP.
4+
5+
IPAM providers allow to control how IP addresses are assigned to Cluster API Machines. It is usually only useful for non-cloud deployments. The infrastructure provider in use must support IPAM providers in order to use this provider.
6+
7+
## Features
8+
9+
- Manages IP Addresses in-cluster using custom Kubernetes resources
10+
- Address pools can be cluster-wide or namespaced
11+
- Pools can consist of subnets, arbitrary address ranges and/or individual addresses
12+
- Both IPv4 and IPv6 are supported
13+
- Individual addresses, ranges and subnets can be excluded from a pool
14+
- Well-known reserved addresses are excluded by default, which can be configured per pool
415

516
## Setup via clusterctl
617

7-
This release comes with clusterctl support. Since it's not added to the list of built-in providers yet, you'll need to add the following to your `~/.cluster-api/clusterctl.yaml` if you want to install it using `clusterctl init --ipam in-cluster`:
18+
This provider comes with clusterctl support. Since it's not added to the built-in list of providers yet, you'll need to add the following to your `~/.cluster-api/clusterctl.yaml` if you want to install it using `clusterctl init --ipam in-cluster`:
819

920
```yaml
1021
providers:
@@ -15,7 +26,9 @@ providers:
1526
1627
## Usage
1728
18-
This provider comes with a `InClusterIPPool` resource to specify the pools from which addresses should be assigned. You can provide an address range using start and end addresses, as well as a prefix length, or a set of addresses with the prefix and gateway.
29+
This provider comes with two resources to specify pools from which addresses can be allocated: the `InClusterIPPool` and the `GlobalInClusterIPPool`. As the names suggest, the former is namespaced, the latter is cluster-wide. Otherwise they are identical. The following examples will all use the `InClusterIPPool`, but all examples work with the `GlobalInClusterIPPool` as well.
30+
31+
A simple pool that covers an entire /24 IPv4 network could look like this:
1932

2033
```yaml
2134
apiVersion: ipam.cluster.x-k8s.io/v1alpha2
@@ -24,32 +37,62 @@ metadata:
2437
name: inclusterippool-sample
2538
spec:
2639
addresses:
27-
- 10.0.0.10
28-
- 10.0.0.24-10.0.0.32
29-
- 10.0.0.128/28
40+
- 10.0.0.0/24
3041
prefix: 24
3142
gateway: 10.0.0.1
3243
```
3344

34-
## Community, discussion, contribution, and support
45+
IPv6 is also supported, but a single pool can only consist of v4 **or** v6 addresses, not both. For simplicity we'll stick to IPv4 in the examples.
46+
47+
The `addresses` field supports CIDR notation, as well as arbitrary ranges and individual addresses. Using the `excludedAddresses` field, addresses, ranges or subnets can be excluded from the pool.
48+
49+
```yaml
50+
apiVersion: ipam.cluster.x-k8s.io/v1alpha2
51+
kind: InClusterIPPool
52+
metadata:
53+
name: inclusterippool-sample
54+
spec:
55+
addresses:
56+
- 10.0.0.0/24
57+
- 10.0.1.10-10.0.1.100
58+
- 10.0.2.1
59+
- 10.0.2.2
60+
exclude:
61+
- 10.10.0.16/28
62+
- 10.10.0.242
63+
- 10.0.1.25-10.0.1.30
64+
prefix: 22
65+
gateway: 10.0.0.1
66+
```
3567

36-
Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/).
68+
Be aware that the prefix needs to cover all addresses that are part of the pool. The first network in the `addresses` list and the `prefix` field, which specifies the length of the prefix, is used to determine the prefix. In this case, `10.1.0.0/24` in the `addresses` list would lead to a validation error.
3769

38-
You can reach the maintainers of this project at:
70+
The `gateway` will never be allocated. By default, addresses that are usually reserved will not be allocated either. For v4 networks this is the first (network) and last (broadcast) address within the prefix. In the example above that would be `10.0.0.0` and `10.0.3.255` (the latter not being in the network anyway). For v6 networks the first address is excluded.
3971

40-
- [Slack](https://slack.k8s.io/)
41-
- [Mailing List](https://groups.google.com/a/kubernetes.io/g/dev)
72+
If you want to use all networks that are part of the prefix, you can set `allocateReservedIPAddresses` to `true`. In the example below, both `10.0.0.0` and `10.0.0.255` will be allocated. The gateway will still be excluded.
73+
74+
```yaml
75+
apiVersion: ipam.cluster.x-k8s.io/v1alpha2
76+
kind: InClusterIPPool
77+
metadata:
78+
name: inclusterippool-sample
79+
spec:
80+
addresses:
81+
- 10.0.0.0/24
82+
prefix: 24
83+
gateway: 10.0.0.1
84+
allocateReservedIPAddresses: true
85+
```
4286

43-
## Licensing
4487

45-
Copyright (c) 2022 Deutsche Telekom AG.
88+
## Community, discussion, contribution, and support
4689

47-
Licensed under the **Apache License, Version 2.0** (the "License"); you may not use this file except in compliance with the License.
90+
The in-cluster IPAM provider is part of the cluster-api project. Please refer to it's [readme](https://github.com/kubernetes-sigs/cluster-api?tab=readme-ov-file#-community-discussion-contribution-and-support) for information on how to connect with the project.
4891

49-
You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.
92+
The best way to reach the maintainers of this sub-project is the [#cluster-api](https://kubernetes.slack.com/archives/C8TSNPY4T) channel on the [Kubernetes Slack](https://slack.k8s.io).
5093

51-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the [LICENSE](./LICENSE) for the specific language governing permissions and limitations under the License.
94+
Pull Requests and feedback on issues are very welcome! See the [issue tracker](https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/issues) if you're unsure where to start, especially the [Good first issue](https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [Help wanted](https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+) tags, and also feel free to reach out to discuss.
5295

53-
### Dependency Licenses
96+
## Code of conduct
5497

55-
You can find the licenses of used Go dependencies as a `licenses.tar.gz` archive as part of our [releases](https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/releases) and in the `/license` directory contained in our container images available at [ghcr.io/telekom/cluster-api-ipam-provider-in-cluster](https://ghcr.io/telekom/cluster-api-ipam-provider-in-cluster).
98+
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/blob/main/code-of-conduct.md).

0 commit comments

Comments
 (0)