Skip to content

Commit

Permalink
Merge branch 'vpc_dev' into e2e_sp_0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengxiexie committed Feb 23, 2023
2 parents 529cb63 + 51910d2 commit 2f99a44
Show file tree
Hide file tree
Showing 22 changed files with 1,151 additions and 39 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
rm -rf $$TMP_DIR ;\
}
endef
8 changes: 8 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ resources:
kind: SubnetPort
path: github.com/vmware-tanzu/nsx-operator/pkg/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: nsx.vmware.com
kind: NSXServiceAccount
path: github.com/vmware-tanzu/nsx-operator/pkg/api/v1alpha1
version: v1alpha1
version: "3"
2 changes: 1 addition & 1 deletion build/image/photon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.7 as golang-build
FROM golang:1.19.5 as golang-build

WORKDIR /source

Expand Down
106 changes: 106 additions & 0 deletions build/yaml/crd/nsx.vmware.com_nsxserviceaccounts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: nsxserviceaccounts.nsx.vmware.com
spec:
group: nsx.vmware.com
names:
kind: NSXServiceAccount
listKind: NSXServiceAccountList
plural: nsxserviceaccounts
singular: nsxserviceaccount
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: NSXServiceAccount is the Schema for the nsxserviceaccounts 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: NSXServiceAccountSpec defines the desired state of NSXServiceAccount
properties:
vpcName:
type: string
type: object
status:
description: NSXServiceAccountStatus defines the observed state of NSXServiceAccount
properties:
clusterID:
type: string
clusterName:
type: string
nsxManagers:
items:
type: string
type: array
phase:
type: string
proxyEndpoints:
properties:
addresses:
items:
properties:
hostname:
type: string
ip:
format: ip
type: string
type: object
type: array
ports:
items:
properties:
name:
type: string
port:
type: integer
protocol:
type: string
type: object
type: array
type: object
reason:
type: string
secrets:
items:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: array
vpcPath:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
47 changes: 47 additions & 0 deletions build/yaml/crd/nsx.vmware.com_subnets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,37 @@ spec:
spec:
description: SubnetSpec defines the desired state of Subnet.
properties:
DHCPConfig:
description: DHCPConfig DHCP configuration.
properties:
dhcpRelayConfigPath:
description: DHCPRelayConfigPath is policy path of DHCP-relay-config.
type: string
dhcpV4PoolSize:
default: 80
description: DHCPV4PoolSize IPs in % to be reserved for DHCP ranges.
By default, 80% of IPv4 IPs will be reserved for DHCP. Configure
0 if no pool is required.
maximum: 100
minimum: 0
type: integer
dhcpV6PoolSize:
default: 2000
description: DHCPV6PoolSize number of IPs to be reserved for DHCP
ranges. By default, 2000 IPv6 IPs will be reserved for DHCP.
type: integer
dnsClientConfig:
description: DNSClientConfig holds DNS configurations.
properties:
dnsServersIPs:
items:
type: string
type: array
type: object
enableDHCP:
default: false
type: boolean
type: object
accessMode:
default: private
description: Access mode of Subnet, accessible only from within VPC
Expand All @@ -44,6 +75,20 @@ spec:
- private
- public
type: string
advancedConfig:
description: Subnet advanced configuration.
properties:
staticIPAllocation:
description: StaticIPAllocation configuration for subnet ports
with VIF attachment.
properties:
enable:
default: false
description: Enable or disable static IP allocation for subnet
ports with VIF attachment.
type: boolean
type: object
type: object
ipAddresses:
description: Subnet CIDRS.
items:
Expand All @@ -55,6 +100,8 @@ spec:
default: 64
description: Size of Subnet based upon estimated workload count. Defaults
to 64.
maximum: 65536
minimum: 16
type: integer
type: object
status:
Expand Down
47 changes: 47 additions & 0 deletions build/yaml/crd/nsx.vmware.com_subnetsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,37 @@ spec:
spec:
description: SubnetSetSpec defines the desired state of SubnetSet.
properties:
DHCPConfig:
description: DHCPConfig DHCP configuration.
properties:
dhcpRelayConfigPath:
description: DHCPRelayConfigPath is policy path of DHCP-relay-config.
type: string
dhcpV4PoolSize:
default: 80
description: DHCPV4PoolSize IPs in % to be reserved for DHCP ranges.
By default, 80% of IPv4 IPs will be reserved for DHCP. Configure
0 if no pool is required.
maximum: 100
minimum: 0
type: integer
dhcpV6PoolSize:
default: 2000
description: DHCPV6PoolSize number of IPs to be reserved for DHCP
ranges. By default, 2000 IPv6 IPs will be reserved for DHCP.
type: integer
dnsClientConfig:
description: DNSClientConfig holds DNS configurations.
properties:
dnsServersIPs:
items:
type: string
type: array
type: object
enableDHCP:
default: false
type: boolean
type: object
accessMode:
default: private
description: Access mode of Subnet, accessible only from within VPC
Expand All @@ -44,10 +75,26 @@ spec:
- private
- public
type: string
advancedConfig:
description: Subnet advanced configuration.
properties:
staticIPAllocation:
description: StaticIPAllocation configuration for subnet ports
with VIF attachment.
properties:
enable:
default: false
description: Enable or disable static IP allocation for subnet
ports with VIF attachment.
type: boolean
type: object
type: object
ipv4SubnetSize:
default: 64
description: Size of Subnet based upon estimated workload count. Defaults
to 64.
maximum: 65536
minimum: 16
type: integer
type: object
status:
Expand Down
6 changes: 0 additions & 6 deletions build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ spec:
When a field is not set in a Namespace's VPCNetworkConfiguration, the
Namespace will use the value in the default VPCNetworkConfiguration.
properties:
appliedToNamespaces:
description: Namespaces to be applied. The default VPCNetworkConfiguration
will not have AppliedToNamespaces set.
items:
type: string
type: array
defaultGatewayPath:
description: PolicyPath of Tier0 or Tier0 VRF gateway.
type: string
Expand Down
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ func init() {
flag.Parse()
var err error

logf.SetLogger(logger.ZapLogger())
cf, err = config.NewNSXOperatorConfigFromFile()
if err != nil {
log.Error(err, "load config file error")
os.Exit(1)
}
logf.SetLogger(logger.ZapLogger())

if metrics.AreMetricsExposed(cf) {
metrics.InitializePrometheusMetrics()
}
Expand Down
14 changes: 5 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/vmware-tanzu/nsx-operator

go 1.17
go 1.19

replace (
github.com/vmware/go-vmware-nsxt => github.com/mengdie-song/go-vmware-nsxt v0.0.0-20220921033217-dbd234470e30 // inventory-keeper includes all commits from github.com/gran-vmv/go-vmware-nsxt v0.0.0-20211206034609-cd7ffaf2c996
github.com/vmware/vsphere-automation-sdk-go/lib => github.com/TaoZou1/vsphere-automation-sdk-go/lib v0.5.1-0.20221020082725-84e89979deb6
github.com/vmware/vsphere-automation-sdk-go/runtime => github.com/TaoZou1/vsphere-automation-sdk-go/runtime v0.5.1-0.20221020082725-84e89979deb6
github.com/vmware/vsphere-automation-sdk-go/lib => github.com/TaoZou1/vsphere-automation-sdk-go/lib v0.5.2
github.com/vmware/vsphere-automation-sdk-go/runtime => github.com/TaoZou1/vsphere-automation-sdk-go/runtime v0.5.2
github.com/vmware/vsphere-automation-sdk-go/services/nsxt => github.com/TaoZou1/vsphere-automation-sdk-go/services/nsxt v0.9.3
)

Expand All @@ -19,29 +19,24 @@ require (
github.com/golang/mock v1.6.0
github.com/kevinburke/ssh_config v1.2.0
github.com/openlyinc/pointy v1.1.2
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
github.com/vmware/go-vmware-nsxt v0.0.0-20220328155605-f49a14c1ef5f
github.com/vmware/govmomi v0.27.4
github.com/vmware/vsphere-automation-sdk-go/lib v0.5.0
github.com/vmware/vsphere-automation-sdk-go/runtime v0.5.0
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.6.0
go.uber.org/zap v1.19.1
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
golang.org/x/mod v0.4.2
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
gopkg.in/ini.v1 v1.66.4
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.4
k8s.io/apimachinery v0.23.4
k8s.io/client-go v0.23.4
sigs.k8s.io/controller-runtime v0.11.1
)

require (
github.com/antihax/optional v1.0.0 // indirect
github.com/beevik/etree v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
Expand All @@ -63,6 +58,7 @@ require (
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.28.0 // indirect
Expand All @@ -80,6 +76,7 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/component-base v0.23.0 // indirect
Expand All @@ -90,4 +87,3 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

Loading

0 comments on commit 2f99a44

Please sign in to comment.