Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpc_dev branch rebase to main branch #399

Merged
merged 120 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
0c44318
Fix errors when validate VPC options
timdengyun Nov 21, 2023
51a473d
Use code-generator to generate clientset/informers/listers
timdengyun Nov 21, 2023
bdb9210
Add VPC search store
zhengxiexie Jan 13, 2023
5014e9b
Support query nsx-t resources by tags
zhengxiexie May 24, 2023
04641aa
Add GetOrgProject method to ServiceMediator
zhengxiexie Mar 20, 2023
b6ea06e
Add VPC related options in NsxConfig
lxiaopei Feb 22, 2023
708c02d
Fix errors when validate VPC options
timdengyun Nov 21, 2023
9f9d71c
Support HA mode
timdengyun Nov 21, 2023
3a667aa
Replace OrgProjectVPC with VPCInfo
zhengxiexie May 29, 2023
0b376dd
Support HA mode
zhengxiexie May 4, 2023
d03483b
Fix issue, code-generator needs nsx.vmware.com/v1alpha1
zhengxiexie May 12, 2023
e431ea5
Change Vpc type define
seanpang-vmware Jun 19, 2023
c06f81c
Change Resource Type according to common definition
timdengyun Nov 21, 2023
6e294f7
Add a function to parse the path and obtain the org/project/vpc/paren…
heypnus Jul 25, 2023
95106a0
Add RealizeState service
jwsui Jul 21, 2023
517c8f4
Set EnableHA default to true
timdengyun Nov 21, 2023
87d79d5
Refactor config.go
timdengyun Nov 21, 2023
d657d9d
Upgrade golang to latest 1.19.10
timdengyun Nov 21, 2023
9fc91e6
Upgrade SDK
TaoZou1 Aug 3, 2023
97d8d84
Update UT for new SDK
TaoZou1 Aug 3, 2023
bbee004
Suport subnetport for VM operator VM under the subnet CR
timdengyun Nov 21, 2023
c0543f2
Add StaticRoute controller
timdengyun Nov 21, 2023
6d6672a
Init logger before load operator config file
timdengyun Nov 21, 2023
abfa529
Implement subnet/subnetset CRD
jwsui Nov 16, 2022
5cb9246
Move some subnet functions to controller
jwsui Aug 9, 2023
5e12792
Check EnableVPCNetwork and nsx version
timdengyun Nov 21, 2023
cd1e532
Add ca_file support for tls
timdengyun Nov 21, 2023
d555e3a
Fix one UT error
TaoZou1 Aug 10, 2023
3c478fb
Fix UT error
TaoZou1 Aug 10, 2023
db9c446
change branch name for workflow in vpc branch
timdengyun Aug 4, 2023
ce1e1c2
Add VPC service and controller
seanpang-vmware Feb 16, 2023
5851fcf
Support to create subnetport in subnetset
heypnus Aug 9, 2023
7a1f692
IPPool controller added
zhengxiexie Mar 20, 2023
17fd458
Get port number by subnet ID from subnetport store
heypnus Aug 10, 2023
8c87bcf
Remove validation check for default_project and external_ipv4_blocks
lxiaopei Aug 14, 2023
dc43946
Fix several subnet/subnetset issues
heypnus Aug 14, 2023
b09d9b7
Fix errors when deleting ip block from ipblock store
seanpang-vmware Aug 14, 2023
ac81989
Update VPC CRDs with print columns and upper case
lxiaopei Aug 16, 2023
1a80d03
Fix ippool crd
zhengxiexie Aug 16, 2023
f720e28
Remove LoadBalancerEndpoint flag for VPC
lxiaopei Aug 18, 2023
043ed7a
Support passing user/pass/ca from parameter
timdengyun Nov 21, 2023
aaa8625
Get default values of accessMode and ipv4SubnetSize from VPCNetworkCo…
zhengxiexie Aug 15, 2023
2dc2361
Support appending cidr to network config CR
seanpang-vmware Aug 18, 2023
2275dac
Add AVI rule path/ip, snat ip into VPC CR
seanpang-vmware Aug 16, 2023
23e343c
Remove mock in startIPPoolController
zhengxiexie Aug 24, 2023
1547c41
Dump error return from SDK
TaoZou1 Aug 25, 2023
69ed188
Fix staticroute bugs
TaoZou1 Aug 28, 2023
27fd679
Avoid duplicate port creation/update for the subnet port CR
heypnus Aug 24, 2023
6b695a4
Implement cleaning up all nsx resources
zhengxiexie Apr 27, 2023
dcb4bc9
Add some utils func
TaoZou1 Aug 28, 2023
2be71f5
Support securitypolicy in VPC network
timdengyun May 11, 2023
cec4da3
Update NSX Subnet's tags based on labels of subnetset
zhengxiexie Aug 22, 2023
4cd4ab7
ADD GC for subnet
TaoZou1 Aug 16, 2023
360ff85
Add cleanup for ippool and subnet
zhengxiexie Aug 29, 2023
f204e60
Add cleanup for VPC service
seanpang-vmware Aug 29, 2023
20a0a84
Add Validate in Clean, insure no blank item in ca-file
zhengxiexie Aug 31, 2023
29f6b5c
Add pod controller and node controller
heypnus Aug 18, 2023
9cc19e4
Add VirtualMachine handler to tag the labels on the related NSX subne…
heypnus Aug 25, 2023
64c1754
Add cleanup for staticroute
timdengyun Nov 21, 2023
333744b
Change Pod and VM tags used for SecurityPolicy
timdengyun Nov 21, 2023
1a11943
Use util method to build VPC structue
seanpang-vmware Aug 31, 2023
f0655b1
Change tag on NSX subnet port for VM from nsx-op/namespace to nsx-op/…
heypnus Sep 1, 2023
586b976
Modify the NSX subnetport tags according the pod label changes
heypnus Sep 4, 2023
27089b3
Add namespace labels to NSX VpcSubnet tags
zhengxiexie Aug 15, 2023
ebe4248
Update ippool controller
zhengxiexie Aug 16, 2023
a14a859
Refactor build subnet
zhengxiexie Sep 4, 2023
9087743
Refactor build ippool
zhengxiexie Sep 4, 2023
72b0ca0
Refactor loglevel based on debug in configmap
timdengyun Nov 21, 2023
d670424
Generate subnet port name/id/tags via common utils
heypnus Sep 4, 2023
6d45bbc
Add Cleanup for subnetport service
heypnus Sep 4, 2023
40de80a
Update MaxNameLength and use GenerateTruncName to build subnet name
zhengxiexie Sep 5, 2023
c9b082f
Add nsx operator version tag into util basic tags
timdengyun Aug 31, 2023
c0d8a5e
Fix buildSubnet tags
zhengxiexie Sep 5, 2023
2724c6d
Fix issue when building ip block
seanpang-vmware Sep 5, 2023
9c91dc1
Fix the pod label sync issue
heypnus Sep 6, 2023
a9edbaf
Fix the concurrency issue in subnet port creation
heypnus Sep 6, 2023
2c89075
Fix cleanup for subnet and ippool
timdengyun Nov 21, 2023
980a56d
Get staticroute UID from tags
TaoZou1 Sep 8, 2023
6494d9c
Fix default-pod-subnetset having no nsx-op/namespace
zhengxiexie Sep 8, 2023
45d57b3
Put the subnetport CR's port into correct subnetset default-vm-subnetset
heypnus Sep 8, 2023
45834c9
Fix errors imported by subnetset tags updates
jwsui Sep 8, 2023
1eb6a52
Remove nsx-op/namespace and nsx-op/namespace_uid tags for subnet/subn…
timdengyun Sep 8, 2023
a9a6915
Fix ippool handler when ipblockpath is nil
seanpang-vmware Sep 8, 2023
fbace9b
Fix error when search subnet by key
jwsui Sep 12, 2023
285dd32
Fix bugs of updating NSX subnet managed by SubnetSet CR
jwsui Sep 12, 2023
f2974fe
Support insecure for testing purpose
TaoZou1 Sep 14, 2023
2f639d9
Check the realized bindings before returning the port state
heypnus Sep 13, 2023
17f6b08
Use SubnetSet CR uid to filter NSX subnets when update tags
jwsui Sep 15, 2023
c0c1d16
Add nsx-operator apis in a separate module
timdengyun Nov 21, 2023
5a24a72
Support SecurityPolicy cleanup in VPC
timdengyun Sep 28, 2023
b23ea9e
Only get resources with marked_for_delete=false from NSX
heypnus Sep 6, 2023
5e600ad
Change func Operate to Apply
TaoZou1 Oct 18, 2023
77f943a
Add privateIPv4CIDRs under VPC status
lxiaopei Sep 27, 2023
8b9d27a
Support codegen for v1alpha2
zhengxiexie Aug 17, 2023
d2ae1af
Do not requeue when can not find ns resource
seanpang-vmware Oct 19, 2023
36b3a80
Make pkg/client submodule
zhengxiexie Oct 30, 2023
ccd9598
Change network config crd id to path
seanpang-vmware Oct 25, 2023
60f0e15
Add e2e test for VPC
seanpang-vmware Aug 29, 2023
459a385
Support pass in nsx username/password
zhengxiexie Sep 13, 2023
0968a6e
Upgrade golang.org/x/net to v0.17.0
TaoZou1 Oct 17, 2023
5c3a055
Display private cidrs in VPC CRD
seanpang-vmware Oct 30, 2023
b8c98fe
Add virtualmachines CRD to avoid error in e2e running
zhengxiexie Nov 1, 2023
5b6e2fb
Fix ippool logic bug
zhengxiexie Nov 1, 2023
330bf37
Fix ippool e2e test case
zhengxiexie Nov 1, 2023
c34ab5a
Fix ippool issue when Spec.Subnets are nil
zhengxiexie Nov 3, 2023
5cfa3f3
Fix type issue of ippool
zhengxiexie Oct 24, 2023
4c243b0
Add key section to fix log error
seanpang-vmware Nov 13, 2023
1b477b4
Fix dumping http response error
TaoZou1 Nov 8, 2023
cc7f5be
Support setting http timeout for nsx-t
zhengxiexie Nov 17, 2023
c49a5a6
Update NSXServiceAccount CRD with conditions (#218)
timdengyun Nov 21, 2023
66a6cc0
[NSXServiceAccount] Support backup/restore (#209)
timdengyun Nov 21, 2023
58ccca9
[NSXServiceAccount] Support CA validation and client cert rotation (#…
gran-vmv Aug 23, 2023
e33abf0
Fix vpc store UT test to support tags search
timdengyun Nov 21, 2023
247f173
Fix missing merge from PR incorrect GC in restore case #351
timdengyun Nov 22, 2023
1a8115e
Add back missing x/time and x/tools module version
timdengyun Nov 22, 2023
5dbfa29
Fix make build generated files difference
timdengyun Nov 22, 2023
fa8ab54
Change github workflow action from vpc_dev to main branch
timdengyun Nov 22, 2023
57201b6
Add back enum validation for IPPool
zhengxiexie Nov 22, 2023
ee05cb5
Run `make generated` to sync packages
zhengxiexie Nov 22, 2023
93699bb
Sync latest nsx.vmware.com/v1alpha1/zz_generated.deepcopy.go
timdengyun Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=build/yaml/crd/
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha1;github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha2" output:crd:artifacts:config=build/yaml/crd/

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand All @@ -56,14 +56,18 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -gcflags=all=-l ./... -coverprofile cover.out ## Prohibit inline optimization when using gomonkey

##@ Build

.PHONY: build
build: generate fmt vet ## Build manager binary.
go build -o bin/manager cmd/main.go

.PHONY: clean
clean: generate fmt vet ## Build clean binary.
go build -o bin/clean cmd_clean/main.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/main.go
Expand Down Expand Up @@ -113,6 +117,9 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])

generated:
./hack/update-codegen.sh

ENVTEST = $(shell pwd)/bin/setup-envtest
.PHONY: envtest
envtest: ## Download envtest-setup locally if necessary.
Expand Down
7 changes: 7 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,11 @@ resources:
kind: NSXServiceAccount
path: github.com/vmware-tanzu/nsx-operator/pkg/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: nsx.vmware.com
kind: IPPool
path: github.com/vmware-tanzu/nsx-operator/pkg/api/v1alpha2
version: v1alpha2
version: "3"
116 changes: 98 additions & 18 deletions build/yaml/crd/nsx.vmware.com_ippools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
controller-gen.kubebuilder.io/version: v0.11.0
creationTimestamp: null
name: ippools.nsx.vmware.com
spec:
Expand All @@ -18,31 +18,120 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: IPPool is the Schema for the ippools 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: IPPoolSpec defines the desired state of IPPool.
properties:
subnets:
description: Subnets defines set of subnets need to be allocated.
items:
description: SubnetRequest defines the subnet allocation request.
properties:
ipFamily:
pattern: ^ipv(4|6)$
default: IPv4
description: IPFamily defines the IP family type for this subnet,
could be IPv4 or IPv6. This is optional, the default is IPv4.
enum:
- IPv4
- IPv6
type: string
name:
description: Name defines the name of this subnet.
type: string
prefixLength:
minimum: 1
description: PrefixLength defines prefix length for this subnet.
type: integer
required:
- name
type: object
type: array
type: object
status:
description: IPPoolStatus defines the observed state of IPPool.
properties:
conditions:
description: Conditions defines current state of the IPPool.
items:
description: Condition defines condition of custom resource.
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: Message shows a human-readable message about condition.
type: string
reason:
description: Reason shows a brief reason of condition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type defines condition type.
type: string
required:
- status
- type
type: object
type: array
subnets:
description: Subnets defines subnets allocation result.
items:
description: SubnetResult defines the subnet allocation result.
properties:
cidr:
description: CIDR defines the allocated CIDR.
type: string
name:
description: Name defines the name of this subnet.
type: string
required:
- cidr
- name
type: object
type: array
required:
- conditions
- subnets
type: object
required:
- metadata
- spec
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: false
- name: v1alpha2
subresources:
status: {}
- additionalPrinterColumns:
- description: Type of IPPool
jsonPath: .spec.type
name: Type
type: string
- description: CIDRs for the Subnet
jsonPath: .status.subnets[*].cidr
name: Subnets
type: string
name: v1alpha2
schema:
openAPIV3Schema:
description: IPPool is the Schema for the ippools API
description: IPPool is the Schema for the ippools API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down Expand Up @@ -83,14 +172,11 @@ spec:
type: object
type: array
type:
default: private
description: Type defines the type of this IPPool, public or private.
description: Type defines the type of this IPPool, Public or Private.
enum:
- public
- private
- Public
- Private
type: string
required:
- type
type: object
status:
description: IPPoolStatus defines the observed state of IPPool.
Expand Down Expand Up @@ -152,9 +238,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: ["v1alpha2"]
14 changes: 13 additions & 1 deletion build/yaml/crd/nsx.vmware.com_staticroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ spec:
singular: staticroute
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Network in CIDR format
jsonPath: .spec.network
name: Network
type: string
- description: Next Hops
jsonPath: .spec.nextHops[*].ipAddress
name: NextHops
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: StaticRoute is the Schema for the staticroutes API.
Expand Down Expand Up @@ -88,8 +97,11 @@ spec:
- type
type: object
type: array
nsxResourcePath:
type: string
required:
- conditions
- nsxResourcePath
type: object
type: object
served: true
Expand Down
15 changes: 14 additions & 1 deletion build/yaml/crd/nsx.vmware.com_subnetports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: subnetport
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Attachment VIF ID owned by the SubnetPort
jsonPath: .status.vifID
name: VIFID
type: string
- description: IP Address of the SubnetPort
jsonPath: .status.ipAddresses[0].ip
name: IPAddress
type: string
- description: MAC Address of the SubnetPort
jsonPath: .status.macAddress
name: MACAddress
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: SubnetPort is the Schema for the subnetports API.
Expand Down
30 changes: 18 additions & 12 deletions build/yaml/crd/nsx.vmware.com_subnets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: subnet
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Access mode of Subnet
jsonPath: .spec.accessMode
name: AccessMode
type: string
- description: Size of Subnet
jsonPath: .spec.ipv4SubnetSize
name: IPv4SubnetSize
type: string
- description: CIDRs for the Subnet
jsonPath: .status.ipAddresses[*]
name: IPAddresses
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: Subnet is the Schema for the subnets API.
Expand Down Expand Up @@ -67,12 +80,11 @@ spec:
type: boolean
type: object
accessMode:
default: private
description: Access mode of Subnet, accessible only from within VPC
or from outside VPC. Defaults to private.
or from outside VPC.
enum:
- private
- public
- Private
- Public
type: string
advancedConfig:
description: Subnet advanced configuration.
Expand All @@ -96,9 +108,7 @@ spec:
minItems: 0
type: array
ipv4SubnetSize:
default: 64
description: Size of Subnet based upon estimated workload count. Defaults
to 64.
description: Size of Subnet based upon estimated workload count.
maximum: 65536
minimum: 16
type: integer
Expand Down Expand Up @@ -140,10 +150,6 @@ spec:
type: array
nsxResourcePath:
type: string
required:
- conditions
- ipAddresses
- nsxResourcePath
type: object
type: object
served: true
Expand Down
29 changes: 18 additions & 11 deletions build/yaml/crd/nsx.vmware.com_subnetsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ spec:
singular: subnetset
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Access mode of Subnet
jsonPath: .spec.accessMode
name: AccessMode
type: string
- description: Size of Subnet
jsonPath: .spec.ipv4SubnetSize
name: IPv4SubnetSize
type: string
- description: CIDRs for the Subnet
jsonPath: .status.subnets[*].ipAddresses[*]
name: IPAddresses
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: SubnetSet is the Schema for the subnetsets API.
Expand Down Expand Up @@ -67,12 +80,11 @@ spec:
type: boolean
type: object
accessMode:
default: private
description: Access mode of Subnet, accessible only from within VPC
or from outside VPC. Defaults to private.
or from outside VPC.
enum:
- private
- public
- Private
- Public
type: string
advancedConfig:
description: Subnet advanced configuration.
Expand All @@ -89,9 +101,7 @@ spec:
type: object
type: object
ipv4SubnetSize:
default: 64
description: Size of Subnet based upon estimated workload count. Defaults
to 64.
description: Size of Subnet based upon estimated workload count.
maximum: 65536
minimum: 16
type: integer
Expand Down Expand Up @@ -143,9 +153,6 @@ spec:
- nsxResourcePath
type: object
type: array
required:
- conditions
- subnets
type: object
type: object
served: true
Expand Down
Loading
Loading