Skip to content

Commit 5a2ee5f

Browse files
committed
add IPAddress and IPAddressClaim to exp api
1 parent b0bb623 commit 5a2ee5f

File tree

13 files changed

+1006
-6
lines changed

13 files changed

+1006
-6
lines changed

cmd/clusterctl/api/v1alpha3/provider_type.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ func (p *Provider) GetProviderType() ProviderType {
9292
CoreProviderType,
9393
BootstrapProviderType,
9494
InfrastructureProviderType,
95-
ControlPlaneProviderType:
95+
ControlPlaneProviderType,
96+
IPAMProviderType:
9697
return t
9798
default:
9899
return ProviderTypeUnknown
@@ -118,6 +119,10 @@ const (
118119
// control-plane capabilities.
119120
ControlPlaneProviderType = ProviderType("ControlPlaneProvider")
120121

122+
// IPAMProviderType is the type associated with codebases that provide ipam
123+
// integration capabilities.
124+
IPAMProviderType = ProviderType("IPAMProvider")
125+
121126
// ProviderTypeUnknown is used when the type is unknown.
122127
ProviderTypeUnknown = ProviderType("")
123128
)
@@ -133,8 +138,10 @@ func (p ProviderType) Order() int {
133138
return 2
134139
case InfrastructureProviderType:
135140
return 3
136-
default:
141+
case IPAMProviderType:
137142
return 4
143+
default:
144+
return 5
138145
}
139146
}
140147

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.8.0
7+
creationTimestamp: null
8+
name: ipaddressclaims.cluster.x-k8s.io
9+
spec:
10+
group: cluster.x-k8s.io
11+
names:
12+
categories:
13+
- cluster-api
14+
kind: IPAddressClaim
15+
listKind: IPAddressClaimList
16+
plural: ipaddressclaims
17+
singular: ipaddressclaim
18+
scope: Namespaced
19+
versions:
20+
- additionalPrinterColumns:
21+
- description: Pool the address is from
22+
jsonPath: .spec.pool.name
23+
name: Pool Name
24+
type: string
25+
- description: Pool the address is from
26+
jsonPath: .spec.pool.kind
27+
name: Pool Kind
28+
type: string
29+
name: v1beta1
30+
schema:
31+
openAPIV3Schema:
32+
description: IPAddressClaim is the Schema for the ipaddressclaim API.
33+
properties:
34+
apiVersion:
35+
description: 'APIVersion defines the versioned schema of this representation
36+
of an object. Servers should convert recognized schemas to the latest
37+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
38+
type: string
39+
kind:
40+
description: 'Kind is a string value representing the REST resource this
41+
object represents. Servers may infer this from the endpoint the client
42+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
43+
type: string
44+
metadata:
45+
type: object
46+
spec:
47+
description: IPAddressClaimSpec describes
48+
properties:
49+
pool:
50+
description: Pool is a reference to the pool from which an IP address
51+
should be created.
52+
properties:
53+
group:
54+
description: API group of the referent.
55+
type: string
56+
kind:
57+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
58+
type: string
59+
name:
60+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
61+
type: string
62+
type: object
63+
type: object
64+
status:
65+
properties:
66+
address:
67+
description: Address is a reference to the address that was created
68+
for this claim.
69+
properties:
70+
group:
71+
description: API group of the referent.
72+
type: string
73+
kind:
74+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
75+
type: string
76+
name:
77+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
78+
type: string
79+
uid:
80+
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
81+
type: string
82+
type: object
83+
conditions:
84+
description: Conditions summarises the current state of the IPAddressClaim
85+
items:
86+
description: Condition defines an observation of a Cluster API resource
87+
operational state.
88+
properties:
89+
lastTransitionTime:
90+
description: Last time the condition transitioned from one status
91+
to another. This should be when the underlying condition changed.
92+
If that is not known, then using the time when the API field
93+
changed is acceptable.
94+
format: date-time
95+
type: string
96+
message:
97+
description: A human readable message indicating details about
98+
the transition. This field may be empty.
99+
type: string
100+
reason:
101+
description: The reason for the condition's last transition
102+
in CamelCase. The specific API may choose whether or not this
103+
field is considered a guaranteed API. This field may not be
104+
empty.
105+
type: string
106+
severity:
107+
description: Severity provides an explicit classification of
108+
Reason code, so the users or machines can immediately understand
109+
the current situation and act accordingly. The Severity field
110+
MUST be set only when Status=False.
111+
type: string
112+
status:
113+
description: Status of the condition, one of True, False, Unknown.
114+
type: string
115+
type:
116+
description: Type of condition in CamelCase or in foo.example.com/CamelCase.
117+
Many .condition.type values are consistent across resources
118+
like Available, but because arbitrary conditions can be useful
119+
(see .node.status.conditions), the ability to deconflict is
120+
important.
121+
type: string
122+
required:
123+
- lastTransitionTime
124+
- status
125+
- type
126+
type: object
127+
type: array
128+
type: object
129+
type: object
130+
served: true
131+
storage: true
132+
subresources:
133+
status: {}
134+
status:
135+
acceptedNames:
136+
kind: ""
137+
plural: ""
138+
conditions: []
139+
storedVersions: []
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.8.0
7+
creationTimestamp: null
8+
name: ipaddresses.cluster.x-k8s.io
9+
spec:
10+
group: cluster.x-k8s.io
11+
names:
12+
categories:
13+
- cluster-api
14+
kind: IPAddress
15+
listKind: IPAddressList
16+
plural: ipaddresses
17+
singular: ipaddress
18+
scope: Namespaced
19+
versions:
20+
- additionalPrinterColumns:
21+
- description: Pool the address is from
22+
jsonPath: .spec.pool.name
23+
name: Pool Name
24+
type: string
25+
- description: Pool the address is from
26+
jsonPath: .spec.pool.kind
27+
name: Pool Kind
28+
type: string
29+
- description: Address
30+
jsonPath: .spec.address
31+
name: Address
32+
type: string
33+
name: v1beta1
34+
schema:
35+
openAPIV3Schema:
36+
description: IPAddress is the Schema for the ipaddress API.
37+
properties:
38+
apiVersion:
39+
description: 'APIVersion defines the versioned schema of this representation
40+
of an object. Servers should convert recognized schemas to the latest
41+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
42+
type: string
43+
kind:
44+
description: 'Kind is a string value representing the REST resource this
45+
object represents. Servers may infer this from the endpoint the client
46+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
47+
type: string
48+
metadata:
49+
type: object
50+
spec:
51+
properties:
52+
address:
53+
description: Address is the IP address.
54+
type: string
55+
claim:
56+
description: Claim is a reference to the claim this IPAddress was
57+
created for.
58+
properties:
59+
group:
60+
description: API group of the referent.
61+
type: string
62+
kind:
63+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
64+
type: string
65+
name:
66+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
67+
type: string
68+
uid:
69+
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
70+
type: string
71+
type: object
72+
gateway:
73+
description: Gateway is the network gateway of network the address
74+
is from.
75+
type: string
76+
pool:
77+
description: Pool is a reference to the pool that this IPAddress was
78+
created from.
79+
properties:
80+
group:
81+
description: API group of the referent.
82+
type: string
83+
kind:
84+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
85+
type: string
86+
name:
87+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
88+
type: string
89+
uid:
90+
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
91+
type: string
92+
type: object
93+
prefix:
94+
description: Prefix is the prefix of the address.
95+
type: integer
96+
required:
97+
- address
98+
type: object
99+
type: object
100+
served: true
101+
storage: true
102+
subresources:
103+
status: {}
104+
status:
105+
acceptedNames:
106+
kind: ""
107+
plural: ""
108+
conditions: []
109+
storedVersions: []

config/crd/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ resources:
1212
- bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml
1313
- bases/cluster.x-k8s.io_machinehealthchecks.yaml
1414
- bases/runtime.cluster.x-k8s.io_extensionconfigs.yaml
15+
- bases/cluster.x-k8s.io_ipaddresses.yaml
16+
- bases/cluster.x-k8s.io_ipaddressclaims.yaml
1517
# +kubebuilder:scaffold:crdkustomizeresource
1618

1719
patchesStrategicMerge:

0 commit comments

Comments
 (0)