There is a propety do define a container in the target deployment, that should be used for ENV variables lookup.
Currently it is named containerName, I personally don't like the name. Because it is under scaleTargetRef property and users could get impresion that this is the Container (inside Deployment) that is gonna be scaled (which is not true).
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: {scaled-object-name}
spec:
scaleTargetRef:
apiVersion: {api-version-of-target-resource}
kind: {kind-of-target-resource}
name: {name-of-target-resource}
containerName: {container-name}
I'd like to rename it for v2, to something like envContainerName or something like that.
AFAIK this is not currently supported for ScaledJobs, does it make sense to add this as well? We should add it to the spec somewhere then:
apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
name: {scaled-job-name}
spec:
jobTargetRef:
parallelism: 1
completions: 1
activeDeadlineSeconds: 600
backoffLimit: 6
template:
# [job template]
pollingInterval: 30
successfulJobsHistoryLimit: 5
failedJobsHistoryLimit: 5
maxReplicaCount: 100
triggers:
Suggestions? Thoughts?
In that case, don't you have the same issue? How about envSourceName or so?
Yeah, but the value of the field, should be a container name, so we should keep that in the field name somehow. Your suggestion is lacking this context.
The name should be something like: containerNameFromWhichWeWantToGetEnv .. 馃槃
envContainerName it is I think, can't come up with a better name...
Or envVarResolution.containerName? I don't know.
I like envContainerName or envSourceContainerName
I like envSourceContainerName and go in this direction.
Fixed by #1023
Most helpful comment
The name should be something like:
containerNameFromWhichWeWantToGetEnv.. 馃槃