You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: charts/lightrun-agents/README.md
+71-11Lines changed: 71 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,9 @@ The values.yaml file includes the following configurable parameters for each Jav
31
31
|`javaAgents[].agentPoolCredentials.pinnedCertHash`| 64 character sha256 certificate public key hash for pinning. | Required if `existingSecret` not set |
|`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 |
34
+
|`javaAgents[].workloadName`| Name of the Kubernetes workload (Deployment or StatefulSet) to attach the Lightrun Java Agent. **Recommended over `deploymentName`**. | Required (if `deploymentName` not used) |
35
+
|`javaAgents[].workloadType`| Type of the Kubernetes workload. Must be either `"Deployment"` or `"StatefulSet"`. **Required when using `workloadName`**. | Required (if `workloadName` is used) |
36
+
|`javaAgents[].deploymentName`|**[DEPRECATED]** Name of the Kubernetes deployment to attach the Lightrun Java Agent. Use `workloadName` and `workloadType` instead. | Required (if `workloadName` not used) |
35
37
|`javaAgents[].initContainer.image`| Image for the Lightrun Java Agent init container. | Required |
36
38
|`javaAgents[].initContainer.sharedVolumeMountPath`| Mount path for the shared volume in the init container. | Optional (if not provided, defaults to `"/lightrun"`" |
37
39
|`javaAgents[].initContainer.sharedVolumeName`| Name of the shared volume for the init container. | Optional (if not provided, defaults to `"lightrun-agent-init"`" |
@@ -73,19 +75,56 @@ Use the -n flag to specify a namespace, either using the same namespace where yo
If you are currently using the `deploymentName` field, you should migrate to the new `workloadName` and `workloadType` fields for better clarity and StatefulSet support:
81
+
82
+
**Legacy Configuration (deprecated):**
83
+
```yaml
84
+
javaAgents:
85
+
- name: 'my-service'
86
+
namespace: 'my-namespace'
87
+
deploymentName: "my-deployment"# deprecated
88
+
# ... other fields
89
+
```
90
+
91
+
**New Configuration (recommended):**
92
+
```yaml
93
+
javaAgents:
94
+
- name: 'my-service'
95
+
namespace: 'my-namespace'
96
+
workloadName: "my-deployment"# new field
97
+
workloadType: "Deployment"# new field (required)
98
+
# ... other fields
99
+
```
100
+
101
+
**For StatefulSets:**
102
+
```yaml
103
+
javaAgents:
104
+
- name: 'my-service'
105
+
namespace: 'my-namespace'
106
+
workloadName: "my-statefulset"# new field
107
+
workloadType: "StatefulSet"# new field (required)
108
+
# ... other fields
109
+
```
110
+
111
+
> **Note:** You cannot use both `deploymentName` and `workloadName`/`workloadType` in the same configuration. The chart validation will fail if both are specified.
112
+
76
113
## Examples
77
114
78
115
### Basic
79
116
80
-
- The `my-service-1`does not use an `existingSecret` and instead the `agentPoolCredentials.apiKey` and `agentPoolCredentials.pinnedCertHash` are provided directly.
81
-
82
-
- The `my-service-2` uses an `existingSecret` named `my-existing-secret`
117
+
- The `my-service-1`uses the new workload configuration (recommended) for a Deployment and does not use an `existingSecret`
118
+
- The `my-service-2` uses the new workload configuration for a StatefulSet and uses an `existingSecret` named `my-existing-secret`
119
+
- The `my-service-3` shows the legacy configuration using `deploymentName` (deprecated but still supported)
- The `my-service-1` does not use an `existingSecret` and instead the `agentPoolCredentials.apiKey` and `agentPoolCredentials.pinnedCertHash` are provided directly.
125
-
126
-
- The `my-service-2` uses an `existingSecret` named `my-existing-secret`
181
+
- The `my-service-1` uses the new workload configuration for a Deployment with full configuration options
182
+
- The `my-service-2` uses the new workload configuration for a StatefulSet with an `existingSecret`
Copy file name to clipboardExpand all lines: charts/lightrun-agents/templates/_checkConfig.tpl
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,17 @@ Compile all warnings into a single message, and call fail.
22
22
{{- ifnot .initContainer.image }}
23
23
{{- $objectErrorMsgs = append $objectErrorMsgs"Init Container Image Checker:\n Error: The 'initContainer.image' field is missing. Please provide the 'initContainer.image' parameter." -}}
24
24
{{- end }}
25
-
{{- ifnot .deploymentName }}
26
-
{{- $objectErrorMsgs = append $objectErrorMsgs"Deployment Name Checker:\n Error: The 'deploymentName' field is missing. Please provide the 'deploymentName' parameter." -}}
25
+
26
+
{{- /* Workload configuration validation */}}
27
+
{{- $hasDeploymentName := .deploymentName }}
28
+
{{- $hasWorkloadConfig := and .workloadName .workloadType }}
29
+
30
+
{{- ifand$hasDeploymentName$hasWorkloadConfig}}
31
+
{{- $objectErrorMsgs = append $objectErrorMsgs"Workload Configuration Checker:\n Error: Both 'deploymentName' (legacy) and 'workloadName'/'workloadType' (new) are specified. Please use only one configuration method: either 'deploymentName' OR 'workloadName' with 'workloadType'." -}}
{{- $objectErrorMsgs = append $objectErrorMsgs"Workload Configuration Checker:\n Error: No workload configuration specified. Please provide either 'deploymentName' (legacy) OR 'workloadName' with 'workloadType' (recommended)." -}}
27
34
{{- end }}
35
+
28
36
{{- ifnot .containerSelector }}
29
37
{{- $objectErrorMsgs = append $objectErrorMsgs"Container Selector Checker:\n Error: The 'containerSelector' field is missing. Please provide the 'containerSelector' parameter." -}}
0 commit comments