Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom k8s environment variables for Node-RED applications #166

Open
anthonyjsargeant opened this issue Jun 28, 2024 · 2 comments
Open

Custom k8s environment variables for Node-RED applications #166

anthonyjsargeant opened this issue Jun 28, 2024 · 2 comments
Labels
customer request requested by customer feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do size:M - 3 Sizing estimation point

Comments

@anthonyjsargeant
Copy link

anthonyjsargeant commented Jun 28, 2024

Description

Presently, Node-RED apps in k8s have a set of environment variables that cannot be added to. This makes setting custom environment variables impossible without using k8s webhooks.

For example, in our use case, we want to be able to set a HOST_IP environment variable that makes use of k8s fieldRef to get the IP address of the node that the pod is running on. This is because we have a node-level Open Telemetry collector running on port 4317 accessible via the node's IP address. By using this functionality, we would always get the right IP address regardless of the node that a Node-RED app is running on.

An example of additional environment variables for a container's env setting is given below:

    - name: OTEL_SERVICE_NAME
       value: <Node-RED Application Name>
    - name: HOST_IP
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: status.hostIP
    - name: OTEL_EXPORTER_ENDPOINT
      value: http://$(HOST_IP):4317

Requested By

@anthonyjsargeant anthonyjsargeant added feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do labels Jun 28, 2024
@hardillb hardillb added size:M - 3 Sizing estimation point customer request requested by customer labels Jun 28, 2024
@joepavitt
Copy link
Contributor

@hardillb can you provide some more details on the work required here? M-3 label suggests a couple of days of work?

@hardillb
Copy link
Contributor

hardillb commented Jul 3, 2024

@joepavitt this needs some exploratory work, mainly about what values we would possibly want to expose and where we would expose this (e.g. in the UI or just as a driver level config options) and finally if we want to do this at all.

As mentioned there is an external way to approach this (k8s webhooks) but it is a little more involved.

List of possible fields: https://kubernetes.io/docs/concepts/workloads/pods/downward-api/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer request requested by customer feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do size:M - 3 Sizing estimation point
Projects
Status: 💬 Support cases & under review
Development

No branches or pull requests

3 participants