What happened?
When I removed a control node using the command ansible-playbook -i inventory/sample/hosts.yml remove-node.yml -b -v --extra-vars "node=master3", the removal operation was successful, but the control node being removed was not deleted from the load balancer's nginx.conf configuration on the worker nodes.
The /etc/nginx/nginx.conf on the worker nodes is shown below:
error_log stderr notice;
worker_processes 2;
worker_rlimit_nofile 130048;
worker_shutdown_timeout 10s;
events {
multi_accept on;
use epoll;
worker_connections 16384;
}
stream {
upstream kube_apiserver {
least_conn;
server 10.1.69.100:6443;
server 10.1.69.101:6443;
server 10.1.69.102:6443;
}
server {
listen 127.0.0.1:6443;
proxy_pass kube_apiserver;
proxy_timeout 10m;
proxy_connect_timeout 1s;
}
}
http {
aio threads;
aio_write on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 5m;
keepalive_requests 100;
reset_timedout_connection on;
server_tokens off;
autoindex off;
server {
listen 8081;
location /healthz {
access_log off;
return 200;
}
location /stub_status {
stub_status on;
access_log off;
}
}
}
What did you expect to happen?
The /etc/nginx/nginx.conf on the worker nodes is changed to:
error_log stderr notice;
worker_processes 2;
worker_rlimit_nofile 130048;
worker_shutdown_timeout 10s;
events {
multi_accept on;
use epoll;
worker_connections 16384;
}
stream {
upstream kube_apiserver {
least_conn;
server 10.1.69.100:6443;
server 10.1.69.101:6443;
}
server {
listen 127.0.0.1:6443;
proxy_pass kube_apiserver;
proxy_timeout 10m;
proxy_connect_timeout 1s;
}
}
http {
aio threads;
aio_write on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 5m;
keepalive_requests 100;
reset_timedout_connection on;
server_tokens off;
autoindex off;
server {
listen 8081;
location /healthz {
access_log off;
return 200;
}
location /stub_status {
stub_status on;
access_log off;
}
}
}
How can we reproduce it (as minimally and precisely as possible)?
Deploy a cluster with 3 control-plane nodes and 1 worker node, using Nginx as the load balancer. Then, use the remove-node.yml playbook to remove a control-plane node (as described above), and subsequently check the /etc/nginx/nginx.conf file on the worker node.
OS
openEuler 20
Version of Ansible
2.16.14
Version of Python
3.10.12
Version of Kubespray (commit)
v2.26.0
Network plugin used
flannel
Full inventory with variables
out.log
Command used to invoke ansible
ansible-playbook -i inventory/sample/hosts.yml remove-node.yml -b -v --extra-vars "node=master3"
Output of ansible run
remove_out.log
Anything else we need to know
No response
What happened?
When I removed a control node using the command ansible-playbook -i inventory/sample/hosts.yml remove-node.yml -b -v --extra-vars "node=master3", the removal operation was successful, but the control node being removed was not deleted from the load balancer's nginx.conf configuration on the worker nodes.
The /etc/nginx/nginx.conf on the worker nodes is shown below:
error_log stderr notice;
worker_processes 2;
worker_rlimit_nofile 130048;
worker_shutdown_timeout 10s;
events {
multi_accept on;
use epoll;
worker_connections 16384;
}
stream {
upstream kube_apiserver {
least_conn;
server 10.1.69.100:6443;
server 10.1.69.101:6443;
server 10.1.69.102:6443;
}
server {
listen 127.0.0.1:6443;
proxy_pass kube_apiserver;
proxy_timeout 10m;
proxy_connect_timeout 1s;
}
}
http {
aio threads;
aio_write on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 5m;
keepalive_requests 100;
reset_timedout_connection on;
server_tokens off;
autoindex off;
server {
listen 8081;
location /healthz {
access_log off;
return 200;
}
location /stub_status {
stub_status on;
access_log off;
}
}
}
What did you expect to happen?
The /etc/nginx/nginx.conf on the worker nodes is changed to:
error_log stderr notice;
worker_processes 2;
worker_rlimit_nofile 130048;
worker_shutdown_timeout 10s;
events {
multi_accept on;
use epoll;
worker_connections 16384;
}
stream {
upstream kube_apiserver {
least_conn;
server 10.1.69.100:6443;
server 10.1.69.101:6443;
}
server {
listen 127.0.0.1:6443;
proxy_pass kube_apiserver;
proxy_timeout 10m;
proxy_connect_timeout 1s;
}
}
http {
aio threads;
aio_write on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 5m;
keepalive_requests 100;
reset_timedout_connection on;
server_tokens off;
autoindex off;
server {
listen 8081;
location /healthz {
access_log off;
return 200;
}
location /stub_status {
stub_status on;
access_log off;
}
}
}
How can we reproduce it (as minimally and precisely as possible)?
Deploy a cluster with 3 control-plane nodes and 1 worker node, using Nginx as the load balancer. Then, use the remove-node.yml playbook to remove a control-plane node (as described above), and subsequently check the /etc/nginx/nginx.conf file on the worker node.
OS
openEuler 20
Version of Ansible
2.16.14
Version of Python
3.10.12
Version of Kubespray (commit)
v2.26.0
Network plugin used
flannel
Full inventory with variables
out.log
Command used to invoke ansible
ansible-playbook -i inventory/sample/hosts.yml remove-node.yml -b -v --extra-vars "node=master3"
Output of ansible run
remove_out.log
Anything else we need to know
No response