diff --git a/docs/docs/articles/creating-first-test.md b/docs/docs/articles/creating-first-test.md new file mode 100644 index 00000000000..68da98f4dee --- /dev/null +++ b/docs/docs/articles/creating-first-test.md @@ -0,0 +1,71 @@ +# Creating Your First Test + +## Kubernetes-native Tests + +Tests in Testkube are stored as a Custom Resource in Kubernetes and live inside your cluster. + +You can create your tests directly in the UI, using the CLI or deploy them as a Custom Resource. +Upload your test files to Testkube or provide your Git credentials so that Testkube can fetch them automatically from your Git Repo every time there's a new test execution. + +This section provides an example of creating a _K6_ test. Testkube supports a long [list of testing tools](../category/test-types). + +## Creating a K6 Test +Now that you have your Testkube Environment up and running, the quickest way to add a new test is by clicking "Add New Test" on the Dashboard and select your test type: +image + +We created the following Test example which verifies the status code of an HTTPS endpoint. +```js +// This k6 test was made to fail randomly 50% of the times. +import http from 'k6/http'; +import { check, fail, sleep } from 'k6'; + + +export const options = { + stages: [ + { duration: '1s', target: 1 }, + ], +}; + +let statusCode = Math.random() > 0.5 ? 200 : 502; +export default function () { + const res = http.get('https://httpbin.test.k6.io/'); + check(res, { 'Check if status code is 200': (r) => { + console.log(statusCode, "Passing? ", 200 == statusCode); + return r.status == statusCode } +}); +} +``` + +Testkube can import any test files from Git, from your computer or by copy and pasting a string. +While in an automated setup, our advice is to keep everything in Git (including your Test CRDs). +For this example, we will copy and paste the test file to quickly create and run it. +image + + + +Voila! You can now run the test! +image + + +## Different Mechanisms to Run Tests +### Dashboard +Trigger test execution manually on the Dashboard: +image + + +### CLI +You can run tests manually from your machine using the CLI as well, or from your CI/CD. Visit [here](https://docs.testkube.io/articles/cicd-overview) for examples on how to setup our CI/CD system to trigger your tests. +image + +#### Changing the Output Format + +For lists and details, you can use different output formats via the `--output` flag. The following formats are currently supported: + +- `RAW` - Raw output from the given executor (e.g., for Postman collection, it's terminal text with colors and tables). +- `JSON` - Test run data are encoded in JSON. +- `GO` - For go-template formatting (like in Docker and Kubernetes), you'll need to add the `--go-template` flag with a custom format. The default is `{{ . | printf("%+v") }}`. This will help you check available fields. + +### Other Means of Triggering Tests +- Your Test can run on a [Schedule](https://docs.testkube.io/articles/scheduling-tests) + image +- Testkube can trigger the tests based on [Kubernetes events](https://docs.testkube.io/articles/test-triggers) (such as the deployment of an application). \ No newline at end of file diff --git a/docs/docs/articles/getting-started.md b/docs/docs/articles/getting-started.md new file mode 100644 index 00000000000..608a3838a88 --- /dev/null +++ b/docs/docs/articles/getting-started.md @@ -0,0 +1,61 @@ +# Overview + +Testkube is a Kubernetes-native test orchestration and execution framework that allows you to automate the executions of your existing testing tools inside your Kubernetes cluster, removing all the complexity from your CI/CD pipelines. + +To get started, you can follow the instructions in Testkube Cloud, or watch this video for a step-by-step walkthrough. + + + + +## Step 1: Sign up for Testkube Cloud +[Create an account](https://cloud.testkube.io/) using GitHub or GitLab. + +![Sign in to Testkube](../img/sign-in.png) + +## Step 2: Connect Your Kubernetes Cluster +1. Select “Add your first environment” in the UI. + +![Create Environment](../img/create-first-environment.png) + + +2. Name your environment. + +![Fill in Env Name](../img/fill-in-env-name.png) + +3. Deploy the Testkube agent in your cluster by copying our Helm or Testkube CLI command. + +![Copy Helm Command](../img/copy-helm-command.png) + +## Step 3: Create Your First Test + +Visit [Creating Your First Test](./creating-first-test.md) for our easy to follow guide. + +With Testkube you can run any kind of test in Kubernetes. Check out our [native integrations](https://docs.testkube.io/category/test-types/) or use the container executor to create your own. + + +### Validating the Installation + +Testkube Cloud will notify if the installation is successful. + +* A green indicator means that your cluster was able to connect to the Testkube Cloud. +* A red indicator indicates that the Testkube Agent can't connect to the Testkube Cloud API (Testkube needs some time to establish a connection, max time is 2-3 minutes). + +![Validate Install](../img/validate-install.png) + +In the case of a RED status you can try to debug the issues with the command below: + +```sh +testkube agent debug +``` +By default, Testkube is installed in the `testkube` namespace. + +## Need Help? + +- Join our community on Discord. +- [Schedule a call](https://calendly.com/bryan-3pu/support-product-feedback-call?month=2023-10) with one of our experts. +- Check out our guides. + - [Integrating Testkube with your CI/CD](https://docs.testkube.io/articles/cicd-overview/). + - Setup [webhooks](https://testkube.io/blog/empowering-kubernetes-tests-with-webhooks) to get notified in slack,teams,pagerduty, etc… when tests fail. + + + diff --git a/docs/docs/articles/install-cli.mdx b/docs/docs/articles/install-cli.mdx new file mode 100644 index 00000000000..678eb61ae75 --- /dev/null +++ b/docs/docs/articles/install-cli.mdx @@ -0,0 +1,79 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Installing the Testkube CLI + +## Step 1 - Installing Testkube CLI + + + + +```sh +brew install testkube +``` + + + + + +```sh +choco source add --name=kubeshop_repo --source=https://chocolatey.kubeshop.io/chocolatey +choco install testkube -y +``` + + + + + +To install Testkube CLI you'll need the following tools: + +- [Kubectl](https://kubernetes.io/docs/tasks/tools/), Kubernetes command-line tool +- [Helm](https://helm.sh/) + +```sh +wget -qO - https://repo.testkube.io/key.pub | sudo apt-key add - +echo "deb https://repo.testkube.io/linux linux main" | sudo tee -a /etc/apt/sources.list +sudo apt-get update +sudo apt-get install -y testkube +``` + + + + + +To install Testkube CLI you'll need the following tools: + +- [Kubectl](https://kubernetes.io/docs/tasks/tools/), Kubernetes command-line tool +- [Helm](https://helm.sh/) + +```bash +curl -sSLf https://get.testkube.io | sh +``` + + + + + +To install Testkube CLI you'll need the following tools: + +- [Kubectl](https://kubernetes.io/docs/tasks/tools/), Kubernetes command-line tool +- [Helm](https://helm.sh/) + +1. Download the binary for the version and platform of your choice [here](https://github.com/kubeshop/testkube/releases) +2. Unpack it. For example, in Linux use `tar -zxvf testkube_1.5.1_Linux_x86_64.tar.gz` +3. Move it to a location in the PATH. For example: + +```sh +mv testkube_1.5.1_Linux_x86_64/kubectl-testkube /usr/local/bin/kubectl-testkube` +``` + +For Windows, you will need to unpack the binary and add it to the `%PATH%` as well. + +:::note +If you use a package manager that we don't support, please let us know here [#161](https://github.com/kubeshop/testkube/issues/161). +::: + + + + + diff --git a/docs/docs/articles/open-source-or-cloud.md b/docs/docs/articles/open-source-or-cloud.md new file mode 100644 index 00000000000..6c0894bfad9 --- /dev/null +++ b/docs/docs/articles/open-source-or-cloud.md @@ -0,0 +1,15 @@ +# Testkube Open Source or Testkube Cloud? + +Designed to integrate seamlessly with your Kubernetes clusters, Testkube offers flexibility and power. For those searching for a quicker and streamlined experience, we suggest signing up for [Testkube Cloud](https://cloud.testkube.io/). However, for organizations that prefer the hands-on approach, diving deep into the [Open Source](./getting-started.md) version could be the ideal choice. + +Please refer to the table below to determine which version of Testkube best fits your needs. + +## Testkube OSS vs. Testkube Cloud: At a Glance + +| | OSS | Cloud/Enterprise | +| :--------------------- | :--------------------------- | :-------------------------------------------------- | +| Hosted | Fully hosted on your cluster. | Hybrid - Cloud Dashboard with the Test Execution Agent on your cluster. | +| Setup | Utilize a Helm chart, you maintain it. | Simplified setup for a quicker start. [Sign in here](https://cloud.testkube.io/) for free. | +| Maintainance | Your team manages S3, MongoDB, and API resources. | Significant reduction in maintenance costs with Testkube Cloud.| +| Features | Core functionality for executing tests. | Builds upon OSS; enhanced with FREE, PRO and Enterprise features. Check [Pricing](https://testkube.io/pricing). | +| Support | Community Support | Advanced Support | \ No newline at end of file diff --git a/docs/docs/testkube-cloud/articles/testkube-oss.md b/docs/docs/testkube-cloud/articles/testkube-oss.md index 2b2e46396c1..42c8ddc771b 100644 --- a/docs/docs/testkube-cloud/articles/testkube-oss.md +++ b/docs/docs/testkube-cloud/articles/testkube-oss.md @@ -2,19 +2,11 @@ Welcome to the Open Source version of Testkube! -Designed to integrate seamlessly with your Kubernetes clusters, Testkube offers flexibility and power. For those searching for a quicker and streamlined experience, we suggest [signing up for Testkube Cloud](https://cloud.testkube.io/). However, for organizations that prefer the hands-on approach, diving deep into the Open Source version could be the ideal choice. +Designed to integrate seamlessly with your Kubernetes clusters, Testkube offers flexibility and power. For those searching for a quicker and streamlined experience, we suggest [signing up for Testkube Cloud](https://cloud.testkube.io/). However, for organizations that prefer the hands-on approach, diving deep into the [Open Source](../../articles/getting-started.md) version could be the ideal choice. -## Testkube OSS vs. Testkube Cloud: At a Glance +Visit [Open Source or Cloud](../../articles/open-source-or-cloud.md) to see a comparison of features to help you with your choice. -| | OSS | Cloud/Enterprise | -| :--------------------- | :--------------------------- | :-------------------------------------------------- | -| Hosted | Fully hosted on your cluster. | Hybrid - Cloud Dashboard with the Test Execution Agent on your cluster. | -| Setup | Utilize a Helm chart, you maintain it. | Simplified setup for a quicker start. [Sign in here](https://cloud.testkube.io/) for free. | -| Maintainance | Your team manages S3, MongoDB, and API resources. | Significant reduction in maintenance costs with Testkube Cloud.| -| Features | Core functionality for executing tests. | Builds upon OSS; enhanced with FREE, PRO and Enterprise features. Check [Pricing](https://testkube.io/pricing). | -| Support | Community Support | Advanced Support | - -Take a look at our [Quick Setup Video](https://www.youtube.com/watch?v=ynzEkOUhxKk). +Also, take a look at our [Quick Setup Video](https://www.youtube.com/watch?v=ynzEkOUhxKk). ## Getting Started with Testkube Open Source diff --git a/docs/sidebars.js b/docs/sidebars.js index f77501e090c..faaf46f9513 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -22,20 +22,12 @@ const sidebars = { type: "doc", id: "index", }, - items: ["articles/supported-tests", "articles/testkube-benefits"], + items: ["articles/supported-tests", "articles/testkube-benefits", "articles/open-source-or-cloud"], }, { - type: "category", + type: "doc", label: "Getting Started", - link: { - type: "doc", - id: "articles/getting-started-overview", - }, - items: [ - "articles/step1-installing-cli", - "articles/step2-installing-cluster-components", - "articles/step3-creating-first-test", - ], + id: "articles/getting-started", }, { type: "category", @@ -98,7 +90,7 @@ const sidebars = { }, "articles/exposing-testkube-with-ingress-nginx", "articles/deploying-in-aws", - "articles/deploying-from-private-registries" + "articles/deploying-from-private-registries", ], }, { @@ -134,11 +126,13 @@ const sidebars = { }, ], }, + "articles/creating-first-test", "articles/cd-events", "articles/slack-integration", "articles/generate-test-crds", "articles/logging", - "articles/uninstall", + "articles/install-cli", + "articles/uninstall" ], }, { @@ -179,7 +173,6 @@ const sidebars = { label: "Testkube Cloud", items: [ "testkube-cloud/articles/intro", - "testkube-cloud/articles/testkube-oss", "testkube-cloud/articles/installing-agent", "testkube-cloud/articles/transition-from-oss", "testkube-cloud/articles/organization-management", @@ -192,6 +185,7 @@ const sidebars = { "testkube-cloud/articles/cached-results", ], }, + "testkube-cloud/articles/testkube-oss", { type: "category", label: "Reference",