Documentation ¶
Index ¶
- Constants
- Variables
- func IsVPCChanged(nc VPCNetworkConfigInfo, vpc *model.Vpc) bool
- type AVIAllowRule
- type AviGroupStore
- type AviRuleStore
- type AviSecurityPolicyStore
- type IPBlockStore
- type PubIPblockStore
- type VPCNetworkConfigInfo
- type VPCService
- func (s *VPCService) Cleanup() error
- func (s *VPCService) CreatOrUpdatePrivateIPBlock(obj *v1alpha1.VPC, nc VPCNetworkConfigInfo) (map[string]string, error)
- func (service *VPCService) CreateOrUpdateAVIRule(vpc *model.Vpc, namespace string) error
- func (s *VPCService) CreateorUpdateVPC(obj *v1alpha1.VPC) (*model.Vpc, *VPCNetworkConfigInfo, error)
- func (s *VPCService) DeleteIPBlockInVPC(vpc model.Vpc) error
- func (s *VPCService) DeleteVPC(path string) error
- func (s *VPCService) GetAVISubnetInfo(vpc model.Vpc) (string, string, error)
- func (s *VPCService) GetDefaultSNATIP(vpc model.Vpc) (string, error)
- func (s *VPCService) GetNamespacesByNetworkconfigName(nc string) []string
- func (s *VPCService) GetVPCNetworkConfig(ncCRName string) (VPCNetworkConfigInfo, bool)
- func (s *VPCService) GetVPCNetworkConfigByNamespace(ns string) *VPCNetworkConfigInfo
- func (s *VPCService) GetVPCsByNamespace(namespace string) []model.Vpc
- func (s *VPCService) ListVPC() []model.Vpc
- func (s *VPCService) RegisterNamespaceNetworkconfigBinding(ns string, ncCRName string)
- func (s *VPCService) RegisterVPCNetworkConfig(ncCRName string, info VPCNetworkConfigInfo)
- func (s *VPCService) UnRegisterNamespaceNetworkconfigBinding(ns string)
- func (s *VPCService) UnregisterVPCNetworkConfig(ncCRName string)
- func (s *VPCService) ValidateNetworkConfig(nc VPCNetworkConfigInfo) bool
- type VPCStore
Constants ¶
View Source
const ( AviSEIngressAllowRuleId = "avi-se-ingress-allow-rule" VPCAviSEGroupId = "avi-se-vms" VpcDefaultSecurityPolicyId = "default-layer3-section" GroupKey = "/orgs/%s/projects/%s/vpcs/%s/groups/%s" SecurityPolicyKey = "/orgs/%s/projects/%s/vpcs/%s/security-policies/%s" RuleKey = "/orgs/%s/projects/%s/vpcs/%s/security-policies/%s/rules/%s" )
Variables ¶
View Source
var ( DefaultVPCIPAddressType = "IPV4" DefaultLoadBalancerVPCEndpointEnabled = true )
View Source
var ( ResourceTypeVPC = common.ResourceTypeVpc NewConverter = common.NewConverter // this store contains mapping relation of network config name and network config entity VPCNetworkConfigMap = map[string]VPCNetworkConfigInfo{} // this map contains mapping relation between namespace and the network config it uses. VPCNSNetworkconfigMap = map[string]string{} EnforceRevisionCheckParam = false MarkedForDelete = true )
Functions ¶
func IsVPCChanged ¶
func IsVPCChanged(nc VPCNetworkConfigInfo, vpc *model.Vpc) bool
currently we only support appending public/private cidrs so only comparing list size is enough to identify if vcp changed
Types ¶
type AVIAllowRule ¶ added in v0.0.3
type AVIAllowRule struct { GroupStore *AviGroupStore RuleStore *AviRuleStore SecurityPolicyStore *AviSecurityPolicyStore PubIpblockStore *PubIPblockStore }
type AviGroupStore ¶ added in v0.0.3
type AviGroupStore struct {
common.ResourceStore
}
func (*AviGroupStore) Apply ¶ added in v0.0.3
func (groupStore *AviGroupStore) Apply(i interface{}) error
type AviRuleStore ¶ added in v0.0.3
type AviRuleStore struct {
common.ResourceStore
}
AviRuleStore is a store for saving AVI related Rules in VPCs
func (*AviRuleStore) Apply ¶ added in v0.0.3
func (ruleStore *AviRuleStore) Apply(i interface{}) error
type AviSecurityPolicyStore ¶ added in v0.0.3
type AviSecurityPolicyStore struct {
common.ResourceStore
}
func (*AviSecurityPolicyStore) Apply ¶ added in v0.0.3
func (securityPolicyStore *AviSecurityPolicyStore) Apply(i interface{}) error
func (*AviSecurityPolicyStore) GetByKey ¶ added in v0.0.3
func (securityPolicyStore *AviSecurityPolicyStore) GetByKey(key string) *model.SecurityPolicy
type IPBlockStore ¶
type IPBlockStore struct {
common.ResourceStore
}
IPBlockStore is a store for private ip blocks
func (*IPBlockStore) Apply ¶ added in v0.0.1
func (is *IPBlockStore) Apply(i interface{}) error
func (*IPBlockStore) GetByIndex ¶
func (is *IPBlockStore) GetByIndex(index string, value string) *model.IpAddressBlock
type PubIPblockStore ¶ added in v0.0.3
type PubIPblockStore struct {
common.ResourceStore
}
PubIPblockStore is a store to query external ip blocks cidr
func (*PubIPblockStore) Apply ¶ added in v0.0.3
func (ipBlockStore *PubIPblockStore) Apply(i interface{}) error
func (*PubIPblockStore) GetByKey ¶ added in v0.0.3
func (ipBlockStore *PubIPblockStore) GetByKey(key string) *model.IpAddressBlock
type VPCNetworkConfigInfo ¶
type VPCService ¶
type VPCService struct { common.Service VpcStore *VPCStore IpblockStore *IPBlockStore AVIAllowRule }
func InitializeVPC ¶
func InitializeVPC(service common.Service) (*VPCService, error)
InitializeVPC sync NSX resources
func (*VPCService) Cleanup ¶
func (s *VPCService) Cleanup() error
func (*VPCService) CreatOrUpdatePrivateIPBlock ¶
func (s *VPCService) CreatOrUpdatePrivateIPBlock(obj *v1alpha1.VPC, nc VPCNetworkConfigInfo) (map[string]string, error)
func (*VPCService) CreateOrUpdateAVIRule ¶ added in v0.0.3
func (service *VPCService) CreateOrUpdateAVIRule(vpc *model.Vpc, namespace string) error
func (*VPCService) CreateorUpdateVPC ¶
func (s *VPCService) CreateorUpdateVPC(obj *v1alpha1.VPC) (*model.Vpc, *VPCNetworkConfigInfo, error)
func (*VPCService) DeleteIPBlockInVPC ¶
func (s *VPCService) DeleteIPBlockInVPC(vpc model.Vpc) error
func (*VPCService) DeleteVPC ¶
func (s *VPCService) DeleteVPC(path string) error
func (*VPCService) GetAVISubnetInfo ¶
func (*VPCService) GetDefaultSNATIP ¶
func (s *VPCService) GetDefaultSNATIP(vpc model.Vpc) (string, error)
func (*VPCService) GetNamespacesByNetworkconfigName ¶
func (s *VPCService) GetNamespacesByNetworkconfigName(nc string) []string
find the namespace list which is using the given network configuration
func (*VPCService) GetVPCNetworkConfig ¶
func (s *VPCService) GetVPCNetworkConfig(ncCRName string) (VPCNetworkConfigInfo, bool)
func (*VPCService) GetVPCNetworkConfigByNamespace ¶
func (s *VPCService) GetVPCNetworkConfigByNamespace(ns string) *VPCNetworkConfigInfo
func (*VPCService) GetVPCsByNamespace ¶
func (s *VPCService) GetVPCsByNamespace(namespace string) []model.Vpc
func (*VPCService) ListVPC ¶
func (s *VPCService) ListVPC() []model.Vpc
func (*VPCService) RegisterNamespaceNetworkconfigBinding ¶
func (s *VPCService) RegisterNamespaceNetworkconfigBinding(ns string, ncCRName string)
func (*VPCService) RegisterVPCNetworkConfig ¶
func (s *VPCService) RegisterVPCNetworkConfig(ncCRName string, info VPCNetworkConfigInfo)
func (*VPCService) UnRegisterNamespaceNetworkconfigBinding ¶
func (s *VPCService) UnRegisterNamespaceNetworkconfigBinding(ns string)
func (*VPCService) UnregisterVPCNetworkConfig ¶
func (s *VPCService) UnregisterVPCNetworkConfig(ncCRName string)
func (*VPCService) ValidateNetworkConfig ¶
func (s *VPCService) ValidateNetworkConfig(nc VPCNetworkConfigInfo) bool
TBD: for now, if network config info do not contains private cidr, we consider this is incorrect configuration, and skip creating this VPC CR
Click to show internal directories.
Click to hide internal directories.