kubernetes-testing-framework

module
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2021 License: Apache-2.0

README

ktf-banner

tests codecov Go Report Card GoDoc License

Kong Kubernetes Testing Framework (KTF)

Testing framework used by the Kong Kubernetes Team for the Kong Kubernetes Ingress Controller (KIC).

Requirements

  • Go v1.16.x+

Usage

The following are some of the available features of the KTF:

  • integration testing libraries for Kong on Kubernetes (Golang)
  • unit testing libraries for the Kong Proxy (Golang)
  • command line tool for testing environments and other testing features

For the integration testing libraries you have the option to deploy the Kong Proxy only to the Kubernetes cluster or to deploy the entire stack depending on your testing needs.

Command Line Tool

This project provides a command line tool ktf which can be used for reason such as building and maintaining a testing environment for Kong on Kubernetes.

Install

If you have Golang installed locally you can install with go:

$ go install github.com/kong/kubernetes-testing-framework/cmd/ktf@latest

Otherwise you can use the shell script to install the latest release for your operating system:

$ curl --proto '=https' -sSf https://kong.github.io/kubernetes-testing-framework/install.sh | sh
Testing Environments

You can deploy a testing environment with the following command:

$ ktf environments create --generate-name

And it can be torn down with this command:

$ ktf environments delete --name <NAME>
Examples

The most common use cases will require some addon applications to be deployed to the cluster, particular actually deploying the Kong Proxy itself.

You can deploy a cluster with the Kong proxy already deployed and accessible via LoadBalancer services by running the following:

$ ktf environments create --name kong-proxy-testing --addon metallb --addon kong

Once the cluster is up configure your kubectl to use it:

$ kubectl cluster-info --context kind-kong-proxy-testing

You can see the IP addresses where you can reach the proxy and the Admin API with:

$ kubectl -n kong-system get services

Contributing

See CONTRIBUTING.md.

Community

If you have any questions about this tool and want to get in touch with the maintainers, check in on #kong in Kubernetes Slack.

Directories

Path Synopsis
cmd
ktf
internal
ci/workflows
Package main is a tool to trigger Github actions workflows Examples Trigger an integration test workflow for a custom branch: $ go run internal/ci/release/main.go tests.yaml batman SUCCESS: the test.yaml workflow has been triggered for batman Trigger a release testing workflow: $ go run internal/ci/release/main.go release-testing.yaml <ref> <tag> SUCCESS: the release-testing.yaml workflow has been triggered for <ref> Tag in this case is the tag that you want the release-testing.yaml workflow to create and push to the remote upon success (e.g.
Package main is a tool to trigger Github actions workflows Examples Trigger an integration test workflow for a custom branch: $ go run internal/ci/release/main.go tests.yaml batman SUCCESS: the test.yaml workflow has been triggered for batman Trigger a release testing workflow: $ go run internal/ci/release/main.go release-testing.yaml <ref> <tag> SUCCESS: the release-testing.yaml workflow has been triggered for <ref> Tag in this case is the tag that you want the release-testing.yaml workflow to create and push to the remote upon success (e.g.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL