Documentation ¶
Index ¶
- func ConstructFirewallForLBService(svc *v1.Service, nodeTag string) *compute.Firewall
- func ConstructHealthCheckFirewallForLBService(clusterID string, svc *v1.Service, nodeTag string, isNodesHealthCheck bool) *compute.Firewall
- func GcloudComputeResourceCreate(resource, name, project string, args ...string) error
- func GcloudComputeResourceDelete(resource, name, project string, args ...string) error
- func GetClusterID(c clientset.Interface) (string, error)
- func GetClusterName(instancePrefix string) string
- func GetE2eFirewalls(masterName, masterTag, nodeTag, network, clusterIPRange string) []*compute.Firewall
- func GetGCECloud() (*gcecloud.Cloud, error)
- func GetInstancePrefix(masterName string) (string, error)
- func GetInstanceTags(cloudConfig framework.CloudConfig, instanceName string) *compute.Tags
- func IsGoogleAPIHTTPErrorCode(err error, code int) bool
- func MakeFirewallNameForLBService(name string) string
- func MakeHealthCheckFirewallNameForLBService(clusterID, name string, isNodesHealthCheck bool) string
- func NewProvider(gceCloud *gcecloud.Cloud) framework.ProviderInterface
- func PackProtocolsPortsFromFirewall(alloweds []*compute.FirewallAllowed) []string
- func RecreateNodes(c clientset.Interface, nodes []v1.Node) error
- func SameStringArray(result, expected []string, include bool) error
- func SetInstanceTags(cloudConfig framework.CloudConfig, instanceName, zone string, tags []string) []string
- func VerifyFirewallRule(res, exp *compute.Firewall, network string, portsSubset bool) error
- func WaitForFirewallRule(gceCloud *gcecloud.Cloud, fwName string, exist bool, timeout time.Duration) (*compute.Firewall, error)
- func WaitForNodeBootIdsToChange(c clientset.Interface, nodes []v1.Node, timeout time.Duration) error
- type IngressController
- func (cont *IngressController) BackendServiceUsingIG(svcPorts map[string]v1.ServicePort) error
- func (cont *IngressController) BackendServiceUsingNEG(svcPorts map[string]v1.ServicePort) error
- func (cont *IngressController) Cleanup(del bool) error
- func (cont *IngressController) CleanupIngressController() error
- func (cont *IngressController) CleanupIngressControllerWithTimeout(timeout time.Duration) error
- func (cont *IngressController) CreateStaticIP(name string) string
- func (cont *IngressController) GetFirewallRule() (*compute.Firewall, error)
- func (cont *IngressController) GetFirewallRuleName() string
- func (cont *IngressController) GetGlobalAddress(ipName string) *compute.Address
- func (cont *IngressController) Init() error
- func (cont *IngressController) ListGlobalBackendServices() []*compute.BackendService
- func (cont *IngressController) ListGlobalForwardingRules() []*compute.ForwardingRule
- func (cont *IngressController) ListInstanceGroups() []*compute.InstanceGroup
- func (cont *IngressController) ListSslCertificates() []*compute.SslCertificate
- func (cont *IngressController) ListTargetHTTPProxies() []*compute.TargetHttpProxy
- func (cont *IngressController) ListTargetHTTPSProxies() []*compute.TargetHttpsProxy
- func (cont *IngressController) ListURLMaps() []*compute.UrlMap
- func (cont *IngressController) WaitForIgBackendService(svcPorts map[string]v1.ServicePort) error
- func (cont *IngressController) WaitForNegBackendService(svcPorts map[string]v1.ServicePort) error
- type Provider
- func (p *Provider) CleanupServiceResources(c clientset.Interface, loadBalancerName, region, zone string)
- func (p *Provider) CreatePD(zone string) (string, error)
- func (p *Provider) CreatePVSource(zone, diskName string) (*v1.PersistentVolumeSource, error)
- func (p *Provider) DeleteNode(node *v1.Node) error
- func (p *Provider) DeletePD(pdName string) error
- func (p *Provider) DeletePVSource(pvSource *v1.PersistentVolumeSource) error
- func (p *Provider) EnableAndDisableInternalLB() (enable, disable func(svc *v1.Service))
- func (p *Provider) EnsureLoadBalancerResourcesDeleted(ip, portRange string) error
- func (p *Provider) GetGroupNodes(group string) ([]string, error)
- func (p *Provider) GroupSize(group string) (int, error)
- func (p *Provider) L4LoadBalancerSrcRanges() []string
- func (p *Provider) ResizeGroup(group string, size int32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructFirewallForLBService ¶
ConstructFirewallForLBService returns the expected GCE firewall rule for a loadbalancer type service
func ConstructHealthCheckFirewallForLBService ¶
func ConstructHealthCheckFirewallForLBService(clusterID string, svc *v1.Service, nodeTag string, isNodesHealthCheck bool) *compute.Firewall
ConstructHealthCheckFirewallForLBService returns the expected GCE firewall rule for a loadbalancer type service
func GcloudComputeResourceCreate ¶
GcloudComputeResourceCreate creates a compute resource with a name and arguments.
func GcloudComputeResourceDelete ¶
GcloudComputeResourceDelete deletes the specified compute resource by name and project.
func GetClusterID ¶
GetClusterID returns cluster ID
func GetClusterName ¶
GetClusterName returns the CLUSTER_NAME env we set for e2e cluster. From cluster/gce/config-test.sh, cluster name is set up using below format: CLUSTER_NAME="${CLUSTER_NAME:-${INSTANCE_PREFIX}}"
func GetE2eFirewalls ¶
func GetE2eFirewalls(masterName, masterTag, nodeTag, network, clusterIPRange string) []*compute.Firewall
GetE2eFirewalls returns all firewall rules we create for an e2e cluster. From cluster/gce/util.sh, all firewall rules should be consistent with the ones created by startup scripts.
func GetGCECloud ¶
GetGCECloud returns GCE cloud provider
func GetInstancePrefix ¶
GetInstancePrefix returns the INSTANCE_PREFIX env we set for e2e cluster. From cluster/gce/config-test.sh, master name is set up using below format: MASTER_NAME="${INSTANCE_PREFIX}-master"
func GetInstanceTags ¶
func GetInstanceTags(cloudConfig framework.CloudConfig, instanceName string) *compute.Tags
GetInstanceTags gets tags from GCE instance with given name.
func IsGoogleAPIHTTPErrorCode ¶
IsGoogleAPIHTTPErrorCode returns true if the error is a google api error matching the corresponding HTTP error code.
func MakeFirewallNameForLBService ¶
MakeFirewallNameForLBService return the expected firewall name for a LB service. This should match the formatting of makeFirewallName() in pkg/cloudprovider/providers/gce/gce_loadbalancer.go
func MakeHealthCheckFirewallNameForLBService ¶
func MakeHealthCheckFirewallNameForLBService(clusterID, name string, isNodesHealthCheck bool) string
MakeHealthCheckFirewallNameForLBService returns the firewall name used by the GCE load balancers for performing health checks.
func NewProvider ¶
func NewProvider(gceCloud *gcecloud.Cloud) framework.ProviderInterface
NewProvider returns a cloud provider interface for GCE
func PackProtocolsPortsFromFirewall ¶
func PackProtocolsPortsFromFirewall(alloweds []*compute.FirewallAllowed) []string
PackProtocolsPortsFromFirewall packs protocols and ports in an unified way for verification.
func RecreateNodes ¶ added in v1.15.0
RecreateNodes recreates the given nodes in a managed instance group.
func SameStringArray ¶
SameStringArray verifies whether two string arrays have the same strings, return error if not. Order does not matter. When `include` is set to true, verifies whether result includes all elements from expected.
func SetInstanceTags ¶
func SetInstanceTags(cloudConfig framework.CloudConfig, instanceName, zone string, tags []string) []string
SetInstanceTags sets tags on GCE instance with given name.
func VerifyFirewallRule ¶
VerifyFirewallRule verifies whether the result firewall is consistent with the expected firewall. When `portsSubset` is false, match given ports exactly. Otherwise, only check ports are included.
Types ¶
type IngressController ¶ added in v1.15.0
type IngressController struct { Ns string UID string Client clientset.Interface Cloud framework.CloudConfig // contains filtered or unexported fields }
IngressController manages implementation details of Ingress on GCE/GKE.
func (*IngressController) BackendServiceUsingIG ¶ added in v1.15.0
func (cont *IngressController) BackendServiceUsingIG(svcPorts map[string]v1.ServicePort) error
BackendServiceUsingIG returns true only if all global backend service with matching svcPorts pointing to IG as backend
func (*IngressController) BackendServiceUsingNEG ¶ added in v1.15.0
func (cont *IngressController) BackendServiceUsingNEG(svcPorts map[string]v1.ServicePort) error
BackendServiceUsingNEG returns true only if all global backend service with matching svcPorts pointing to NEG as backend
func (*IngressController) Cleanup ¶ added in v1.15.0
func (cont *IngressController) Cleanup(del bool) error
Cleanup cleans up cloud resources. If del is false, it simply reports existing resources without deleting them. If dle is true, it deletes resources it finds acceptable (see canDelete func).
func (*IngressController) CleanupIngressController ¶ added in v1.15.0
func (cont *IngressController) CleanupIngressController() error
CleanupIngressController calls cont.CleanupIngressControllerWithTimeout with hard-coded timeout
func (*IngressController) CleanupIngressControllerWithTimeout ¶ added in v1.15.0
func (cont *IngressController) CleanupIngressControllerWithTimeout(timeout time.Duration) error
CleanupIngressControllerWithTimeout calls the IngressController.Cleanup(false) followed with deleting the static ip, and then a final IngressController.Cleanup(true)
func (*IngressController) CreateStaticIP ¶ added in v1.15.0
func (cont *IngressController) CreateStaticIP(name string) string
CreateStaticIP allocates a random static ip with the given name. Returns a string representation of the ip. Caller is expected to manage cleanup of the ip by invoking deleteStaticIPs.
func (*IngressController) GetFirewallRule ¶ added in v1.15.0
func (cont *IngressController) GetFirewallRule() (*compute.Firewall, error)
GetFirewallRule returns the firewall used by the IngressController. Returns an error if that fails.
func (*IngressController) GetFirewallRuleName ¶ added in v1.15.0
func (cont *IngressController) GetFirewallRuleName() string
GetFirewallRuleName returns the name of the firewall used for the IngressController.
func (*IngressController) GetGlobalAddress ¶ added in v1.15.0
func (cont *IngressController) GetGlobalAddress(ipName string) *compute.Address
GetGlobalAddress returns the global address by name.
func (*IngressController) Init ¶ added in v1.15.0
func (cont *IngressController) Init() error
Init initializes the IngressController with an UID
func (*IngressController) ListGlobalBackendServices ¶ added in v1.15.0
func (cont *IngressController) ListGlobalBackendServices() []*compute.BackendService
ListGlobalBackendServices lists all global backend services
func (*IngressController) ListGlobalForwardingRules ¶ added in v1.15.0
func (cont *IngressController) ListGlobalForwardingRules() []*compute.ForwardingRule
ListGlobalForwardingRules returns a list of global forwarding rules
func (*IngressController) ListInstanceGroups ¶ added in v1.15.0
func (cont *IngressController) ListInstanceGroups() []*compute.InstanceGroup
ListInstanceGroups lists all instance groups
func (*IngressController) ListSslCertificates ¶ added in v1.15.0
func (cont *IngressController) ListSslCertificates() []*compute.SslCertificate
ListSslCertificates lists all SSL certificates
func (*IngressController) ListTargetHTTPProxies ¶ added in v1.15.0
func (cont *IngressController) ListTargetHTTPProxies() []*compute.TargetHttpProxy
ListTargetHTTPProxies lists all target HTTP proxies in the project
func (*IngressController) ListTargetHTTPSProxies ¶ added in v1.15.0
func (cont *IngressController) ListTargetHTTPSProxies() []*compute.TargetHttpsProxy
ListTargetHTTPSProxies lists all target HTTPS proxies
func (*IngressController) ListURLMaps ¶ added in v1.15.0
func (cont *IngressController) ListURLMaps() []*compute.UrlMap
ListURLMaps lists all URL maps
func (*IngressController) WaitForIgBackendService ¶ added in v1.15.0
func (cont *IngressController) WaitForIgBackendService(svcPorts map[string]v1.ServicePort) error
WaitForIgBackendService returns true only if all global backend service with matching svcPorts pointing to IG as backend
func (*IngressController) WaitForNegBackendService ¶ added in v1.15.0
func (cont *IngressController) WaitForNegBackendService(svcPorts map[string]v1.ServicePort) error
WaitForNegBackendService waits for the expected backend service to become
type Provider ¶
type Provider struct { framework.NullProvider // contains filtered or unexported fields }
Provider is a structure to handle GCE clouds for e2e testing
func (*Provider) CleanupServiceResources ¶
func (p *Provider) CleanupServiceResources(c clientset.Interface, loadBalancerName, region, zone string)
CleanupServiceResources cleans up GCE Service Type=LoadBalancer resources with the given name. The name is usually the UUID of the Service prefixed with an alpha-numeric character ('a') to work around cloudprovider rules.
func (*Provider) CreatePVSource ¶
func (p *Provider) CreatePVSource(zone, diskName string) (*v1.PersistentVolumeSource, error)
CreatePVSource creates a persistent volume source
func (*Provider) DeleteNode ¶ added in v1.14.0
DeleteNode deletes a node which is specified as the argument
func (*Provider) DeletePVSource ¶
func (p *Provider) DeletePVSource(pvSource *v1.PersistentVolumeSource) error
DeletePVSource deletes a persistent volume source
func (*Provider) EnableAndDisableInternalLB ¶
EnableAndDisableInternalLB returns functions for both enabling and disabling internal Load Balancer
func (*Provider) EnsureLoadBalancerResourcesDeleted ¶
EnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created
func (*Provider) GetGroupNodes ¶
GetGroupNodes returns a node name for the specified node group
func (*Provider) L4LoadBalancerSrcRanges ¶ added in v1.17.0
L4LoadBalancerSrcRanges contains the ranges of ips used by the GCE L4 load balancers for proxying client requests and performing health checks.