terraform-provider-kubernetes
terraform-provider-kubernetes copied to clipboard
How to express field_path to complex label name?
Hello,
I would like to know how this should be written.
env {
name = "ORLEANS_CLUSTER_ID"
value_from {
field_ref {
field_path = "metadata.labels['orleans/clusterId']"
}
}
}
This results in a literal value of metadata.labels['orleans/clusterId']
. I can't find any examples for such a scenario. Is it supported?
Have also tried "metadata.labels.'orleans/clusterId'"
"metadata.labels.orleans/clusterId"
but they fail on run.
If this can/cannot be done could you also add a note in the relevant section deployment and/or pod documentation.
Terraform version, Kubernetes provider version and Kubernetes version
Terraform version: 0.14.6
Kubernetes Provider version: 2.0.2
Kubernetes version: 1.19.7
Are you able to get this to work outside of Terraform using YAML? I can't find any documented example of a fieldPath with a slash in it which leads me to suspect that this might not be possible.
The docs do have an example of using a volume to get the pod labels – that might be a possible workaround: https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#store-pod-fields
@worldspawn did you ever find a solution to this? I'm coming up against the same issue.
No I gave up 🤷♂️
@jrhouston in answer to your question -> https://dotnet.github.io/orleans/docs/deployment/kubernetes.html
Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!