Skip to content

Commit

Permalink
feat: Update bind address for k8s components (#197)
Browse files Browse the repository at this point in the history
* feat: Update bind address for k8s components

* Allow kube-proxy traffic

---------

Co-authored-by: okozachenko1203 <okozachenko1203@users.noreply.github.com>
Co-authored-by: Mohammed Naser <mnaser@vexxhost.com>
  • Loading branch information
3 people authored May 30, 2024
1 parent 570bbf0 commit 4b1f5d8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
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

0 comments on commit 4b1f5d8

Please sign in to comment.