Skip to content

Commit 73f6e84

Browse files
Add API definition for EAS support (#1393)
Add API definition for Extension API Service support 1. ip block usages (referenced nsx-eas definition) 2. subnet dhcp server config stats 3. subnent ip pools 4. vpc ipaddress usages (referenced nsx-eas definition) Since nsx-eas is using openapi to compile types for CRD yaml, but nsx-operator is using kube-controller, so the types.go files contains `json:*` tags which is different from nsx-eas.
1 parent beab241 commit 73f6e84

16 files changed

Lines changed: 1186 additions & 0 deletions

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ changecrd: manifests generate generate-api-docs
4646
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
4747
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="github.com/vmware-tanzu/nsx-operator/pkg/apis/legacy/v1alpha1" output:crd:artifacts:config=build/yaml/crd/legacy/
4848
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="github.com/vmware-tanzu/nsx-operator/pkg/apis/vpc/v1alpha1" output:crd:artifacts:config=build/yaml/crd/vpc/
49+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="github.com/vmware-tanzu/nsx-operator/pkg/apis/eas/v1alpha1" output:crd:artifacts:config=build/yaml/crd/eas/
4950

5051
.PHONY: generate
5152
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.5
7+
name: ipblockusages.eas.nsx.vmware.com
8+
spec:
9+
group: eas.nsx.vmware.com
10+
names:
11+
kind: IPBlockUsage
12+
listKind: IPBlockUsageList
13+
plural: ipblockusages
14+
singular: ipblockusage
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: |-
21+
IPBlockUsage is the usage information of an IPBlock.
22+
It contains used IP ranges and available IP ranges statistics of an IPBlock.
23+
properties:
24+
apiVersion:
25+
description: |-
26+
APIVersion defines the versioned schema of this representation of an object.
27+
Servers should convert recognized schemas to the latest internal value, and
28+
may reject unrecognized values.
29+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
30+
type: string
31+
availableIPRanges:
32+
description: Available IP ranges in an IPBlock.
33+
items:
34+
type: string
35+
type: array
36+
availableIPsCount:
37+
description: Available IP count in an IPBlock.
38+
type: string
39+
cidrUsage:
40+
description: CIDR usage details for each CIDR in an IPBlock.
41+
items:
42+
description: Represents used and available IP statistics for CIDRs in
43+
an IPBlock.
44+
properties:
45+
cidr:
46+
description: One CIDR in an IPBlock CIDRList.
47+
type: string
48+
usage:
49+
properties:
50+
availableIPRanges:
51+
description: Represents free IP ranges from the CIDR or IP range.
52+
items:
53+
type: string
54+
type: array
55+
availableIPsCount:
56+
description: Represents free IP count in the CIDR or IP range.
57+
type: string
58+
overallUsedIPRanges:
59+
description: Represents the overall IP ranges allocated from
60+
the CIDR or IP range across all orgs.
61+
items:
62+
type: string
63+
type: array
64+
overallUsedIPsCount:
65+
description: Represents the overall IP count allocated from
66+
the CIDR or IP range across all orgs.
67+
type: string
68+
usedIPRanges:
69+
description: Represents IP ranges that are allocated from the
70+
CIDR or IP range in the org scope.
71+
items:
72+
type: string
73+
type: array
74+
usedIPsCount:
75+
description: Represents IP count that are allocated from the
76+
CIDR or IP range in the org scope.
77+
type: string
78+
type: object
79+
type: object
80+
type: array
81+
kind:
82+
description: |-
83+
Kind is a string value representing the REST resource this object represents.
84+
Servers may infer this from the endpoint the client submits requests to.
85+
Cannot be updated.
86+
In CamelCase.
87+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
88+
type: string
89+
metadata:
90+
type: object
91+
overallIPsCount:
92+
description: Total count of IPs which are present in this block.
93+
type: string
94+
rangeUsage:
95+
description: Range usage details for each IP range in an IPBlock.
96+
items:
97+
description: Represents used and available IP statistics for IP ranges
98+
in an IPBlock.
99+
properties:
100+
range:
101+
description: One range in an IPBlock range list.
102+
type: string
103+
usage:
104+
properties:
105+
availableIPRanges:
106+
description: Represents free IP ranges from the CIDR or IP range.
107+
items:
108+
type: string
109+
type: array
110+
availableIPsCount:
111+
description: Represents free IP count in the CIDR or IP range.
112+
type: string
113+
overallUsedIPRanges:
114+
description: Represents the overall IP ranges allocated from
115+
the CIDR or IP range across all orgs.
116+
items:
117+
type: string
118+
type: array
119+
overallUsedIPsCount:
120+
description: Represents the overall IP count allocated from
121+
the CIDR or IP range across all orgs.
122+
type: string
123+
usedIPRanges:
124+
description: Represents IP ranges that are allocated from the
125+
CIDR or IP range in the org scope.
126+
items:
127+
type: string
128+
type: array
129+
usedIPsCount:
130+
description: Represents IP count that are allocated from the
131+
CIDR or IP range in the org scope.
132+
type: string
133+
type: object
134+
type: object
135+
type: array
136+
usedIPRanges:
137+
description: Used IP ranges in an IPBlock.
138+
items:
139+
type: string
140+
type: array
141+
usedIPsCount:
142+
description: Used IPs count in an IPBlock.
143+
type: string
144+
visibility:
145+
description: |-
146+
Visibility of IPBlock.
147+
Must be External or Private.
148+
enum:
149+
- External
150+
- Private
151+
type: string
152+
type: object
153+
served: true
154+
storage: true
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.5
7+
name: subnetdhcpserverstats.eas.nsx.vmware.com
8+
spec:
9+
group: eas.nsx.vmware.com
10+
names:
11+
kind: SubnetDHCPServerStats
12+
listKind: SubnetDHCPServerStatsList
13+
plural: subnetdhcpserverstats
14+
singular: subnetdhcpserverstats
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: |-
21+
SubnetDHCPServerStats exposes the Subnet's DHCP server statistics.
22+
The SubnetDHCPServerStats name should be the same as the Subnet CR name.
23+
properties:
24+
apiVersion:
25+
description: |-
26+
APIVersion defines the versioned schema of this representation of an object.
27+
Servers should convert recognized schemas to the latest internal value, and
28+
may reject unrecognized values.
29+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
30+
type: string
31+
ipPoolStats:
32+
description: DHCP IP pool usage statistics.
33+
items:
34+
description: DHCPIPPoolUsage represents DHCP IP pool usage statistics.
35+
properties:
36+
allocatedNumber:
37+
description: Allocated number.
38+
format: int64
39+
type: integer
40+
allocatedPercentage:
41+
description: Allocated percentage.
42+
format: int64
43+
type: integer
44+
consumedNumber:
45+
description: Total number of IP addresses consumed by DHCP clients.
46+
format: int64
47+
type: integer
48+
poolSize:
49+
description: Pool size.
50+
format: int64
51+
type: integer
52+
type: object
53+
type: array
54+
kind:
55+
description: |-
56+
Kind is a string value representing the REST resource this object represents.
57+
Servers may infer this from the endpoint the client submits requests to.
58+
Cannot be updated.
59+
In CamelCase.
60+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
61+
type: string
62+
metadata:
63+
type: object
64+
type: object
65+
served: true
66+
storage: true
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.5
7+
name: subnetippools.eas.nsx.vmware.com
8+
spec:
9+
group: eas.nsx.vmware.com
10+
names:
11+
kind: SubnetIPPools
12+
listKind: SubnetIPPoolsList
13+
plural: subnetippools
14+
singular: subnetippools
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: |-
21+
SubnetIPPools describes IP pools of a Subnet.
22+
The SubnetIPPools name is the same as subnet CR name.
23+
properties:
24+
apiVersion:
25+
description: |-
26+
APIVersion defines the versioned schema of this representation of an object.
27+
Servers should convert recognized schemas to the latest internal value, and
28+
may reject unrecognized values.
29+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
30+
type: string
31+
ipAddressType:
32+
description: |-
33+
Type of IP address.
34+
Must be IPv4 or IPv6.
35+
enum:
36+
- IPv4
37+
- IPv6
38+
type: string
39+
kind:
40+
description: |-
41+
Kind is a string value representing the REST resource this object represents.
42+
Servers may infer this from the endpoint the client submits requests to.
43+
Cannot be updated.
44+
In CamelCase.
45+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
46+
type: string
47+
metadata:
48+
type: object
49+
poolUsage:
50+
description: IP pool usage statistics.
51+
properties:
52+
allocatedIPAllocations:
53+
description: Number of allocated IP allocations.
54+
format: int64
55+
type: integer
56+
availableIPs:
57+
description: Number of available IPs.
58+
format: int64
59+
type: integer
60+
requestedIPAllocations:
61+
description: Number of requested IP allocations.
62+
format: int64
63+
type: integer
64+
totalIPs:
65+
description: Total number of IPs in the pool.
66+
format: int64
67+
type: integer
68+
type: object
69+
type: object
70+
served: true
71+
storage: true

0 commit comments

Comments
 (0)