pf9ctl Binary Incorrectly Updating Proxy Settings

Problem

  • While updating proxy settings with the pf9ctl binary, the /opt/pf9/hostagent/pf9-hostagent.env file is being updated incorrectly.

Environment

  • Platform9 Managed Kubernetes - v5.9 through v5.11

  • pf9ctl

Diagnosis

  • Before applying pf9ctl set-proxy the file /opt/pf9/hostagent/pf9-hostagent.env looks like below.

$ cat /opt/pf9/hostagent/pf9-hostagent.env
PYTHONPATH="/opt/pf9/hostagent/lib/python3.6/site-packages:/opt/pf9/hostagent/lib/python3.9/site-packages/bbslave:${PYTHONPATH}"
PYTHON_EGG_CACHE=/tmp/python-eggs
LD_LIBRARY_PATH="/opt/pf9/python/pf9-lib:/opt/pf9/python/pf9-hostagent-lib:${LD_LIBRARY_PATH}"
  • Setup proxy settings with pf9ctl on Node.

$ pf9ctl set-proxy --protocol http --host-ip [IP_ADDRESS_1] --port [PORT] --no-proxy [IP_ADDRESS_2],[IP_ADDRESS_3]
  • After applying pf9ctl set-proxy the file /opt/pf9/hostagent/pf9-hostagent.env looks like below.

$ cat /opt/pf9/hostagent/pf9-hostagent.env
PYTHONPATH="/opt/pf9/hostagent/lib/python3.6/site-packages:/opt/pf9/hostagent/lib/python3.9/site-packages/bbslave:${PYTHONPATH}"
PYTHON_EGG_CACHE=/tmp/python-eggs
LD_LIBRARY_PATH="/opt/pf9/python/pf9-lib:/opt/pf9/python/pf9-hostagent-lib:${LD_LIBRARY_PATH}"
export http_proxy=http://[IP_ADDRESS_1]:[PORT]
export https_proxy=http://[IP_ADDRESS_1]:[PORT]
export HTTP_PROXY=http://[IP_ADDRESS_1]:[PORT]
export HTTPS_PROXY=http://[IP_ADDRESS_1]:[PORT]
export no_proxy=localhost,127.0.0.1,::1,localhost.localdomain,localhost4,localhost6
export NO_PROXY=localhost,127.0.0.1,::1,localhost.localdomain,localhost4,localhost6
  • Hostagent Logs on the node:

Cause

  • This is due to a BUG: PMK-6577 and is resolved in PMK v5.12.

Workaround

  • Manually update /opt/pf9/hostagent/pf9-hostagent.env file with required environment variables.

  • Restart pf9-hostagent service.

  • Verify the proxy settings by fetching pod logs.

Additional Information

Last updated