Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions .github/workflows/tests_data/lightrunjavaagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
deploymentName: sample-deployment
secretName: lightrun-secrets
serverHostname: dogfood.internal.lightrun.com
useSecretAsEnvVars: true
agentEnvVarName: JAVA_TOOL_OPTIONS
agentConfig:
max_log_cpu_cost: "2"
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta/lightrunjavaagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ type LightrunJavaAgentSpec struct {
// +optional
// Agent name for registration to the server
AgentName string `json:"agentName,omitempty"`

// UseSecretAsEnvVars determines whether to use secret values as environment variables (true) or as mounted files (false)
// +kubebuilder:default=true
UseSecretAsEnvVars bool `json:"useSecretAsEnvVars,omitempty"`
}

// LightrunJavaAgentStatus defines the observed state of LightrunJavaAgent
Expand Down
3 changes: 3 additions & 0 deletions charts/lightrun-agents/templates/java-agent-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ spec:
secretName: {{ .name }}-secret
{{- end }}
serverHostname: {{ .serverHostname }}
{{- if .useSecretAsEnvVars }}
useSecretAsEnvVars: {{ .useSecretAsEnvVars | default true }}
{{- end }}
agentEnvVarName: {{ .agentEnvVarName | default "JAVA_TOOL_OPTIONS" }}
{{- if .agentConfig }}
agentConfig: {{ toYaml .agentConfig | nindent 4 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/lightrun-agents/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ javaAgents: []
# containerSelector:
# - my-container-1
# serverHostname: 'lightrun.example.com'
# useSecretAsEnvVars: true
# initContainer:
# image: "lightruncom/k8s-operator-init-java-agent-linux:latest"
# agentPoolCredentials:
Expand All @@ -34,6 +35,7 @@ javaAgents: []
# containerSelector:
# - my-container-2
# serverHostname: 'lightrun.example.com'
# useSecretAsEnvVars: true
# agentPoolCredentials:
# existingSecret: "my-existing-secret"
# apiKey: ""
Expand All @@ -57,6 +59,7 @@ javaAgents: []
# containerSelector:
# - my-container-1
# serverHostname: 'lightrun.example.com'
# useSecretAsEnvVars: true
# agentEnvVarName: '_JAVA_OPTIONS'
# agentConfig:
# max_log_cpu_cost: "2"
Expand Down Expand Up @@ -84,6 +87,7 @@ javaAgents: []
# containerSelector:
# - my-container-2
# serverHostname: 'lightrun.example.com'
# useSecretAsEnvVars: true
# agentEnvVarName: 'JAVA_OPTS'
# agentConfig:
# max_log_cpu_cost: "2"
Expand Down
5 changes: 5 additions & 0 deletions charts/lightrun-operator/crds/lightrunjavaagent_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ spec:
Lightrun server hostname that will be used for downloading an agent
Key and company id in the secret has to be taken from this server as well
type: string
useSecretAsEnvVars:
default: true
description: UseSecretAsEnvVars determines whether to use secret values
as environment variables (true) or as mounted files (false)
type: boolean
workloadName:
description: Name of the Workload that will be patched. workload can
be either Deployment or StatefulSet e.g. my-deployment, my-statefulset
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/agents.lightrun.com_lightrunjavaagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ spec:
Lightrun server hostname that will be used for downloading an agent
Key and company id in the secret has to be taken from this server as well
type: string
useSecretAsEnvVars:
default: true
description: UseSecretAsEnvVars determines whether to use secret values
as environment variables (true) or as mounted files (false)
type: boolean
workloadName:
description: Name of the Workload that will be patched. workload can
be either Deployment or StatefulSet e.g. my-deployment, my-statefulset
Expand Down
1 change: 1 addition & 0 deletions config/samples/agents_v1beta_lightrunjavaagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
workloadType: Deployment
secretName: lightrun-secrets
serverHostname: <lightrun_server> #for saas it will be app.lightrun.com
useSecretAsEnvVars: true
agentEnvVarName: JAVA_TOOL_OPTIONS
agentConfig:
max_log_cpu_cost: "2"
Expand Down
5 changes: 5 additions & 0 deletions config/samples/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ spec:
Lightrun server hostname that will be used for downloading an agent
Key and company id in the secret has to be taken from this server as well
type: string
useSecretAsEnvVars:
default: true
description: UseSecretAsEnvVars determines whether to use secret values
as environment variables (true) or as mounted files (false)
type: boolean
workloadName:
description: Name of the Workload that will be patched. workload can
be either Deployment or StatefulSet e.g. my-deployment, my-statefulset
Expand Down
3 changes: 3 additions & 0 deletions docs/custom_resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ spec:
# If container not mentioned here it will be not patched
containerSelector:
- app
# UseSecretAsEnvVars determines whether to use secret values as environment variables (true) or as mounted files (false)
# Default is true for backward compatibility
useSecretAsEnvVars: true
---
apiVersion: v1
metadata:
Expand Down
4 changes: 4 additions & 0 deletions examples/lightrunjavaagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ spec:
- latest
# Agent name. If not provided, pod name will be used
#agentName: "operator-test-agent"

# UseSecretAsEnvVars determines whether to use secret values as environment variables (true) or as mounted files (false)
# Default is true for backward compatibility
useSecretAsEnvVars: true
5 changes: 5 additions & 0 deletions examples/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ spec:
Lightrun server hostname that will be used for downloading an agent
Key and company id in the secret has to be taken from this server as well
type: string
useSecretAsEnvVars:
default: true
description: UseSecretAsEnvVars determines whether to use secret values
as environment variables (true) or as mounted files (false)
type: boolean
workloadName:
description: Name of the Workload that will be patched. workload can
be either Deployment or StatefulSet e.g. my-deployment, my-statefulset
Expand Down
Loading
Loading