datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

How to use variable in container annotations

Open salimuddin87 opened this issue 6 years ago • 1 comments

Below is deployment yaml file

......
spec:
  replicas: 1
  selector:
    matchLabels: {name: vert-${LAUNCH_ID}}
  template:
    metadata:
      annotations:
        ad.datadoghq.com/{How to use variable?}.logs: '[{"source":"how to use name that has variable?","service":"search"}]'
      name: vert-${LAUNCH_ID}
      labels:
        app: search
.....

Describe what happened: As we can see that name has a variable "${LAUNCH_ID}".

Describe what you expected: How can we use a variable in annotations?

Steps to reproduce the issue:

Additional environment details (Operating System, Cloud provider, etc): Amazon Linux, Kubernetes

salimuddin87 avatar Jul 09 '20 12:07 salimuddin87

Hi @salimuddin87

This not possible in kubernetes right now. You would need to template this with helm or something else, before you deploy the manifest. It is not something Datadog can change. You can maybe create an issue on the Kubernetes side if you want this to be introduced :)

Thanks

Simwar avatar Aug 17 '20 15:08 Simwar