techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.
https://technotim.live/posts/k3s-etcd-ansible/
Apache License 2.0
2.41k stars 1.05k forks source link

HTTP Proxy for Agent Service not utilized #397

Closed tagn closed 9 months ago

tagn commented 12 months ago

Expected Behavior

HTTP Proxy variables should be applied to both the Master and Agent node configurations.

Current Behavior

Agent node proxy configuration is being placed in this directory: /etc/systemd/system/k3s.service.d/

Without use of the Include directive in the /etc/systemd/system/k3s-node.service file, the service does not automatically load the additional configuration since the directory name is misaligned.

Steps to Reproduce

  1. Run playbook to setup a cluster with an http_proxy configuration
  2. Master node service receives the proxy configuration
  3. Agent node service does not receive a proxy configuration

Context (variables)

Operating system: CentOS/RHEL

Variables Used

all.yml

systemd_dir: /etc/systemd/system
proxy_env:
  HTTP_PROXY: "http://myproxy.com:3128"
  HTTPS_PROXY: "http://myproxy.com:3128"
  NO_PROXY: "*.domain.local,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"

Hosts

host.ini

[master]
192.168.1.1
192.168.1.2
192.168.1.3

[node]
192.168.1.4
192.168.1.5

[k3s_cluster:children]
master
node

Possible Solution

Update path for the k3s service configuration directory on nodes to reflect the name of the service k3s-node.

timothystewart6 commented 9 months ago

fixed by https://github.com/techno-tim/k3s-ansible/pull/400