Skip to content

Commit 0bab21d

Browse files
author
eliranb
committed
fixes to README and checkConfig
1 parent 6b44e5e commit 0bab21d

File tree

3 files changed

+99
-125
lines changed

3 files changed

+99
-125
lines changed

charts/lightrun-agents/README.md

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
# Helm Chart for Deploying Lightrun Agents
2-
This Helm chart allows you to deploy and manage Lightrun Agents as custom resources in your Kubernetes cluster.
3-
Currently only java based agents are supported.
4-
The LightrunJavaAgent custom resource will be configured based on the values provided in the values.yaml file.
2+
3+
This Helm chart enables the deployment and management of Lightrun Agents as custom resources within your Kubernetes cluster. Currently, only Java-based agents are supported. The LightrunJavaAgent custom resource will be configured according to the settings specified in the values.yaml file.
54

65
## Prerequisites
7-
- Kubernetes 1.16+
8-
- Helm 3.0+
9-
- Ability to fetch images of the init containers from [Lightrun Repository Dockerhub](https://hub.docker.com/u/lightruncom). or alternatively have them available in private registry.
6+
7+
- Kubernetes 1.19+
8+
- Ability to fetch images of the init containers from [Lightrun Repository Dockerhub](https://hub.docker.com/u/lightruncom). or alternatively have them available in private registry.
9+
1010
## Installation
11+
1112
### 1 - Add the repo to your Helm repository list
13+
1214
```shell
1315
helm repo add lightrun-k8s-operator https://lightrun-platform.github.io/lightrun-k8s-operator
1416

1517
```
18+
1619
### 2 - Prepare values.yaml
17-
The "values.yaml" file contains the following configurable parameters for each java agent object:
18-
19-
| Parameter | Description | Default |
20-
|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
21-
| `javaAgents[].agentCliFlags` | [Command-line flags for the Lightrun Java Agent.](https://docs.lightrun.com/jvm/agent-configuration/#additional-command-line-flags). | Optional `""` (empty string) |
22-
| `javaAgents[].agentConfig` | [Additional configuration for the Lightrun Java Agent.](https://docs.lightrun.com/jvm/agent-configuration/#agent-flags) | Optional `{}` (empty map) |
23-
| `javaAgents[].agentEnvVarName` | Specifies the Java environment variable name used for adding `--agentpath` | Optional (if not provided, defaults to `"JAVA_TOOL_OPTIONS"`) |
24-
| `javaAgents[].agentName` | Custom name to assign to the Lightrun Java Agent. | Optional (if not provided, defaults to pod name) |
25-
| `javaAgents[].agentPoolCredentials.existingSecret` | Name of an existing Kubernetes secret containing api key and pinned cert hash for agent pool. [secret example](https://github.com/lightrun-platform/lightrun-k8s-operator/blob/main/examples/lightrunjavaagent.yaml#L64-L73) | Optional (if not provided, defaults to `name-secret`) |
26-
| `javaAgents[].agentPoolCredentials.apiKey` | Lightrun agent API key. | Required if `existingSecret` not set |
27-
| `javaAgents[].agentPoolCredentials.pinnedCertHash` | 64 character sha256 certificate public key hash for pinning | Required if `existingSecret` not set |
28-
| `javaAgents[].agentTags` | [List of Lightrun Java Agent tags.](https://docs.lightrun.com/jvm/tagging/#manage-lightrun-java-agent-tags) | Optional `[]` (empty list) |
29-
| `javaAgents[].containerSelector` | Selector for containers within the deployment to inject the Lightrun Java Agent. | Required |
30-
| `javaAgents[].deploymentName` | Name of the Kubernetes deployment to attach the Lightrun Java Agent. | Required |
31-
| `javaAgents[].initContainer.image` | Image for the Lightrun Java Agent init container. | Required |
32-
| `javaAgents[].initContainer.sharedVolumeMountPath` | Mount path for the shared volume in the init container. | Optional (if not provided, defaults to `"/lightrun"`" |
33-
| `javaAgents[].initContainer.sharedVolumeName` | Name of the shared volume for the init container. | Optional (if not provided, defaults to `"lightrun-agent-init"`" |
34-
| `javaAgents[].name` | Name of the Lightrun Java Agent custom resource. | Required |
35-
| `javaAgents[].namespace` | Namespace of the Lightrun Java Agent custom resource. Must be in the same namespace as the workload | Required |
36-
| `javaAgents[].serverHostname` | Hostname of the Lightrun server to connect the agent. | Required |
37-
38-
#### 2.1 - Set `initContainer.image`
20+
21+
The values.yaml file includes the following configurable parameters for each Java agent object:
22+
23+
| Parameter | Description | Default |
24+
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
25+
| `javaAgents[].agentCliFlags` | [Command-line flags for the Lightrun Java Agent.](https://docs.lightrun.com/jvm/agent-configuration/#additional-command-line-flags). | Optional `""` (empty string) |
26+
| `javaAgents[].agentConfig` | [Additional configuration for the Lightrun Java Agent.](https://docs.lightrun.com/jvm/agent-configuration/#agent-flags). | Optional `{}` (empty map) |
27+
| `javaAgents[].agentEnvVarName` | Specifies the Java environment variable name used to add `--agentpath`. | Optional (if not provided, defaults to `"JAVA_TOOL_OPTIONS"`) |
28+
| `javaAgents[].agentName` | Custom name to assign to the Lightrun Java Agent. | Optional (if not provided, defaults to pod name) |
29+
| `javaAgents[].agentPoolCredentials.existingSecret` | Name of an existing Kubernetes secret that contains the API key and pinned certificate hash for the agent pool. [secret example](https://github.com/lightrun-platform/lightrun-k8s-operator/blob/main/examples/lightrunjavaagent.yaml#L64-L73). | Optional (if not provided, defaults to `name-secret`) |
30+
| `javaAgents[].agentPoolCredentials.apiKey` | Lightrun agent API key. | Required if `existingSecret` not set |
31+
| `javaAgents[].agentPoolCredentials.pinnedCertHash` | 64 character sha256 certificate public key hash for pinning. | Required if `existingSecret` not set |
32+
| `javaAgents[].agentTags` | [List of Lightrun Java Agent tags](https://docs.lightrun.com/jvm/tagging/#manage-lightrun-java-agent-tags). | Optional `[]` (empty list) |
33+
| `javaAgents[].containerSelector` | Selector for containers within the deployment to inject the Lightrun Java Agent. | Required |
34+
| `javaAgents[].deploymentName` | Name of the Kubernetes deployment to attach the Lightrun Java Agent. | Required |
35+
| `javaAgents[].initContainer.image` | Image for the Lightrun Java Agent init container. | Required |
36+
| `javaAgents[].initContainer.sharedVolumeMountPath` | Mount path for the shared volume in the init container. | Optional (if not provided, defaults to `"/lightrun"`" |
37+
| `javaAgents[].initContainer.sharedVolumeName` | Name of the shared volume for the init container. | Optional (if not provided, defaults to `"lightrun-agent-init"`" |
38+
| `javaAgents[].name` | Name of the Lightrun Java Agent custom resource. | Required |
39+
| `javaAgents[].namespace` | Namespace of the Lightrun Java Agent custom resource. Must be in the same namespace as the workload | Required |
40+
| `javaAgents[].serverHostname` | Hostname of the Lightrun server to connect the agent. | Required |
41+
42+
#### 2.1 - Set `initContainer.image`
3943

4044
Based on your workload's OS and architecture, you should select the appropriate DockerHub repository from the following options:
45+
4146
- [linux amd64](https://hub.docker.com/repository/docker/lightruncom/k8s-operator-init-java-agent-linux/general)
4247
- [linux arm64](https://hub.docker.com/repository/docker/lightruncom/k8s-operator-init-java-agent-linux-arm64/general)
4348
- [alpine amd64](https://hub.docker.com/repository/docker/lightruncom/k8s-operator-init-java-agent-alpine/general)
44-
- [alpine arm64](https://hub.docker.com/repository/docker/lightruncom/k8s-operator-init-java-agent-alpine-arm64/general)
49+
- [alpine arm64](https://hub.docker.com/repository/docker/lightruncom/k8s-operator-init-java-agent-alpine-arm64/general)
4550

46-
After determining the appropriate image, you'll need to choose a tag. The tag can either be "latest," which corresponds to the most up-to-date version, or it can be a specific Lightrun version following the convention `<x.y.z>-init.<number>`. Typically, the `<number>` part is 0, but it's always good to verify on the DockerHub repository.
51+
After determining the appropriate image, you will need to choose a tag. The tag can either be "latest," which corresponds to the most up-to-date Lightrun version, or it can be a specific Lightrun version following the convention `<x.y.z>-init.<number>`. Typically, the `<number>` part is 0, but it is always good to verify on the DockerHub repository.
4752

4853
For your convenience, here are some possible combinations of how the final image might look:
54+
4955
```text
5056
Linux amd64 with the latest version -> lightruncom/k8s-operator-init-java-agent-linux:latest
5157
Linux amd64 with a specific version -> lightruncom/k8s-operator-init-java-agent-linux:1.39.1-init.0
@@ -56,20 +62,25 @@ Alpine amd64 with a specific version -> lightruncom/k8s-operator-init-java-agent
5662
Alpine arm64 with the latest version -> lightruncom/k8s-operator-init-java-agent-alpine-arm64:latest
5763
Alpine arm64 with a specific version -> lightruncom/k8s-operator-init-java-agent-alpine-arm64:1.39.1-init.0
5864
```
65+
5966
#### 2.2 Install the chart
6067

61-
When installing the chart, it's important to understand that the -n flag provided in the helm install command does not determine where the actual resources will be deployed. Instead, deployment is controlled by the javaAgents[].namespace parameter for each object in the values.yaml file.
68+
When installing the chart, it is important to understand that the -n flag provided in the helm install command does not determine where the actual resources will be deployed. Instead, deployment is controlled by the javaAgents[].namespace parameter for each object in the values.yaml file.
6269

6370
Use the -n flag to specify a namespace, either using the same namespace where your Lightrun Kubernetes Operator is installed or creating a new namespace specifically for this purpose, such as "lightrun-agents". This namespace will be referenced if you need to uninstall the chart later.
71+
6472
```bash
6573
helm install <release-name> lightrun-k8s-operator/lightrun-agents -n <namespace> -f values.yaml
6674
```
6775

6876
## Examples
77+
6978
### Basic
79+
7080
- The `my-service-1` does not use an `existingSecret` and instead the `agentPoolCredentials.apiKey` and `agentPoolCredentials.pinnedCertHash` are provided directly.
7181

7282
- The `my-service-2` uses an `existingSecret` named `my-existing-secret`
83+
7384
```yaml
7485
javaAgents:
7586
- name: 'my-service-1'
@@ -109,9 +120,11 @@ javaAgents:
109120
```
110121
111122
### Full
123+
112124
- The `my-service-1` does not use an `existingSecret` and instead the `agentPoolCredentials.apiKey` and `agentPoolCredentials.pinnedCertHash` are provided directly.
113125

114126
- The `my-service-2` uses an `existingSecret` named `my-existing-secret`
127+
115128
```yaml
116129
javaAgents:
117130
- name: 'my-service-1'
@@ -127,7 +140,7 @@ javaAgents:
127140
initContainer:
128141
image: "lightruncom/k8s-operator-init-java-agent-linux:latest"
129142
sharedVolumeName: 'my-shared-volume'
130-
sharedVolumeMountPath: '/mypath'
143+
sharedVolumeMountPath: '/mypath'
131144
agentPoolCredentials:
132145
existingSecret: ""
133146
apiKey: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
@@ -150,7 +163,7 @@ javaAgents:
150163
agentEnvVarName: 'JAVA_OPTS'
151164
agentConfig:
152165
max_log_cpu_cost: "2"
153-
agentCliFlags: "--lightrun_extra_class_path=<PATH_TO_JAR>:<PATH_TO_JAR>,lightrun_init_wait_time_ms"
166+
agentCliFlags: "--lightrun_extra_class_path=<PATH_TO_JAR>:<PATH_TO_JAR>,lightrun_init_wait_time_ms"
154167
agentPoolCredentials:
155168
existingSecret: "my-existing-secret"
156169
apiKey: ""
@@ -163,9 +176,11 @@ javaAgents:
163176
```
164177

165178
## Uninstallation
179+
166180
To uninstall the chart:
167181

168182
```bash
169183
helm uninstall <release-name> -n <namespace>
170184
```
185+
171186
This command removes all the Kubernetes components associated with the chart and deletes the release.

0 commit comments

Comments
 (0)