Skip to content

Commit

Permalink
docs(install): update Helm and K8s guides (#4006)
Browse files Browse the repository at this point in the history
* docs(getting-started): update install

* docs(install): update k8s and helm

* docs(install): edit links and bullets

* docs(cicd): remove core gh actions

* docs(cicd): fix links
  • Loading branch information
adnanrahic authored Sep 4, 2024
1 parent 1a3b7b0 commit c082252
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 554 deletions.
507 changes: 0 additions & 507 deletions docs/docs/ci-cd-automation/github-actions-pipeline.mdx

This file was deleted.

1 change: 0 additions & 1 deletion docs/docs/ci-cd-automation/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This section contains a general overview of running Tracetest in CI/CD pipelines

You can find guides for:

- [GitHub Actions](/ci-cd-automation/github-actions-pipeline)
- [GitHub Actions with Secrets](/ci-cd-automation/github-actions-pipeline-with-secrets)
- [Testkube](/ci-cd-automation/testkube-pipeline)
- [Tekton](/ci-cd-automation/tekton-pipeline)
Expand Down
1 change: 0 additions & 1 deletion docs/docs/examples-tutorials/recipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ This integration point uses the OpenTelemetry Collector as a router to send trac

These guides show integrations with CI/CD tools.

- [GitHub Actions](/ci-cd-automation/github-actions-pipeline)
- [GitHub Actions with Secrets](/ci-cd-automation/github-actions-pipeline-with-secrets)
- [Testkube](/ci-cd-automation/testkube-pipeline)
- [Tekton](/ci-cd-automation/tekton-pipeline)
Expand Down
30 changes: 15 additions & 15 deletions docs/docs/getting-started/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,39 +217,39 @@ spec:

The Tracetest Agent is running in Kubernetes and ready to accept traces.

gRPC: `http://<service-name>:4317`
gRPC: `http://tracetest-agent.default.svc.cluster.local:4317`

HTTP: `http://<service-name>:4318/v1/traces`
HTTP: `http://tracetest-agent.default.svc.cluster.local:4318/v1/traces`

:::note K8s Network
Make sure to check use the correct `<service-name>` if you edit the Tracetest Agent `service` name.

Running a test against `localhost` will resolve as `127.0.0.1` inside the Tracetest Agent container.
Make sure to run tests using the internal Kubernetes service networking eg: `http://api.default.svc.cluster.internal:port`.
:::

</TabItem>
<TabItem value="helm" label="Helm">

Set the `<release-name>` and `<namespace>` to your desired values.

<CodeBlock
language="js"
title="Terminal"
>
{`helm repo add tracetestcloud https://kubeshop.github.io/tracetest-cloud-charts --force-update && \\
helm install <release-name> -n <namespace> tracetestcloud/tracetest-agent \\
helm install agent tracetestcloud/tracetest-agent \\
--set agent.apiKey=<TRACETEST_API_KEY> --set agent.environmentId=<TRACETEST_ENVIRONMENT_ID>`}
</CodeBlock>

The Tracetest Agent is running in Kubernetes and ready to accept traces.
The Tracetest Agent is running in Kubernetes and ready to accept traces. With this installation of using `agent` as the `<release-name>`, the trace ingestion endpoints will be:

gRPC: `http://<service-name>:4317`
gRPC: `http://agent-tracetest-agent:4317`

HTTP: `http://<service-name>:4318/v1/traces`
HTTP: `http://agent-tracetest-agent:4318/v1/traces`

:::note K8s Network
Running a test against `localhost` will resolve as `127.0.0.1` inside the Tracetest Agent container.
Make sure to run tests using the internal Kubernetes service networking eg: `http://api.default.svc.cluster.internal:port`.
Make sure to run tests using the internal Kubernetes service networking eg: `http://pokeshop-pokemon-api:8081`.
:::

</TabItem>
Expand Down Expand Up @@ -323,7 +323,7 @@ kubectl port-forward svc/api 8081:8081

- [`https://app.tracetest.io/`](https://app.tracetest.io) - Access the Tracetest Web UI. Sign up and create an organization.
- [`http://localhost:8081`](http://localhost:8081) - The Pokeshop API demo is port forwarded from Kubernetes to `localhost` on this port.
- To run tests you will use the Kubernetes internal network and the service name, `http://http://api.default.svc.cluster.internal:8081`.
- To run tests you will use the Kubernetes internal network and the service name, `http://api.default.svc.cluster.internal:8081`.
- `tracetest-agent.default.svc.cluster.local:4317` - Trace ingestion URL where Tracetest Agent will accept traces.

</TabItem>
Expand All @@ -335,19 +335,19 @@ git clone --depth 1 https://github.com/kubeshop/pokeshop.git
cd pokeshop/helm-charts

helm dependency update
helm install -n <namespace> -f values.yaml --create-namespace <namespace> .
helm install -f values.yaml --create-namespace pokeshop .
```

To access the Pokeshop API run a `port-forward`:

```bash
kubectl port-forward svc/api 8081:8081
kubectl port-forward svc/pokeshop-pokemon-api 8081:8081
```

- [`https://app.tracetest.io/`](https://app.tracetest.io) - Access the Tracetest Web UI. Sign up and create an organization.
- [`http://localhost:8081`](http://localhost:8081) - The Pokeshop API demo is port forwarded from Kubernetes to `localhost` on this port.
- To run tests you will use the Kubernetes internal network and the service name, `http://http://api.default.svc.cluster.internal:8081`.
- `tracetest-agent.default.svc.cluster.local:4317` - Trace ingestion URL where Tracetest Agent will accept traces.
- To run tests you will use the Kubernetes internal network and the service name, `http://pokeshop-pokemon-api:8081`.
- `http://agent-tracetest-agent:4317` - Trace ingestion URL where Tracetest Agent will accept traces.

</TabItem>

Expand Down Expand Up @@ -404,7 +404,7 @@ This installation is meant for testing purposes only. It uses self signed certif
For the Production-ready installation:

- [View the official Helm chart readme](https://github.com/kubeshop/tracetest-cloud-charts/blob/main/README.md).
- [View the official installation docs](/install/helm).
- [View the official installation docs](/install/on-prem-helm).
:::

1. Install [Helm](https://helm.sh/) and [kind](https://kind.sigs.k8s.io/) on your machine. Clone the official Tracetest Helm chart.
Expand Down
58 changes: 58 additions & 0 deletions docs/docs/install/cloud-helm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
id: cloud-helm
title: Install with Helm
hide_table_of_contents: false
description: Installation and deployment instructions for using Helm to deploy Enterprise self-hosted Tracetest and use the On-Prem Tracetest Control Plane / Dashboard.
keywords:
- tracetest
- trace-based testing
- observability
- distributed tracing
- testing
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg
---

This guide explains how to install a Tracetest Agent in your Kubernetes environment with Helm. It will install a Tracetest Agent in your infrastructure and use the Cloud-based managed Tracetest Control Plane and Dashboard.

## Prerequisites

- A running Kubernetes cluster.
- A Tracetest license key. If you don't have one, you can request a trial license key [here](https://tracetest.io/on-prem-installation).
- Install [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl).
- Install [Helm](https://helm.sh/).

## Install Tracetest Agent with Helm

The [main chart for this repository is called `tracetest-agent`](https://github.com/kubeshop/tracetest-cloud-charts/tree/main/charts/tracetest-agent) and contains all components necessary to run Tracetest Agent in a cluster that fits the [deployment architecture](/install/deployment-architecture).

```js title="Terminal"
helm repo add tracetestcloud https://kubeshop.github.io/tracetest-cloud-charts --force-update && \

helm install <release-name> -n <namespace> tracetestcloud/tracetest-agent \
--set agent.apiKey=<TRACETEST_API_KEY> --set agent.environmentId=<TRACETEST_ENVIRONMENT_ID>
```

If you use `agent` as the `<release-name>` with this installation, the trace ingestion endpoints will be:

gRPC: `http://agent-tracetest-agent:4317`

HTTP: `http://agent-tracetest-agent:4318/v1/traces`

## Configuration

Configure the Helm installation with the `values.yaml` file. View the [`values.yaml` default values, here.](https://github.com/kubeshop/tracetest-cloud-charts/blob/main/charts/tracetest-agent/values.yaml)

<details>
<summary>
<b>Click to expand the `values.yaml` default values.</b>
</summary>

```yaml
agent:
apiKey: "apiKey"
environmentId: "environment-id"
serverURL: "https://app.tracetest.io"
skipVerify: false
```
</details>
2 changes: 1 addition & 1 deletion docs/docs/install/deployment-architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can deploy Tracetest in two ways.

With Enterprise self-hosted Tracetest you deploy both the control plane and agent in your own infrastructure.

To deploy Enterprise self-hosted Tracetest follow the [installing with Helm guide](/install/helm).
To deploy Enterprise self-hosted Tracetest follow the [installing with Helm guide](/install/on-prem-helm).

## Architecture

Expand Down
82 changes: 68 additions & 14 deletions docs/docs/install/kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,82 @@ This guide explains how to install a Tracetest Agent in your Kubernetes environm

## Install the Tracetest Agent with Kubernetes

[Tracetest Agent](/concepts/agent) runs as a Kubernetes Daemonset.
[Tracetest Agent](/concepts/agent) runs as a Kubernetes Deployment with a Service.

```yaml title="tracetest-agent.yaml"
---
# Service
apiVersion: v1
kind: Service
metadata:
name: tracetest-agent
labels:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
spec:
selector:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
ports:
- name: grpc-collector-entrypoint
protocol: TCP
port: 4317
targetPort: 4317
- name: http-collector-entrypoint
protocol: TCP
port: 4318
targetPort: 4318
---
# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: tracetest-agent
labels:
app: tracetest-agent
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
spec:
selector:
matchLabels:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
template:
metadata:
labels:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
spec:
containers:
- name: agent
image: "kubeshop/tracetest-agent:latest"
imagePullPolicy: Always
args: [
"--environment",
"<TRACETEST_ENVIRONMENT_ID>", # Add your env id
"--api-key",
"$TRACETEST_API_KEY",
"--server-url",
"https://app.tracetest.io",
]
env:
- name: TRACETEST_API_KEY
value: "<TRACETEST_API_KEY>" # Add your API key
```
```bash title="Terminal"
curl https://raw.githubusercontent.com/kubeshop/tracetest/main/k8s/agent/deploy-agent.sh | bash -s -- default <TRACETEST_API_KEY> --environment <TRACETEST_ENVIRONMENT_ID>
kubectl apply -f ./tracetest-agent.yaml
```

The Tracetest Agent is running in Kubernetes and ready to accept traces.

gRPC: `http://<service-name>:4317`
gRPC: `http://tracetest-agent.default.svc.cluster.local:4317`

HTTP: `http://<service-name>:4318/v1/traces`
HTTP: `http://tracetest-agent.default.svc.cluster.local:4318/v1/traces`

:::note K8s Network
Running a test against `localhost` will resolve as `127.0.0.1` inside the Tracetest Agent container.
Make sure to check use the correct `<service-name>` if you edit the Tracetest Agent `service` name.

To run tests against apps running on your local machine you have two options:

1. Run the Tracetest Agent locally with the `tracetest start` command.
2. Add the Tracetest Agent to the same network and use service name mapping. *Example: Instead of running an app on `localhost:8080`, add it to your Docker Compose file, connect it to the same network as your Tracetest Agent service, and use `<service-name>:8080` in the URL field when creating a test.*

You can reach services running on your local machine using:

- Linux (docker version < 20.10.0): `172.17.0.1:8080`
- MacOS (docker version >= 18.03) and Linux (docker version >= 20.10.0): `host.docker.internal:8080`
Running a test against `localhost` will resolve as `127.0.0.1` inside the Tracetest Agent container.
Make sure to run tests using the internal Kubernetes service networking eg: `http://api.default.svc.cluster.internal:port`.
:::
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: helm
id: on-prem-helm
title: Install with Helm
hide_table_of_contents: false
description: Installation and deployment instructions for using Helm to deploy Enterprise self-hosted Tracetest and use the On-Prem Tracetest Control Plane / Dashboard.
Expand All @@ -23,12 +23,12 @@ Installation and deployment instructions for using Helm to deploy Enterprise sel

## Install Tracetest On-Premises with Helm

The [main chart for this repository is called `tracetest-onprem`](https://github.com/kubeshop/tracetest-cloud-charts/blob/main/README.md) and contains all components necessary to run Enterprise self-hosted Tracetest on-premises in a cluster that fits the [deployment architecture](/install/deployment-architecture).
The [main chart for this repository is called `tracetest-onprem`](https://github.com/kubeshop/tracetest-cloud-charts/tree/main/charts/tracetest-onprem) and contains all components necessary to run Enterprise self-hosted Tracetest on-premises in a cluster that fits the [deployment architecture](/install/deployment-architecture).

```bash title="Terminal"
helm repo add tracetestcloud https://kubeshop.github.io/tracetest-cloud-charts --force-update
```js title="Terminal"
helm repo add tracetestcloud https://kubeshop.github.io/tracetest-cloud-charts --force-update && \

helm install my-tracetest tracetestcloud/tracetest-onprem \
helm install <release-name> -n <namespace> tracetestcloud/tracetest-onprem \
--set global.licenseKey=<YOUR_TRACETEST_LICENSE> \
--values values.yaml
```
Expand Down
16 changes: 13 additions & 3 deletions docs/docs/install/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ Tracetest supports two deployment models.

With both options Tracetest Agents run in your infrastructure on the same network as your application under test. Tracetest Agents are test runners and trace ingestors. You can choose to run the control plane / dashboard self-hosted or let us manage it in Cloud-based managed Tracetest, it's up to you. Check out the [deployment architecture](/install/deployment-architecture) to learn more.

You can install Tracetest by using one of the following deployment options:

## Cloud-based Managed Tracetest

You can install Cloud-based Managed Tracetest by using one of the following deployment options.

- Use the [Tracetest CLI](/install/cli) for an out-of-the-box experience with Cloud-based managed Tracetest.
- Use [Docker](/install/docker) to run Tracetest Agent with with Cloud-based managed Tracetest.
- Use [Kubernetes](/install/kubernetes) to run Tracetest Agent with with Cloud-based managed Tracetest.
- Use the [Tracetest Helm Chart](/install/helm) to customize your deployment with Enterprise self-hosted Tracetest.
- Use [Kubernetes](/install/kubernetes) to run Tracetest Agent with Cloud-based managed Tracetest.
- Use the [Tracetest Helm Chart](/install/cloud-helm) to install Tracetest Agent with Helm in your Kubernetes cluster and run it with Cloud-based managed Tracetest.

## Enterprise Self-hosted Tracetest

You can install Enterprise Self-hosted Tracetest by using one of the following deployment options.

- Use the [Tracetest Helm Chart](/install/on-prem-helm) to customize your deployment with Enterprise self-hosted Tracetest.
- Use the [Tracetest Helm Chart with GCP](/install/gcp) to customize your deployment of Enterprise self-hosted Tracetest for running in GCP.
12 changes: 6 additions & 6 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,6 @@ const sidebars = {
id: "ci-cd-automation/overview",
},
items: [
{
type: "doc",
id: "ci-cd-automation/github-actions-pipeline",
label: "GitHub Actions Pipeline",
},
{
type: "doc",
id: "ci-cd-automation/github-actions-pipeline-with-secrets",
Expand Down Expand Up @@ -574,6 +569,11 @@ const sidebars = {
id: "install/kubernetes",
label: "Install with Kubernetes",
},
{
type: "doc",
id: "install/cloud-helm",
label: "Install with Helm",
},
],
},
{
Expand All @@ -582,7 +582,7 @@ const sidebars = {
items: [
{
type: "doc",
id: "install/helm",
id: "install/on-prem-helm",
label: "Install with Helm",
},
{
Expand Down
5 changes: 5 additions & 0 deletions docs/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@
"destination": "/getting-started/installation",
"source": "/deployment/overview",
"statusCode": 301
},
{
"destination": "/ci-cd-automation/github-actions-pipeline-with-secrets",
"source": "/ci-cd-automation/github-actions-pipeline",
"statusCode": 301
}
]
}
2 changes: 1 addition & 1 deletion examples/quick-start-github-actions/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GitHub Actions Sample for a Node.js app with OpenTelemetry and Tracetest

> [Read the detailed recipe for setting up GitHub Actions with Tractest in our documentation.](https://docs.tracetest.io/ci-cd-automation/github-actions-pipeline)
> [Read the detailed recipe for setting up GitHub Actions with Tractest in our documentation.](https://docs.tracetest.io/ci-cd-automation/github-actions-pipeline-with-secrets)
This is a simple quick start on how to configure GitHub Actions to run Tracetest against a Node.js app that uses OpenTelemetry instrumentation with traces, to enhance your e2e and integration tests with trace-based testing.

Expand Down

0 comments on commit c082252

Please sign in to comment.