Kubeadm: Specify address for kube-controller-manager and kube-scheduler

Created on 18 Nov 2017  路  6Comments  路  Source: kubernetes/kubeadm

Is this a BUG REPORT or FEATURE REQUEST?

Feature Request.

Hello, thanks so much for the code, I've found it very helpful in standing up a kubernetes cluster. I'd like to request (and hopefully contribute if you're open to the feature) the ability to set the address for both kube-controller-manager and kube-scheduler to something like address=0.0.0.0 during the kubeadm init command.

Use-case: As part of standing up the cluster, I also wanted to monitor the cluster with prometheus. Specifically, I wanted to monitor the cluster by taking advantage of https://github.com/coreos/prometheus-operator. The manifests that come with the kube-prometheus section of this code attempt to setup targets for the kube-controller-manager and kube-scheduler. By default, these target fail on startup because they are not addressable.

As a workaround to this issue, I have to manually modify the manifests in /etc/kubernetes/manifests/ and then manually restart the kubelet service on the master. If init ever runs again, it will overwrite these settings (or, as noted by #541 during an upgrade).

I have a couple of ideas on how to do this, but I would love feedback from someone more familiar with the codebase.

  1. Add the ability to set a manifest directory that kubeadm should search when creating default services. This would be something like kubeadm init --manifest-directory /path/to/my/custom/manifests which would search the /path/to/my/custom/manifests directory for files that would change the default etc, kube-apiserver, kube-controller-manager.yaml, or kube-scheduler files.
  2. Add the ability to specify --controller-manager-address=0.0.0.0 and --scheduler-address=0.0.0.0. I would assume this is less preferred.

Most helpful comment

Well done!
On existing cluster:
kubectl -n kube-system edit cm kubeadm-config
add to data->MasterConfiguration

    controllerManagerExtraArgs:
      address: 0.0.0.0
    schedulerExtraArgs:
      address: 0.0.0.0

On master node:
vim /etc/kubernetes/manifests/kube-controller-manager.yaml
vim /etc/kubernetes/manifests/kube-scheduler.yaml
and set --address=0.0.0.0
then
systemctl restart kubelet

All 6 comments

You can already do this with the config file: https://kubernetes.io/docs/reference/generated/kubeadm/#config-file

Cheers!

Oh, woops thanks!

@luxas 404

@loganasherjones I have't see any parameter to change --address for kube-controller-manager or kube-scheduler

Well done!
On existing cluster:
kubectl -n kube-system edit cm kubeadm-config
add to data->MasterConfiguration

    controllerManagerExtraArgs:
      address: 0.0.0.0
    schedulerExtraArgs:
      address: 0.0.0.0

On master node:
vim /etc/kubernetes/manifests/kube-controller-manager.yaml
vim /etc/kubernetes/manifests/kube-scheduler.yaml
and set --address=0.0.0.0
then
systemctl restart kubelet

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ggaaooppeenngg picture ggaaooppeenngg  路  4Comments

jessfraz picture jessfraz  路  3Comments

kvaps picture kvaps  路  3Comments

jbrandes picture jbrandes  路  4Comments

cnmade picture cnmade  路  4Comments