Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: explicitly set bind-address for scheduler and controller-manager #63

Merged
merged 8 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,31 @@ k8s_cluster_cluster_configuration:
# In a cluster with more than one control plane instances, this field should be assigned
# the address of the external load balancer in front of the control plane instances
controlPlaneEndpoint: "{{ hostvars[inventory_hostname]['ansible_facts']['default_ipv4']['address'] }}:6443"
# controller-manager and scheduler listen 127.0.0.1 address and respective port by default.
# it could be a problem if you are going to deploy monitoring stack because it would be
# scrapping <node_ip>:<port> (node_ip - because those manifests have 'hostNetwork: true')
#
# read more about kube-controller-manager options:
# https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/
controllerManager:
extraArgs:
bind-address: "0.0.0.0"
# https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
scheduler:
extraArgs:
bind-address: "0.0.0.0"

# https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/
k8s_cluster_kubelet_configuration:
cgroupDriver: systemd
failSwapOn: false

# https://kubernetes.io/docs/reference/config-api/kube-proxy-config.v1alpha1/
k8s_cluster_kubeproxy_configuration: ""
k8s_cluster_kubeproxy_configuration:
# monitoring tools can't scrape default bind address (127.0.0.1:10249)
# https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/README.md#kubeproxy
# https://kubernetes.io/docs/reference/config-api/kube-proxy-config.v1alpha1/
metricsBindAddress: "0.0.0.0:10249"

# https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta3/#kubeadm-k8s-io-v1beta3-JoinConfiguration
#
Expand Down
6 changes: 6 additions & 0 deletions molecule/end-to-end/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ provisioner:
dnsDomain: cluster.local
kubernetesVersion: "{{ k8s_cluster_kubernetes_version }}"
controlPlaneEndpoint: "{{ k8s_cluster_control_plane_endpoint }}:6443"
controllerManager:
extraArgs:
bind-address: "0.0.0.0"
scheduler:
extraArgs:
bind-address: "0.0.0.0"
# custom networking
k8s_cluster_flannel_apply: ""
k8s_cluster_custom_networking_tasks_path: "network/custom-networking.yml"
Expand Down
12 changes: 12 additions & 0 deletions molecule/end-to-end/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@
- name: Include verify common
ansible.builtin.include_tasks:
file: ../verify-common.yml

- name: Netstat output
block:
- name: Run netstat
ansible.builtin.shell: |
netstat -tulpn
register: netstat
changed_when: false

- name: Netstat debug
ansible.builtin.debug:
var: netstat