scalyr/scalyr-agent-2

SCALYR_K8S_POD_NAME missing

n-johnson opened this issue · 0 comments

When running the scalyr agent in k8s using https://hub.docker.com/r/scalyr/scalyr-k8s-agent, starting with the 2.0.51 release, we are getting this error when the pod tries to start, and then it ends up in CrashLoopBackoff

2019-09-16 18:39:31.031Z ERROR [monitor:kubernetes_monitor()] [kubernetes_monitor.py:2479] ERROR: Missing required environment variable for kubenetes_monitor: SCALYR_K8S_POD_NAME
2019-09-16 18:39:31.031Z ERROR [monitor:kubernetes_monitor()] [kubernetes_monitor.py:2480] Please restart with up-to-date Scalyr Agent Daemonset manifest (YAML) file.
Error reading configuration file: Required environment variable "SCALYR_K8S_POD_NAME" is not set for kubernetes_monitor.
Terminating agent, please fix the configuration file and restart agent.
Traceback (most recent call last):
  File "/usr/sbin/scalyr-agent-2", line 217, in main
    self.__config = self.__read_and_verify_config(config_file_path)
  File "/usr/sbin/scalyr-agent-2", line 292, in __read_and_verify_config
    self.__verify_config(config)
  File "/usr/sbin/scalyr-agent-2", line 325, in __verify_config
    monitors_manager = MonitorsManager(config, self.__controller)
  File "/usr/share/scalyr-agent-2/py/scalyr_agent/monitors_manager.py", line 54, in __init__
    self.__monitors = MonitorsManager.__create_monitors(configuration, platform_controller)
  File "/usr/share/scalyr-agent-2/py/scalyr_agent/monitors_manager.py", line 270, in __create_monitors
    configuration.global_monitor_sample_interval, configuration))
  File "/usr/share/scalyr-agent-2/py/scalyr_agent/monitors_manager.py", line 330, in build_monitor
    return monitor_class(monitor_config, scalyr_logging.getLogger("%s(%s)" % (module_name, monitor_id)), global_config=global_config)
  File "/usr/share/scalyr-agent-2/py/scalyr_agent/scalyr_monitor.py", line 144, in __init__
    self._initialize()
  File "/usr/share/scalyr-agent-2/py/scalyr_agent/builtin_monitors/kubernetes_monitor.py", line 2358, in _initialize
    self.__verify_required_env_var('SCALYR_K8S_POD_NAME')
  File "/usr/share/scalyr-agent-2/py/scalyr_agent/builtin_monitors/kubernetes_monitor.py", line 2483, in __verify_required_env_var
    env_var_name)
BadMonitorConfiguration: Required environment variable "SCALYR_K8S_POD_NAME" is not set for kubernetes_monitor.

Pinning the image version to the 2.0.50 release fixes the problem.

We are running kube version v1.12.7 on AWS EKS.