Documentation ¶
Index ¶
- Constants
- Variables
- func IsVPCChanged(nc common.VPCNetworkConfigInfo, vpc *model.Vpc) bool
- type AVIAllowRule
- type AviGroupStore
- type AviRuleStore
- type AviSecurityPolicyStore
- type IPBlockStore
- type PubIPblockStore
- type VPCService
- func (s *VPCService) Cleanup(ctx context.Context) error
- func (s *VPCService) CreatOrUpdatePrivateIPBlock(obj *v1alpha1.VPC, nc common.VPCNetworkConfigInfo) (map[string]string, error)
- func (service *VPCService) CreateOrUpdateAVIRule(vpc *model.Vpc, namespace string) error
- func (s *VPCService) CreateorUpdateVPC(obj *v1alpha1.VPC) (*model.Vpc, *common.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) GetDefaultNetworkConfig() (bool, *common.VPCNetworkConfigInfo)
- func (s *VPCService) GetDefaultSNATIP(vpc model.Vpc) (string, error)
- func (s *VPCService) GetNamespacesByNetworkconfigName(nc string) []string
- func (s *VPCService) GetVPCNetworkConfig(ncCRName string) (common.VPCNetworkConfigInfo, bool)
- func (s *VPCService) GetVPCNetworkConfigByNamespace(ns string) *common.VPCNetworkConfigInfo
- func (s *VPCService) GetVPCsByNamespace(namespace string) []*model.Vpc
- func (s *VPCService) ListVPC() []model.Vpc
- func (service *VPCService) ListVPCInfo(ns string) []common.VPCResourceInfo
- func (s *VPCService) RegisterNamespaceNetworkconfigBinding(ns string, ncCRName string)
- func (s *VPCService) RegisterVPCNetworkConfig(ncCRName string, info common.VPCNetworkConfigInfo)
- func (s *VPCService) UnRegisterNamespaceNetworkconfigBinding(ns string)
- func (s *VPCService) UnregisterVPCNetworkConfig(ncCRName string)
- func (s *VPCService) ValidateNetworkConfig(nc common.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 MarkedForDelete = true )
Functions ¶
func IsVPCChanged ¶
func IsVPCChanged(nc common.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 ¶
type AVIAllowRule struct { GroupStore *AviGroupStore RuleStore *AviRuleStore SecurityPolicyStore *AviSecurityPolicyStore PubIpblockStore *PubIPblockStore }
type AviGroupStore ¶
type AviGroupStore struct {
common.ResourceStore
}
func (*AviGroupStore) Apply ¶
func (groupStore *AviGroupStore) Apply(i interface{}) error
type AviRuleStore ¶
type AviRuleStore struct {
common.ResourceStore
}
AviRuleStore is a store for saving AVI related Rules in VPCs
func (*AviRuleStore) Apply ¶
func (ruleStore *AviRuleStore) Apply(i interface{}) error
type AviSecurityPolicyStore ¶
type AviSecurityPolicyStore struct {
common.ResourceStore
}
func (*AviSecurityPolicyStore) Apply ¶
func (securityPolicyStore *AviSecurityPolicyStore) Apply(i interface{}) error
func (*AviSecurityPolicyStore) GetByKey ¶
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 ¶
func (is *IPBlockStore) Apply(i interface{}) error
func (*IPBlockStore) GetByIndex ¶
func (is *IPBlockStore) GetByIndex(index string, value string) *model.IpAddressBlock
type PubIPblockStore ¶
type PubIPblockStore struct {
common.ResourceStore
}
PubIPblockStore is a store to query external ip blocks cidr
func (*PubIPblockStore) Apply ¶
func (ipBlockStore *PubIPblockStore) Apply(i interface{}) error
func (*PubIPblockStore) GetByKey ¶
func (ipBlockStore *PubIPblockStore) GetByKey(key string) *model.IpAddressBlock
type VPCService ¶
type VPCService struct { common.Service VpcStore *VPCStore IpblockStore *IPBlockStore VPCNetworkConfigMap map[string]common.VPCNetworkConfigInfo VPCNSNetworkConfigMap map[string]string AVIAllowRule // contains filtered or unexported fields }
func InitializeVPC ¶
func InitializeVPC(service common.Service) (*VPCService, error)
InitializeVPC sync NSX resources
func (*VPCService) CreatOrUpdatePrivateIPBlock ¶
func (s *VPCService) CreatOrUpdatePrivateIPBlock(obj *v1alpha1.VPC, nc common.VPCNetworkConfigInfo) (map[string]string, error)
func (*VPCService) CreateOrUpdateAVIRule ¶
func (service *VPCService) CreateOrUpdateAVIRule(vpc *model.Vpc, namespace string) error
func (*VPCService) CreateorUpdateVPC ¶
func (s *VPCService) CreateorUpdateVPC(obj *v1alpha1.VPC) (*model.Vpc, *common.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) GetDefaultNetworkConfig ¶
func (s *VPCService) GetDefaultNetworkConfig() (bool, *common.VPCNetworkConfigInfo)
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) (common.VPCNetworkConfigInfo, bool)
func (*VPCService) GetVPCNetworkConfigByNamespace ¶
func (s *VPCService) GetVPCNetworkConfigByNamespace(ns string) *common.VPCNetworkConfigInfo
func (*VPCService) GetVPCsByNamespace ¶
func (s *VPCService) GetVPCsByNamespace(namespace string) []*model.Vpc
func (*VPCService) ListVPC ¶
func (s *VPCService) ListVPC() []model.Vpc
func (*VPCService) ListVPCInfo ¶
func (service *VPCService) ListVPCInfo(ns string) []common.VPCResourceInfo
func (*VPCService) RegisterNamespaceNetworkconfigBinding ¶
func (s *VPCService) RegisterNamespaceNetworkconfigBinding(ns string, ncCRName string)
func (*VPCService) RegisterVPCNetworkConfig ¶
func (s *VPCService) RegisterVPCNetworkConfig(ncCRName string, info common.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 common.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.