Documentation
¶
Index ¶
- Constants
- func CreateEndTimeFinder(promInstance PrometheusInstance, query string, startTime time.Time, ...) func() error
- func CreateLicenseSecret(k8sClient client.Client, namespace, filename string) error
- func CreateMetricExistChecker(promInstance PrometheusInstance, query string, getTime func() time.Time, ...) func() error
- func CreateResponseChecker(url, address string, requestTimeout time.Duration) func() error
- func CreateResultsDir(testName, version string) (string, error)
- func CreateResultsFile(filename string) (*os.File, error)
- func CreateResultsFilename(ext, base string, plusEnabled bool) string
- func GenerateCPUPNG(resultsDir, inputFilename, outputFilename string) error
- func GenerateMemoryPNG(resultsDir, inputFilename, outputFilename string) error
- func GenerateRequestsPNG(resultsDir, inputFilename, outputFilename string) error
- func GenerateTTRPNG(resultsDir, inputFilename, outputFilename string) error
- func Get(url, address string, timeout time.Duration) (int, string, error)
- func GetBuildInfo() (commitHash string, commitTime string, dirtyBuild string)
- func GetCollectorPodName(resourceManager ResourceManager) (string, error)
- func GetEvents(rm ResourceManager, namespace string) string
- func GetEventsAvgTime(promInstance PrometheusInstance, ngfPodName string) (float64, error)
- func GetEventsAvgTimeWithStartTime(promInstance PrometheusInstance, ngfPodName string, startTime time.Time) (float64, error)
- func GetEventsCount(promInstance PrometheusInstance, ngfPodName string) (float64, error)
- func GetEventsCountWithStartTime(promInstance PrometheusInstance, ngfPodName string, startTime time.Time) (float64, error)
- func GetFirstValueOfPrometheusVector(val model.Value) (float64, error)
- func GetLogs(rm ResourceManager, namespace string, releaseName string) string
- func GetReadyNGFPodNames(k8sClient client.Client, namespace, releaseName string, timeout time.Duration) ([]string, error)
- func GetReloadAvgTime(promInstance PrometheusInstance, ngfPodName string) (float64, error)
- func GetReloadAvgTimeWithStartTime(promInstance PrometheusInstance, ngfPodName string, startTime time.Time) (float64, error)
- func GetReloadCount(promInstance PrometheusInstance, ngfPodName string) (float64, error)
- func GetReloadCountWithStartTime(promInstance PrometheusInstance, ngfPodName string, startTime time.Time) (float64, error)
- func GetReloadErrsCountWithStartTime(promInstance PrometheusInstance, ngfPodName string, startTime time.Time) (float64, error)
- func InstallCollector() ([]byte, error)
- func InstallGatewayAPI(apiVersion string) ([]byte, error)
- func InstallNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error)
- func NewCSVResultsWriter(resultsDir, fileName string, resultHeaders ...string) (*os.File, *csv.Writer, error)
- func NewVegetaCSVEncoder(w io.Writer) vegeta.Encoder
- func PortForward(config *rest.Config, namespace, podName string, ports []string, ...) error
- func Post(url, address string, body io.Reader, timeout time.Duration) (*http.Response, error)
- func UninstallCollector(resourceManager ResourceManager) ([]byte, error)
- func UninstallGatewayAPI(apiVersion string) ([]byte, error)
- func UninstallNGF(cfg InstallationConfig, k8sClient client.Client) ([]byte, error)
- func UninstallPrometheus(rm ResourceManager) error
- func UpgradeNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error)
- func ValidateNginxFieldExists(conf *Payload, expFieldCfg ExpectedNginxField) error
- func WriteContent(resultsFile *os.File, content string) error
- func WriteMetricsResults(resultsFile *os.File, metrics *Metrics) error
- func WritePrometheusMatrixToCSVFile(fileName string, value model.Value) error
- func WriteSystemInfoToFile(file *os.File, ci ClusterInfo, plus bool) error
- type Bucket
- func GetEventsBuckets(promInstance PrometheusInstance, ngfPodName string) ([]Bucket, error)
- func GetEventsBucketsWithStartTime(promInstance PrometheusInstance, ngfPodName string, startTime time.Time) ([]Bucket, error)
- func GetReloadBuckets(promInstance PrometheusInstance, ngfPodName string) ([]Bucket, error)
- func GetReloadBucketsWithStartTime(promInstance PrometheusInstance, ngfPodName string, startTime time.Time) ([]Bucket, error)
- type ClusterInfo
- type Config
- type Directive
- type Directives
- type ExpectedNginxField
- type InstallationConfig
- type LoadTestConfig
- type Metrics
- type Payload
- type PrometheusConfig
- type PrometheusInstance
- func (ins *PrometheusInstance) PortForward(config *rest.Config, stopCh <-chan struct{}) error
- func (ins *PrometheusInstance) Query(query string) (model.Value, error)
- func (ins *PrometheusInstance) QueryRange(query string, promRange v1.Range) (model.Value, error)
- func (ins *PrometheusInstance) QueryRangeWithCtx(ctx context.Context, query string, promRange v1.Range) (model.Value, error)
- func (ins *PrometheusInstance) QueryWithCtx(ctx context.Context, query string) (model.Value, error)
- type ResourceManager
- func (rm *ResourceManager) Apply(resources []client.Object) error
- func (rm *ResourceManager) ApplyFromBuffer(buffer *bytes.Buffer, namespace string) error
- func (rm *ResourceManager) ApplyFromFiles(files []string, namespace string) error
- func (rm *ResourceManager) Delete(resources []client.Object, opts ...client.DeleteOption) error
- func (rm *ResourceManager) DeleteFromFiles(files []string, namespace string) error
- func (rm *ResourceManager) DeleteNamespace(name string) error
- func (rm *ResourceManager) GetClusterInfo() (ClusterInfo, error)
- func (rm *ResourceManager) GetEvents(namespace string) (*core.EventList, error)
- func (rm *ResourceManager) GetFileContents(file string) (*bytes.Buffer, error)
- func (rm *ResourceManager) GetLBIPAddress(namespace string) (string, error)
- func (rm *ResourceManager) GetNGFDeployment(namespace, releaseName string) (*apps.Deployment, error)
- func (rm *ResourceManager) GetNginxConfig(ngfPodName, namespace string) (*Payload, error)
- func (rm *ResourceManager) GetPod(namespace, name string) (*core.Pod, error)
- func (rm *ResourceManager) GetPodLogs(namespace, name string, opts *core.PodLogOptions) (string, error)
- func (rm *ResourceManager) GetPodNames(namespace string, labels client.MatchingLabels) ([]string, error)
- func (rm *ResourceManager) GetPods(namespace string, labels client.MatchingLabels) ([]core.Pod, error)
- func (rm *ResourceManager) ScaleDeployment(namespace, name string, replicas int32) error
- func (rm *ResourceManager) WaitForAppsToBeReady(namespace string) error
- func (rm *ResourceManager) WaitForAppsToBeReadyWithCtx(ctx context.Context, namespace string) error
- func (rm *ResourceManager) WaitForAppsToBeReadyWithCtxWithPodCount(ctx context.Context, namespace string, podCount int) error
- func (rm *ResourceManager) WaitForAppsToBeReadyWithPodCount(namespace string, podCount int) error
- func (rm *ResourceManager) WaitForGatewayObservedGeneration(ctx context.Context, namespace, name string, generation int) error
- func (rm *ResourceManager) WaitForPodsToBeReady(ctx context.Context, namespace string) error
- func (rm *ResourceManager) WaitForPodsToBeReadyWithCount(ctx context.Context, namespace string, count int) error
- type ScaleObjects
- type Target
- type TimeoutConfig
Constants ¶
const (
CollectorNamespace = "collector"
)
const (
PlusSecretName = "nplus-license"
)
const (
// PrometheusPortForwardPort is the local port that will forward to the Prometheus API.
PrometheusPortForwardPort = 9090
)
Variables ¶
This section is empty.
Functions ¶
func CreateEndTimeFinder ¶
func CreateEndTimeFinder( promInstance PrometheusInstance, query string, startTime time.Time, endTime *time.Time, queryRangeStep time.Duration, ) func() error
CreateEndTimeFinder returns a function that will range query Prometheus given a specific startTime and endTime and adjust the endTime if there is no result found.
func CreateLicenseSecret ¶
CreateLicenseSecret creates the NGINX Plus JWT secret.
func CreateMetricExistChecker ¶
func CreateMetricExistChecker( promInstance PrometheusInstance, query string, getTime func() time.Time, modifyTime func(), ) func() error
CreateMetricExistChecker returns a function that will query Prometheus at a specific timestamp and adjust that timestamp if there is no result found.
func CreateResponseChecker ¶
CreateResponseChecker returns a function that checks if there is a successful response from a url.
func CreateResultsDir ¶
CreateResultsDir creates and returns the name of the results directory for a test.
func CreateResultsFile ¶
CreateResultsFile creates and returns the results file for a test.
func CreateResultsFilename ¶
CreateResultsFilename returns the name of the results file.
func GenerateCPUPNG ¶
GenerateCPUPNG generates a CPU usage PNG using gnuplot.
func GenerateMemoryPNG ¶
GenerateMemoryPNG generates a Memory usage PNG using gnuplot.
func GenerateRequestsPNG ¶
GenerateRequestsPNG generates a Requests PNG using gnuplot.
func GenerateTTRPNG ¶
GenerateTTRPNG generates a TTR PNG using gnuplot.
func Get ¶
Get sends a GET request to the specified url. It resolves to the specified address instead of using DNS. The status and body of the response is returned, or an error.
func GetBuildInfo ¶
GetBuildInfo returns the build information.
func GetCollectorPodName ¶
func GetCollectorPodName(resourceManager ResourceManager) (string, error)
GetCollectorPodName returns the name of the collector Pod.
func GetEvents ¶
func GetEvents(rm ResourceManager, namespace string) string
GetEvents returns the events for a namespace.
func GetEventsAvgTime ¶
func GetEventsAvgTime(promInstance PrometheusInstance, ngfPodName string) (float64, error)
GetEventsAvgTime gets the average time in milliseconds it takes for NGF to process a single event batch.
func GetEventsAvgTimeWithStartTime ¶
func GetEventsAvgTimeWithStartTime( promInstance PrometheusInstance, ngfPodName string, startTime time.Time, ) (float64, error)
GetEventsAvgTimeWithStartTime gets the average time in milliseconds it takes for NGF to process a single event batch using a start time to the current time to calculate.
func GetEventsCount ¶
func GetEventsCount(promInstance PrometheusInstance, ngfPodName string) (float64, error)
GetEventsCount gets the NGF event batch processing count.
func GetEventsCountWithStartTime ¶
func GetEventsCountWithStartTime( promInstance PrometheusInstance, ngfPodName string, startTime time.Time, ) (float64, error)
GetEventsCountWithStartTime gets the NGF event batch processing count from a start time to the current time.
func GetFirstValueOfPrometheusVector ¶
GetFirstValueOfPrometheusVector returns the first value of a Prometheus vector.
func GetLogs ¶
func GetLogs(rm ResourceManager, namespace string, releaseName string) string
GetLogs returns the logs for all containers in all pods for a release.
func GetReadyNGFPodNames ¶
func GetReadyNGFPodNames( k8sClient client.Client, namespace, releaseName string, timeout time.Duration, ) ([]string, error)
GetReadyNGFPodNames returns the name(s) of the NGF Pod(s).
func GetReloadAvgTime ¶
func GetReloadAvgTime(promInstance PrometheusInstance, ngfPodName string) (float64, error)
GetReloadAvgTime gets the average time in milliseconds for nginx to reload.
func GetReloadAvgTimeWithStartTime ¶
func GetReloadAvgTimeWithStartTime( promInstance PrometheusInstance, ngfPodName string, startTime time.Time, ) (float64, error)
GetReloadAvgTimeWithStartTime gets the average time in milliseconds for nginx to reload using a start time to the current time to calculate.
func GetReloadCount ¶
func GetReloadCount(promInstance PrometheusInstance, ngfPodName string) (float64, error)
GetReloadCount gets the total number of nginx reloads.
func GetReloadCountWithStartTime ¶
func GetReloadCountWithStartTime( promInstance PrometheusInstance, ngfPodName string, startTime time.Time, ) (float64, error)
GetReloadCountWithStartTime gets the total number of nginx reloads from a start time to the current time.
func GetReloadErrsCountWithStartTime ¶
func GetReloadErrsCountWithStartTime( promInstance PrometheusInstance, ngfPodName string, startTime time.Time, ) (float64, error)
GetReloadErrsCountWithStartTime gets the total number of nginx reload errors from a start time to the current time.
func InstallCollector ¶
InstallCollector installs the otel-collector.
func InstallGatewayAPI ¶
InstallGatewayAPI installs the specified version of the Gateway API resources.
func InstallNGF ¶
func InstallNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error)
InstallNGF installs NGF.
func NewCSVResultsWriter ¶
func NewCSVResultsWriter(resultsDir, fileName string, resultHeaders ...string) (*os.File, *csv.Writer, error)
NewCSVResultsWriter creates and returns a CSV results file and writer.
func NewVegetaCSVEncoder ¶
NewVegetaCSVEncoder returns a vegeta CSV encoder.
func PortForward ¶
func PortForward(config *rest.Config, namespace, podName string, ports []string, stopCh <-chan struct{}) error
PortForward starts a port-forward to the specified Pod.
func Post ¶
Post sends a POST request to the specified url with the body as the payload. It resolves to the specified address instead of using DNS.
func UninstallCollector ¶
func UninstallCollector(resourceManager ResourceManager) ([]byte, error)
UninstallCollector uninstalls the otel-collector.
func UninstallGatewayAPI ¶
UninstallGatewayAPI uninstalls the specified version of the Gateway API resources.
func UninstallNGF ¶
func UninstallNGF(cfg InstallationConfig, k8sClient client.Client) ([]byte, error)
UninstallNGF uninstalls NGF.
func UninstallPrometheus ¶
func UninstallPrometheus(rm ResourceManager) error
UninstallPrometheus uninstalls Prometheus from the cluster.
func UpgradeNGF ¶
func UpgradeNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error)
UpgradeNGF upgrades NGF. CRD upgrades assume the chart is local.
func ValidateNginxFieldExists ¶
func ValidateNginxFieldExists(conf *Payload, expFieldCfg ExpectedNginxField) error
ValidateNginxFieldExists accepts the nginx config and the configuration for the expected field, and returns whether or not that field exists where it should.
func WriteContent ¶
WriteContent writes basic content to the results file.
func WriteMetricsResults ¶
WriteMetricsResults writes the metrics results to the results file in text format.
func WritePrometheusMatrixToCSVFile ¶
WritePrometheusMatrixToCSVFile writes a Prometheus matrix to a CSV file.
func WriteSystemInfoToFile ¶
func WriteSystemInfoToFile(file *os.File, ci ClusterInfo, plus bool) error
WriteSystemInfoToFile writes the cluster system info to the given file.
Types ¶
type Bucket ¶
type Bucket struct { // Le is the interval Less than or Equal which represents the Bucket's bin. i.e. "500ms". Le string // Val is the value for how many instances fall in the Bucket. Val int }
Bucket represents a data point of a Histogram Bucket.
func GetEventsBuckets ¶
func GetEventsBuckets(promInstance PrometheusInstance, ngfPodName string) ([]Bucket, error)
GetEventsBuckets gets the Buckets in millisecond intervals for NGF event batch processing.
func GetEventsBucketsWithStartTime ¶
func GetEventsBucketsWithStartTime( promInstance PrometheusInstance, ngfPodName string, startTime time.Time, ) ([]Bucket, error)
GetEventsBucketsWithStartTime gets the Buckets in millisecond intervals for NGF event batch processing from a start time to the current time.
func GetReloadBuckets ¶
func GetReloadBuckets(promInstance PrometheusInstance, ngfPodName string) ([]Bucket, error)
GetReloadBuckets gets the Buckets in millisecond intervals for nginx reloads.
func GetReloadBucketsWithStartTime ¶
func GetReloadBucketsWithStartTime( promInstance PrometheusInstance, ngfPodName string, startTime time.Time, ) ([]Bucket, error)
GetReloadBucketsWithStartTime gets the Buckets in millisecond intervals for nginx reloads from a start time to the current time.
type ClusterInfo ¶
type ClusterInfo struct { K8sVersion string // ID is the UID of kube-system namespace ID string MemoryPerNode string GkeInstanceType string GkeZone string NodeCount int CPUCountPerNode int64 MaxPodsPerNode int64 IsGKE bool }
ClusterInfo holds the cluster metadata.
type Config ¶
type Config struct { File string `json:"file"` Parsed Directives `json:"parsed"` }
type Directives ¶
type Directives []*Directive
type ExpectedNginxField ¶
type ExpectedNginxField struct { // Directive is the directive name. Directive string // Value is the value for the directive. Can be the full value or a substring. If it's a substring, // then ValueSubstringAllowed should be true. Value string // File is the file name that should contain the directive. Can be a full filename or a substring. File string // Location is the location name that the directive should exist in. Location string // Server is the server name that the directive should exist in. Server string // Upstream is the upstream name that the directive should exist in. Upstream string // ValueSubstringAllowed allows the expected value to be a substring of the real value. // This makes it easier for cases when real values are complex file names or contain things we // don't care about, and we just want to check if a substring exists. ValueSubstringAllowed bool }
ExpectedNginxField contains an nginx directive key and value, and the expected file, server, and location block that it should exist in.
type InstallationConfig ¶
type InstallationConfig struct { ReleaseName string Namespace string ChartPath string ChartVersion string NgfImageRepository string NginxImageRepository string ImageTag string ImagePullPolicy string ServiceType string PlusUsageEndpoint string Plus bool IsGKEInternalLB bool Telemetry bool }
InstallationConfig contains the configuration for the NGF installation.
type LoadTestConfig ¶
type LoadTestConfig struct { Description string Proxy string ServerName string Targets []Target Rate int Duration time.Duration }
LoadTestConfig is the configuration to run a load test.
type Metrics ¶
Metrics is a wrapper around the vegeta Metrics.
func RunLoadTest ¶
func RunLoadTest(cfg LoadTestConfig) (vegeta.Results, Metrics)
RunLoadTest uses Vegeta to send traffic to the provided Targets at the given rate for the given duration and writes the results to the provided file.
type Payload ¶
type Payload struct {
Config []Config `json:"config"`
}
The following types are copied from https://github.com/nginxinc/nginx-go-crossplane, with unnecessary fields stripped out.
type PrometheusConfig ¶
type PrometheusConfig struct { // ScrapeInterval is the interval at which Prometheus scrapes metrics. ScrapeInterval time.Duration // QueryTimeout is the timeout for Prometheus queries. // Default is 2s. QueryTimeout time.Duration }
PrometheusConfig is the configuration for installing Prometheus.
type PrometheusInstance ¶
type PrometheusInstance struct {
// contains filtered or unexported fields
}
PrometheusInstance represents a Prometheus instance in the cluster.
func InstallPrometheus ¶
func InstallPrometheus( rm ResourceManager, cfg PrometheusConfig, ) (PrometheusInstance, error)
InstallPrometheus installs Prometheus in the cluster. It waits for Prometheus pods to be ready before returning.
func (*PrometheusInstance) PortForward ¶
func (ins *PrometheusInstance) PortForward(config *rest.Config, stopCh <-chan struct{}) error
PortForward starts port forwarding to the Prometheus instance.
func (*PrometheusInstance) Query ¶
func (ins *PrometheusInstance) Query(query string) (model.Value, error)
Query sends a query to Prometheus.
func (*PrometheusInstance) QueryRange ¶
QueryRange sends a range query to Prometheus.
func (*PrometheusInstance) QueryRangeWithCtx ¶
func (ins *PrometheusInstance) QueryRangeWithCtx(ctx context.Context, query string, promRange v1.Range, ) (model.Value, error)
QueryRangeWithCtx sends a range query to Prometheus with the specified context.
func (*PrometheusInstance) QueryWithCtx ¶
QueryWithCtx sends a query to Prometheus with the specified context.
type ResourceManager ¶
type ResourceManager struct { K8sClient client.Client ClientGoClient kubernetes.Interface // used when k8sClient is not enough K8sConfig *rest.Config FS embed.FS TimeoutConfig TimeoutConfig }
ResourceManager handles creating/updating/deleting Kubernetes resources.
func (*ResourceManager) Apply ¶
func (rm *ResourceManager) Apply(resources []client.Object) error
Apply creates or updates Kubernetes resources defined as Go objects.
func (*ResourceManager) ApplyFromBuffer ¶
func (rm *ResourceManager) ApplyFromBuffer(buffer *bytes.Buffer, namespace string) error
func (*ResourceManager) ApplyFromFiles ¶
func (rm *ResourceManager) ApplyFromFiles(files []string, namespace string) error
ApplyFromFiles creates or updates Kubernetes resources defined within the provided YAML files.
func (*ResourceManager) Delete ¶
func (rm *ResourceManager) Delete(resources []client.Object, opts ...client.DeleteOption) error
Delete deletes Kubernetes resources defined as Go objects.
func (*ResourceManager) DeleteFromFiles ¶
func (rm *ResourceManager) DeleteFromFiles(files []string, namespace string) error
DeleteFromFiles deletes Kubernetes resources defined within the provided YAML files.
func (*ResourceManager) DeleteNamespace ¶
func (rm *ResourceManager) DeleteNamespace(name string) error
func (*ResourceManager) GetClusterInfo ¶
func (rm *ResourceManager) GetClusterInfo() (ClusterInfo, error)
GetClusterInfo retrieves node info and Kubernetes version from the cluster.
func (*ResourceManager) GetEvents ¶
func (rm *ResourceManager) GetEvents(namespace string) (*core.EventList, error)
GetEvents returns all Events in the specified namespace.
func (*ResourceManager) GetFileContents ¶
func (rm *ResourceManager) GetFileContents(file string) (*bytes.Buffer, error)
GetFileContents takes a string that can either be a local file path or an https:// URL to YAML manifests and provides the contents.
func (*ResourceManager) GetLBIPAddress ¶
func (rm *ResourceManager) GetLBIPAddress(namespace string) (string, error)
GetLBIPAddress gets the IP or Hostname from the Loadbalancer service.
func (*ResourceManager) GetNGFDeployment ¶
func (rm *ResourceManager) GetNGFDeployment(namespace, releaseName string) (*apps.Deployment, error)
GetNGFDeployment returns the NGF Deployment in the specified namespace with the given release name.
func (*ResourceManager) GetNginxConfig ¶
func (rm *ResourceManager) GetNginxConfig(ngfPodName, namespace string) (*Payload, error)
GetNginxConfig uses crossplane to get the nginx configuration and convert it to JSON.
func (*ResourceManager) GetPod ¶
func (rm *ResourceManager) GetPod(namespace, name string) (*core.Pod, error)
GetPod returns the Pod in the specified namespace with the given name.
func (*ResourceManager) GetPodLogs ¶
func (rm *ResourceManager) GetPodLogs(namespace, name string, opts *core.PodLogOptions) (string, error)
GetPodLogs returns the logs from the specified Pod.
func (*ResourceManager) GetPodNames ¶
func (rm *ResourceManager) GetPodNames(namespace string, labels client.MatchingLabels) ([]string, error)
GetPodNames returns the names of all Pods in the specified namespace that match the given labels.
func (*ResourceManager) GetPods ¶
func (rm *ResourceManager) GetPods(namespace string, labels client.MatchingLabels) ([]core.Pod, error)
GetPods returns all Pods in the specified namespace that match the given labels.
func (*ResourceManager) ScaleDeployment ¶
func (rm *ResourceManager) ScaleDeployment(namespace, name string, replicas int32) error
ScaleDeployment scales the Deployment to the specified number of replicas.
func (*ResourceManager) WaitForAppsToBeReady ¶
func (rm *ResourceManager) WaitForAppsToBeReady(namespace string) error
WaitForAppsToBeReady waits for all apps in the specified namespace to be ready, or until the ctx timeout is reached.
func (*ResourceManager) WaitForAppsToBeReadyWithCtx ¶
func (rm *ResourceManager) WaitForAppsToBeReadyWithCtx(ctx context.Context, namespace string) error
WaitForAppsToBeReadyWithCtx waits for all apps in the specified namespace to be ready or until the provided context is canceled.
func (*ResourceManager) WaitForAppsToBeReadyWithCtxWithPodCount ¶
func (*ResourceManager) WaitForAppsToBeReadyWithPodCount ¶
func (rm *ResourceManager) WaitForAppsToBeReadyWithPodCount(namespace string, podCount int) error
func (*ResourceManager) WaitForGatewayObservedGeneration ¶
func (rm *ResourceManager) WaitForGatewayObservedGeneration( ctx context.Context, namespace, name string, generation int, ) error
WaitForGatewayObservedGeneration waits for the provided Gateway's ObservedGeneration to equal the expected value.
func (*ResourceManager) WaitForPodsToBeReady ¶
func (rm *ResourceManager) WaitForPodsToBeReady(ctx context.Context, namespace string) error
WaitForPodsToBeReady waits for all Pods in the specified namespace to be ready or until the provided context is canceled.
func (*ResourceManager) WaitForPodsToBeReadyWithCount ¶
func (rm *ResourceManager) WaitForPodsToBeReadyWithCount(ctx context.Context, namespace string, count int) error
WaitForPodsToBeReady waits for all Pods in the specified namespace to be ready or until the provided context is canceled.
type ScaleObjects ¶
type ScaleObjects struct { // BaseObjects contains objects that are common to all scale iterations. BaseObjects []client.Object // ScaleIterationGroups contains objects for each scale iteration. ScaleIterationGroups [][]client.Object }
ScaleObjects contains objects for scale testing.
func GenerateScaleHTTPRouteObjects ¶
func GenerateScaleHTTPRouteObjects(numRoutes int) (ScaleObjects, error)
GenerateScaleHTTPRouteObjects generates objects for a given number of routes for the scale test.
func GenerateScaleListenerObjects ¶
func GenerateScaleListenerObjects(numListeners int, tls bool) (ScaleObjects, error)
GenerateScaleListenerObjects generates objects for a given number of listeners for the scale test.
type TimeoutConfig ¶
type TimeoutConfig struct { // CreateTimeout represents the maximum time for a Kubernetes object to be created. CreateTimeout time.Duration // UpdateTimeout represents the maximum time for a Kubernetes object to be updated. UpdateTimeout time.Duration // DeleteTimeout represents the maximum time for a Kubernetes object to be deleted. DeleteTimeout time.Duration // DeleteNamespaceTimeout represents the maximum time for a Kubernetes namespace to be deleted. DeleteNamespaceTimeout time.Duration // GetTimeout represents the maximum time to get a Kubernetes object. GetTimeout time.Duration // ManifestFetchTimeout represents the maximum time for getting content from a https:// URL. ManifestFetchTimeout time.Duration // RequestTimeout represents the maximum time for making an HTTP Request with the roundtripper. RequestTimeout time.Duration // ContainerRestartTimeout represents the maximum time for a Kubernetes Container to restart. ContainerRestartTimeout time.Duration // GetLeaderLeaseTimeout represents the maximum time for NGF to retrieve the leader lease. GetLeaderLeaseTimeout time.Duration // GetStatusTimeout represents the maximum time for NGF to update the status of a resource. GetStatusTimeout time.Duration // TestForTrafficTimeout represents the maximum time for NGF to test for passing or failing traffic. TestForTrafficTimeout time.Duration }
func DefaultTimeoutConfig ¶
func DefaultTimeoutConfig() TimeoutConfig
DefaultTimeoutConfig populates a TimeoutConfig with the default values.