Skip to content

Latest commit

 

History

History
128 lines (95 loc) · 4.55 KB

DEVELOPMENT.md

File metadata and controls

128 lines (95 loc) · 4.55 KB

hydrophone

This document describes the process for running hydrophone on your local machine.

Getting Started

Prerequisites

Build

$ make build
go build -o bin/hydrophone main.go

Install

$ go install sigs.k8s.io/hydrophone@latest

Command line options

$ bin/hydrophone --help
Hydrophone is a lightweight runner for Kubernetes tests.

Usage:
  hydrophone [flags]

Flags:
      --busybox-image string        specify an alternate busybox container image. (default "registry.k8s.io/e2e-test-images/busybox:1.36.1-1")
      --cleanup                     cleanup resources (pods, namespaces etc).
  -c, --config string               path to an optional base configuration file.
      --conformance                 run conformance tests.
      --conformance-image string    specify a conformance container image of your choice.
      --continue                    connect to an already running conformance test pod.
      --dry-run                     run in dry run mode.
      --extra-args strings          Additional parameters to be provided to the conformance container. These parameters should be specified as key-value pairs, separated by commas. Each parameter should start with -- (e.g., --clean-start=true,--allowed-not-ready-nodes=2)
      --extra-ginkgo-args strings   Additional parameters to be provided to Ginkgo runner. This flag has the same format as --extra-args.
      --focus string                focus runs a specific e2e test. e.g. - sig-auth. allows regular expressions.
  -h, --help                        help for hydrophone
      --kubeconfig string           path to the kubeconfig file.
      --list-images                 list all images that will be used during conformance tests.
  -n, --namespace string            the namespace where the conformance pod is created. (default "conformance")
  -o, --output-dir string           directory for logs. (default ".")
  -p, --parallel int                number of parallel threads in test framework (automatically sets the --nodes Ginkgo flag). (default 1)
      --skip string                 skip specific tests. allows regular expressions.
      --startup-timeout duration    max time to wait for the conformance test pod to start up. (default 5m0s)
      --test-repo string            registry for pulling Kubernetes test images.
      --test-repo-list string       yaml file to override registries for test images.
  -v, --verbosity int               verbosity of test framework (values >= 6 automatically sets the -v Ginkgo flag). (default 4)

Configuration

hydrophone can be configured using solely the command line or by providing a configuration file. It's also possible to give both, in which case CLI arguments take priority to values loaded from a configuration file.

Configuration files are YAML and contain most of the CLI flags, with names camelCased:

busyboxImage: "..."
conformanceImage: "..."
dryRun: false
extraArgs:
  - "--example=flag"
  - "--enable-thing=true" # just "--enable-thing" would be invalid
extraGinkgoArgs: []
kubeconfig: "..."
namespace: "..."
outputDir: "..."
parallel: 1
skip: "..."
startupTimeout: 5m # must be a valid Go duration expression, like 5m or 30s
testRepo: "..."
testRepoList: "..."
verbosity: 4

The flags affecting the current run mode (--conformance, --focus, --cleanup and --list-images) are not part of the configuration file.

Run

Ensure there is a KUBECONFIG environment variable specified or $HOME/.kube/config file present before running hydrophone Alternatively, you can specify the path to the kubeconfig file with the --kubeconfig option.

To run conformance tests use:

$ bin/hydrophone --conformance

To run a specific test use:

$ bin/hydrophone --focus 'Simple pod should contain last line of the log'

To specify a version of conformance image use:

$ bin/hydrophone --conformance-image 'registry.k8s.io/conformance:v1.29.0'

Cleanup

Use hydrophone's --cleanup flag to remove the tests from your cluster again:

$ hydrophone --cleanup

Note that interrupted tests might leave behind namespaces, check with kubectl get namespaces for those ending with a numeric suffix like -NNNN and delete those as necessary.

Troubleshooting

Check if the Pod is running:

$ kubectl --namespace conformance get pods

Use kubectl logs or kubectl exec to see what is happening in the Pod.