mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #814 from thockin/cleanups3
Clean up the -address flag in kubelet
This commit is contained in:
commit
cd129b1c4f
@ -9,10 +9,9 @@
|
|||||||
{% set etcd_servers = "-etcd_servers=http://" + ips[0][0] + ":4001" %}
|
{% set etcd_servers = "-etcd_servers=http://" + ips[0][0] + ":4001" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% set hostname_override = "" %}
|
||||||
{% if grains.minion_ip is defined %}
|
{% if grains.minion_ip is defined %}
|
||||||
{% set address = "-address=" + grains.minion_ip + " -hostname_override=" + grains.minion_ip %}
|
{% set hostname_override = " -hostname_override=" + grains.minion_ip %}
|
||||||
{% else %}
|
|
||||||
{% set address = "-address=$HOSTNAME" %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
DAEMON_ARGS="{{daemon_args}} {{etcd_servers}} {{address}} -config=/etc/kubernetes/manifests"
|
DAEMON_ARGS="{{daemon_args}} {{etcd_servers}} {{hostname_override}} -config=/etc/kubernetes/manifests"
|
||||||
|
@ -17,7 +17,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
|||||||
DESC="The Kubernetes container manager"
|
DESC="The Kubernetes container manager"
|
||||||
NAME=kubelet
|
NAME=kubelet
|
||||||
DAEMON=/usr/local/bin/kubelet
|
DAEMON=/usr/local/bin/kubelet
|
||||||
DAEMON_ARGS=" -config /etc/kubelet/data/`hostname`"
|
DAEMON_ARGS=" -config /etc/kubelet/data/`hostname` -address=0.0.0.0"
|
||||||
DAEMON_LOG_FILE=/var/log/$NAME.log
|
DAEMON_LOG_FILE=/var/log/$NAME.log
|
||||||
PIDFILE=/var/run/$NAME.pid
|
PIDFILE=/var/run/$NAME.pid
|
||||||
SCRIPTNAME=/etc/init.d/$NAME
|
SCRIPTNAME=/etc/init.d/$NAME
|
||||||
|
@ -50,7 +50,8 @@ var (
|
|||||||
fileCheckFrequency = flag.Duration("file_check_frequency", 20*time.Second, "Duration between checking config files for new data")
|
fileCheckFrequency = flag.Duration("file_check_frequency", 20*time.Second, "Duration between checking config files for new data")
|
||||||
httpCheckFrequency = flag.Duration("http_check_frequency", 20*time.Second, "Duration between checking http for new data")
|
httpCheckFrequency = flag.Duration("http_check_frequency", 20*time.Second, "Duration between checking http for new data")
|
||||||
manifestURL = flag.String("manifest_url", "", "URL for accessing the container manifest")
|
manifestURL = flag.String("manifest_url", "", "URL for accessing the container manifest")
|
||||||
address = flag.String("address", "127.0.0.1", "The address for the info server to serve on")
|
enableServer = flag.Bool("enable_server", true, "Enable the info server")
|
||||||
|
address = flag.String("address", "127.0.0.1", "The address for the info server to serve on (set to 0.0.0.0 or \"\" for all interfaces)")
|
||||||
port = flag.Uint("port", 10250, "The port for the info server to serve on")
|
port = flag.Uint("port", 10250, "The port for the info server to serve on")
|
||||||
hostnameOverride = flag.String("hostname_override", "", "If non-empty, will use this string as identification instead of the actual hostname.")
|
hostnameOverride = flag.String("hostname_override", "", "If non-empty, will use this string as identification instead of the actual hostname.")
|
||||||
dockerEndpoint = flag.String("docker_endpoint", "", "If non-empty, use this for the docker endpoint to communicate with")
|
dockerEndpoint = flag.String("docker_endpoint", "", "If non-empty, use this for the docker endpoint to communicate with")
|
||||||
@ -158,7 +159,7 @@ func main() {
|
|||||||
go util.Forever(cfg.Sync, *syncFrequency)
|
go util.Forever(cfg.Sync, *syncFrequency)
|
||||||
|
|
||||||
// start the kubelet server
|
// start the kubelet server
|
||||||
if *address != "" {
|
if *enableServer {
|
||||||
go util.Forever(func() {
|
go util.Forever(func() {
|
||||||
kubelet.ListenAndServeKubeletServer(k, cfg.Channel("http"), http.DefaultServeMux, *address, *port)
|
kubelet.ListenAndServeKubeletServer(k, cfg.Channel("http"), http.DefaultServeMux, *address, *port)
|
||||||
}, 0)
|
}, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user