Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Getting Started Rework #4523

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions docs/docs/articles/creating-first-test.md
Original file line number Diff line number Diff line change
@@ -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:
<img width="1896" alt="image" src="https://github.com/kubeshop/testkube/assets/13501228/683eae92-ef74-49c8-9db9-90da76fc17fc" />

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.
<img width="1896" alt="image" src="https://github.com/kubeshop/testkube/assets/13501228/cfb5d188-aaf6-4051-a44c-3859a23dd2a7" />



Voila! You can now run the test!
<img width="1896" alt="image" src="https://github.com/kubeshop/testkube/assets/13501228/e2d46e4f-641b-49b9-8a1f-f3b3100c4ad0" />


## Different Mechanisms to Run Tests
### Dashboard
Trigger test execution manually on the Dashboard:
<img width="1896" alt="image" src="https://github.com/kubeshop/testkube/assets/13501228/97fe3119-60a8-4b40-ac54-3f1fc625111f" />


### 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.
<img width="1896" alt="image" src="https://github.com/kubeshop/testkube/assets/13501228/6b5098d7-9b57-485d-8c5e-5f915f49d515" />

#### 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)
<img width="1896" alt="image" src="https://github.com/kubeshop/testkube/assets/13501228/aa3a1d87-e687-4364-9a8f-8bc8ffc73395" />
- Testkube can trigger the tests based on [Kubernetes events](https://docs.testkube.io/articles/test-triggers) (such as the deployment of an application).
61 changes: 61 additions & 0 deletions docs/docs/articles/getting-started.md
Original file line number Diff line number Diff line change
@@ -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.

<iframe width="100%" height="315" src="https://www.youtube.com/embed/YnR5yOO8C4s?si=3xdK77wcQVpJQrwt" title="YouTube Tutorial: Installing Testkube Cloud" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>


## 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.



79 changes: 79 additions & 0 deletions docs/docs/articles/install-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# Installing the Testkube CLI

## Step 1 - Installing Testkube CLI

<Tabs groupId="dashboard-cli">
<TabItem value="macos" label="MacOS" default>

```sh
brew install testkube
```

</TabItem>

<TabItem value="windows" label="Windows">

```sh
choco source add --name=kubeshop_repo --source=https://chocolatey.kubeshop.io/chocolatey
choco install testkube -y
```

</TabItem>

<TabItem value="ubuntu" label="Ubuntu">

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
```

</TabItem>

<TabItem value="script" label="Script">

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
```

</TabItem>

<TabItem value="manual" label="Manual Download">

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).
:::

</TabItem>

</Tabs>

15 changes: 15 additions & 0 deletions docs/docs/articles/open-source-or-cloud.md
Original file line number Diff line number Diff line change
@@ -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 |
14 changes: 3 additions & 11 deletions docs/docs/testkube-cloud/articles/testkube-oss.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 8 additions & 14 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
],
},
{
Expand Down Expand Up @@ -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"
],
},
{
Expand Down Expand Up @@ -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",
Expand All @@ -192,6 +185,7 @@ const sidebars = {
"testkube-cloud/articles/cached-results",
],
},
"testkube-cloud/articles/testkube-oss",
{
type: "category",
label: "Reference",
Expand Down
Loading