Skip to content

Commit f008448

Browse files
authored
[TenantManager][ExternalAddressBinding] Add CRD (vmware-tanzu#639)
Signed-off-by: gran <gran@vmware.com>
1 parent 2c46396 commit f008448

File tree

15 files changed

+826
-0
lines changed

15 files changed

+826
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.14.0
7+
name: addressbindings.nsx.vmware.com
8+
spec:
9+
group: nsx.vmware.com
10+
names:
11+
kind: AddressBinding
12+
listKind: AddressBindingList
13+
plural: addressbindings
14+
singular: addressbinding
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: AddressBinding is used to manage 1:1 NAT for a VM/NetworkInterface.
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
properties:
41+
interfaceName:
42+
description: InterfaceName contains the interface name of the VM,
43+
if not set, the first interface of the VM will be used
44+
type: string
45+
vmName:
46+
description: VMName contains the VM's name
47+
type: string
48+
required:
49+
- vmName
50+
type: object
51+
status:
52+
properties:
53+
ipAddress:
54+
type: string
55+
required:
56+
- ipAddress
57+
type: object
58+
required:
59+
- spec
60+
- status
61+
type: object
62+
served: true
63+
storage: true
64+
subresources:
65+
status: {}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package v1alpha1
2+
3+
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4+
5+
type AddressBindingSpec struct {
6+
// VMName contains the VM's name
7+
VMName string `json:"vmName"`
8+
// InterfaceName contains the interface name of the VM, if not set, the first interface of the VM will be used
9+
InterfaceName string `json:"interfaceName,omitempty"`
10+
}
11+
12+
type AddressBindingStatus struct {
13+
IPAddress string `json:"ipAddress"`
14+
}
15+
16+
// +genclient
17+
//+kubebuilder:object:root=true
18+
//+kubebuilder:subresource:status
19+
//+kubebuilder:storageversion
20+
21+
// AddressBinding is used to manage 1:1 NAT for a VM/NetworkInterface.
22+
type AddressBinding struct {
23+
metav1.TypeMeta `json:",inline"`
24+
metav1.ObjectMeta `json:"metadata,omitempty"`
25+
26+
Spec AddressBindingSpec `json:"spec"`
27+
Status AddressBindingStatus `json:"status"`
28+
}
29+
30+
//+kubebuilder:object:root=true
31+
32+
// AddressBindingList contains a list of AddressBinding.
33+
type AddressBindingList struct {
34+
metav1.TypeMeta `json:",inline"`
35+
metav1.ListMeta `json:"metadata,omitempty"`
36+
Items []AddressBinding `json:"items"`
37+
}
38+
39+
func init() {
40+
SchemeBuilder.Register(&AddressBinding{}, &AddressBindingList{})
41+
}

pkg/apis/nsx.vmware.com/v1alpha1/zz_generated.deepcopy.go

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package v1alpha1
2+
3+
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4+
5+
type AddressBindingSpec struct {
6+
// VMName contains the VM's name
7+
VMName string `json:"vmName"`
8+
// InterfaceName contains the interface name of the VM, if not set, the first interface of the VM will be used
9+
InterfaceName string `json:"interfaceName,omitempty"`
10+
}
11+
12+
type AddressBindingStatus struct {
13+
IPAddress string `json:"ipAddress"`
14+
}
15+
16+
// +genclient
17+
//+kubebuilder:object:root=true
18+
//+kubebuilder:subresource:status
19+
//+kubebuilder:storageversion
20+
21+
// AddressBinding is used to manage 1:1 NAT for a VM/NetworkInterface.
22+
type AddressBinding struct {
23+
metav1.TypeMeta `json:",inline"`
24+
metav1.ObjectMeta `json:"metadata,omitempty"`
25+
26+
Spec AddressBindingSpec `json:"spec"`
27+
Status AddressBindingStatus `json:"status"`
28+
}
29+
30+
//+kubebuilder:object:root=true
31+
32+
// AddressBindingList contains a list of AddressBinding.
33+
type AddressBindingList struct {
34+
metav1.TypeMeta `json:",inline"`
35+
metav1.ListMeta `json:"metadata,omitempty"`
36+
Items []AddressBinding `json:"items"`
37+
}
38+
39+
func init() {
40+
SchemeBuilder.Register(&AddressBinding{}, &AddressBindingList{})
41+
}

pkg/apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)