keda doesn't support env resolution from pod fields

Created on 4 Aug 2019  路  3Comments  路  Source: kedacore/keda

I see "Error getting scalers error resolving secrets for deployment: cannot resolve env K8S_NODE_NAME to a value. fieldRef and resourceFieldRef env are skipped" errors in KEDA logs.
By looking at the code it looks like env resolution doesn't support my configuration.
Example of container env section:

spec:
      containers:
      - env:
        - name: K8S_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: K8S_POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: K8S_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace

I think KEDA shouldn't fail for env it can't resolve if it's not being used in trigger definition.

Most helpful comment

Any news on this? I'm hitting this issue as well

All 3 comments

Any news on this? I'm hitting this issue as well

same here with datadog's host's IP value:

      env:
        - name: DD_AGENT_HOST
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.hostIP

the error msg is mentioned at line 527:
https://github.com/kedacore/keda/blob/master/pkg/handler/scale_handler.go

should be resolved by #404. Thanks @eashi!

Was this page helpful?
0 / 5 - 0 ratings