Skip to content

Commit

Permalink
add IPAddress and IPAddressClaim to exp api
Browse files Browse the repository at this point in the history
  • Loading branch information
schrej committed May 6, 2022
1 parent 9668547 commit 1f987ed
Show file tree
Hide file tree
Showing 13 changed files with 1,006 additions and 6 deletions.
11 changes: 9 additions & 2 deletions cmd/clusterctl/api/v1alpha3/provider_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func (p *Provider) GetProviderType() ProviderType {
CoreProviderType,
BootstrapProviderType,
InfrastructureProviderType,
ControlPlaneProviderType:
ControlPlaneProviderType,
IPAMProviderType:
return t
default:
return ProviderTypeUnknown
Expand All @@ -118,6 +119,10 @@ const (
// control-plane capabilities.
ControlPlaneProviderType = ProviderType("ControlPlaneProvider")

// IPAMProviderType is the type associated with codebases that provide ipam
// integration capabilities.
IPAMProviderType = ProviderType("IPAMProvider")

// ProviderTypeUnknown is used when the type is unknown.
ProviderTypeUnknown = ProviderType("")
)
Expand All @@ -133,8 +138,10 @@ func (p ProviderType) Order() int {
return 2
case InfrastructureProviderType:
return 3
default:
case IPAMProviderType:
return 4
default:
return 5
}
}

Expand Down
139 changes: 139 additions & 0 deletions config/crd/bases/cluster.x-k8s.io_ipaddressclaims.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: ipaddressclaims.cluster.x-k8s.io
spec:
group: cluster.x-k8s.io
names:
categories:
- cluster-api
kind: IPAddressClaim
listKind: IPAddressClaimList
plural: ipaddressclaims
singular: ipaddressclaim
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Pool the address is from
jsonPath: .spec.pool.name
name: Pool Name
type: string
- description: Pool the address is from
jsonPath: .spec.pool.kind
name: Pool Kind
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: IPAddressClaim is the Schema for the ipaddressclaim API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: IPAddressClaimSpec describes
properties:
pool:
description: Pool is a reference to the pool from which an IP address
should be created.
properties:
group:
description: API group of the referent.
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
type: object
type: object
status:
properties:
address:
description: Address is a reference to the address that was created
for this claim.
properties:
group:
description: API group of the referent.
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
conditions:
description: Conditions summarises the current state of the IPAddressClaim
items:
description: Condition defines an observation of a Cluster API resource
operational state.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another. This should be when the underlying condition changed.
If that is not known, then using the time when the API field
changed is acceptable.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition. This field may be empty.
type: string
reason:
description: The reason for the condition's last transition
in CamelCase. The specific API may choose whether or not this
field is considered a guaranteed API. This field may not be
empty.
type: string
severity:
description: Severity provides an explicit classification of
Reason code, so the users or machines can immediately understand
the current situation and act accordingly. The Severity field
MUST be set only when Status=False.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important.
type: string
required:
- lastTransitionTime
- status
- type
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
109 changes: 109 additions & 0 deletions config/crd/bases/cluster.x-k8s.io_ipaddresses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: ipaddresses.cluster.x-k8s.io
spec:
group: cluster.x-k8s.io
names:
categories:
- cluster-api
kind: IPAddress
listKind: IPAddressList
plural: ipaddresses
singular: ipaddress
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Pool the address is from
jsonPath: .spec.pool.name
name: Pool Name
type: string
- description: Pool the address is from
jsonPath: .spec.pool.kind
name: Pool Kind
type: string
- description: Address
jsonPath: .spec.address
name: Address
type: string
name: v1beta1
schema:
openAPIV3Schema:
description: IPAddress is the Schema for the ipaddress API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
properties:
address:
description: Address is the IP address.
type: string
claim:
description: Claim is a reference to the claim this IPAddress was
created for.
properties:
group:
description: API group of the referent.
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
gateway:
description: Gateway is the network gateway of network the address
is from.
type: string
pool:
description: Pool is a reference to the pool that this IPAddress was
created from.
properties:
group:
description: API group of the referent.
type: string
kind:
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
uid:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
prefix:
description: Prefix is the prefix of the address.
type: integer
required:
- address
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
2 changes: 2 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ resources:
- bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml
- bases/cluster.x-k8s.io_machinehealthchecks.yaml
- bases/runtime.cluster.x-k8s.io_extensionconfigs.yaml
- bases/cluster.x-k8s.io_ipaddresses.yaml
- bases/cluster.x-k8s.io_ipaddressclaims.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
Expand Down
Loading

0 comments on commit 1f987ed

Please sign in to comment.