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

feat: Update bind address for k8s components #197

Merged
merged 3 commits into from
May 30, 2024
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
Empty file.
Empty file.
Empty file.
18 changes: 18 additions & 0 deletions magnum_cluster_api/files/run/kubeadm/configure-kube-proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# SPDX-License-Identifier: Apache-2.0

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

if grep -q "KubeProxyConfiguration" /run/kubeadm/kubeadm.yaml; then
exit 0
fi

cat <<EOF >> /run/kubeadm/kubeadm.yaml
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
metricsBindAddress: "0.0.0.0:10249"
EOF
22 changes: 22 additions & 0 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# under the License.

import glob
import importlib.resources
import json
import os
import textwrap
Expand Down Expand Up @@ -603,14 +604,23 @@ def get_object(self) -> objects.KubeadmControlPlaneTemplate:
}
],
},
"etcd": {
"local": {
"extraArgs": {
"listen-metrics-urls": "http://0.0.0.0:2381",
},
},
},
"controllerManager": {
"extraArgs": {
"bind-address": "0.0.0.0",
"cloud-provider": "external",
"profiling": "false",
},
},
"scheduler": {
"extraArgs": {
"bind-address": "0.0.0.0",
"profiling": "false",
},
},
Expand All @@ -631,6 +641,18 @@ def get_object(self) -> objects.KubeadmControlPlaneTemplate:
),
"encoding": "base64",
},
{
"path": "/run/kubeadm/configure-kube-proxy.sh",
"permissions": "0755",
"content": base64.encode_as_text(
importlib.resources.files(
"magnum_cluster_api.files.run.kubeadm"
)
.joinpath("configure-kube-proxy.sh")
.read_text()
),
"encoding": "base64",
},
],
"initConfiguration": {
"nodeRegistration": {
Expand Down
Loading