import "k8s.io/kubernetes/test/e2e/framework/providers/gce"
firewall.go gce.go ingress.go util.go
ConstructFirewallForLBService returns the expected GCE firewall rule for a loadbalancer type service
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
GcloudComputeResourceCreate creates a compute resource with a name and arguments.
GcloudComputeResourceDelete deletes the specified compute resource by name and project.
GetClusterID returns cluster ID
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(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.
GetGCECloud returns GCE cloud provider
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"
GetInstanceTags gets tags from GCE instance with given name.
IsGoogleAPIHTTPErrorCode returns true if the error is a google api error matching the corresponding HTTP error code.
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(clusterID, name string, isNodesHealthCheck bool) string
MakeHealthCheckFirewallNameForLBService returns the firewall name used by the GCE load balancers for performing health checks.
func NewProvider(gceCloud *gcecloud.Cloud) framework.ProviderInterface
NewProvider returns a cloud provider interface for GCE
func PackProtocolsPortsFromFirewall(alloweds []*compute.FirewallAllowed) []string
PackProtocolsPortsFromFirewall packs protocols and ports in an unified way for verification.
RecreateNodes recreates the given nodes in a managed instance group.
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(cloudConfig framework.CloudConfig, instanceName, zone string, tags []string) []string
SetInstanceTags sets tags on GCE instance with given name.
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.
func WaitForFirewallRule(gceCloud *gcecloud.Cloud, fwName string, exist bool, timeout time.Duration) (*compute.Firewall, error)
WaitForFirewallRule waits for the specified firewall existence
func WaitForNodeBootIdsToChange(c clientset.Interface, nodes []v1.Node, timeout time.Duration) error
WaitForNodeBootIdsToChange waits for the boot ids of the given nodes to change in order to verify the node has been recreated.
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 (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 (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 (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 (cont *IngressController) CleanupIngressController() error
CleanupIngressController calls cont.CleanupIngressControllerWithTimeout with hard-coded timeout
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 (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 (cont *IngressController) GetFirewallRule() (*compute.Firewall, error)
GetFirewallRule returns the firewall used by the IngressController. Returns an error if that fails.
func (cont *IngressController) GetFirewallRuleName() string
GetFirewallRuleName returns the name of the firewall used for the IngressController.
func (cont *IngressController) GetGlobalAddress(ipName string) *compute.Address
GetGlobalAddress returns the global address by name.
func (cont *IngressController) Init() error
Init initializes the IngressController with an UID
func (cont *IngressController) ListGlobalBackendServices() []*compute.BackendService
ListGlobalBackendServices lists all global backend services
func (cont *IngressController) ListGlobalForwardingRules() []*compute.ForwardingRule
ListGlobalForwardingRules returns a list of global forwarding rules
func (cont *IngressController) ListInstanceGroups() []*compute.InstanceGroup
ListInstanceGroups lists all instance groups
func (cont *IngressController) ListSslCertificates() []*compute.SslCertificate
ListSslCertificates lists all SSL certificates
func (cont *IngressController) ListTargetHTTPProxies() []*compute.TargetHttpProxy
ListTargetHTTPProxies lists all target HTTP proxies in the project
func (cont *IngressController) ListTargetHTTPSProxies() []*compute.TargetHttpsProxy
ListTargetHTTPSProxies lists all target HTTPS proxies
func (cont *IngressController) ListURLMaps() []*compute.UrlMap
ListURLMaps lists all URL maps
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 (cont *IngressController) WaitForNegBackendService(svcPorts map[string]v1.ServicePort) error
WaitForNegBackendService waits for the expected backend service to become
type Provider struct { framework.NullProvider // contains filtered or unexported fields }
Provider is a structure to handle GCE clouds for e2e testing
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.
CreatePD creates a persistent volume
CreatePVSource creates a persistent volume source
DeleteNode deletes a node which is specified as the argument
DeletePD deletes a persistent volume
func (p *Provider) DeletePVSource(pvSource *v1.PersistentVolumeSource) error
DeletePVSource deletes a persistent volume source
EnableAndDisableInternalLB returns functions for both enabling and disabling internal Load Balancer
EnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created
GetGroupNodes returns a node name for the specified node group
GroupSize returns the size of an instance group
L4LoadBalancerSrcRanges contains the ranges of ips used by the GCE L4 load balancers for proxying client requests and performing health checks.
ResizeGroup resizes an instance group
Package gce imports 25 packages (graph) and is imported by 214 packages. Updated 2021-01-12. Refresh now. Tools for package owners.