Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Support Downward api as template variable #726

Open
josedev-union opened this issue Oct 1, 2022 · 1 comment
Open

Support Downward api as template variable #726

josedev-union opened this issue Oct 1, 2022 · 1 comment
Labels
kind/enhancement New feature or request
Milestone

Comments

@josedev-union
Copy link

It is sometimes useful for acorn containers to have information about themselves.
Also, acorn app to have its information like appInstance name, namespace etc.

@djcarpe
Copy link

djcarpe commented Nov 9, 2022

Description

There may be cases where we'd like containers to have access to pod information through environment variables.

Some example pod information that can be pulled through the downward api is the fieldRef and resourceFieldRef.

A short list of available fields
field description
metadata.name the pod's name
metadata.namespace the pod's namespace
metadata.uid the pod's unique ID
metadata.annotations['<KEY>'] the value of the pod's annotation named (for example, metadata.annotations['myannotation'])
metadata.labels['<KEY>'] the text value of the pod's label named (for example, metadata.labels['mylabel'])
spec.serviceAccountName the name of the pod's service account
spec.nodeName the name of the node where the Pod is executing
status.hostIP the primary IP address of the node to which the Pod is assigned
status.podIP the pod's primary IP address (usually, its IPv4 address)

Resources

Kubernetes Downward API: https://kubernetes.io/docs/concepts/workloads/pods/downward-api/

Example Kubernetes downward API usage: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/

Previous discussion in Acorn Slack: https://acorn-users.slack.com/archives/C03R9ME0SKC/p1663138625938179

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants