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

✨ Make metrics endpoints on control plane nodes available for monitoring #142

Merged
merged 3 commits into from
Jul 23, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,70 @@ spec:
controllerManager:
extraArgs:
cloud-provider: external
bind-address: 0.0.0.0
secure-port: "10257"
scheduler:
extraArgs:
bind-address: 0.0.0.0
secure-port: "10259"
etcd:
local:
dataDir: /var/lib/etcd
extraArgs:
listen-metrics-urls: http://0.0.0.0:2381
auto-compaction-mode: periodic
auto-compaction-retention: 8h
election-timeout: "2500"
heartbeat-interval: "250"
snapshot-count: "6400"
files:
- content: |
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
metricsBindAddress: "0.0.0.0:10249"
path: /etc/kube-proxy-config.yaml
- content: |
#!/usr/bin/env bash

#
# (PK) I couldn't find a better/simpler way to conifgure it. See:
# https://github.com/kubernetes-sigs/cluster-api/issues/4512
#

set -o errexit
set -o nounset
set -o pipefail

dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
readonly dir

# Exit fast if already appended.
if [[ ! -f ${dir}/kube-proxy-config.yaml ]]; then
exit 0
fi

# kubeadm config is in different directory in Flatcar (/etc) and Ubuntu (/run/kubeadm).
kubeadm_file="/etc/kubeadm.yml"
if [[ ! -f ${kubeadm_file} ]]; then
kubeadm_file="/run/kubeadm/kubeadm.yaml"
fi

# Run this script only if this is the init node.
if [[ ! -f ${kubeadm_file} ]]; then
exit 0
fi

# Append kube-proxy-config.yaml to kubeadm config and delete it
cat "${dir}/kube-proxy-config.yaml" >> "${kubeadm_file}"
rm "${dir}/kube-proxy-config.yaml"

echo success > /tmp/kube-proxy-patch
owner: root:root
path: /etc/kube-proxy-patch.sh
permissions: "0755"
preKubeadmCommands:
- bash /etc/kube-proxy-patch.sh
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
Expand Down