Skip to content

Commit

Permalink
Fix for default systemd startup of the kublet, also forcing the hard
Browse files Browse the repository at this point in the history
requirement for the parameter.  Sans parameter the kubelet will fail
silently trying to obtain service setting that are placed into the
ENV of the PODS.
  • Loading branch information
Timothy St. Clair committed Feb 20, 2015
1 parent 2b5641d commit 604df04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions contrib/init/systemd/environ/kubelet
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ KUBELET_PORT="--port=10250"
# You may leave this blank to use the actual hostname
KUBELET_HOSTNAME="--hostname_override=127.0.0.1"

# location of the api-server
KUBELET_API_SERVER="--api_server=127.0.0.1:8080"

# Add your own!
KUBELET_ARGS=""
2 changes: 1 addition & 1 deletion contrib/init/systemd/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ EnvironmentFile=-/etc/kubernetes/kubelet
ExecStart=/usr/bin/kubelet \
$KUBE_LOGTOSTDERR \
$KUBE_LOG_LEVEL \
$KUBE_ETCD_SERVERS \
$KUBELET_API_SERVER \
$KUBELET_ADDRESS \
$KUBELET_PORT \
$KUBELET_HOSTNAME \
Expand Down
4 changes: 3 additions & 1 deletion pkg/kubelet/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ func (s *KubeletServer) Run(_ []string) error {
//
// TODO(erictune): convert all cloud provider scripts and Google Container Engine to
// use only --api_servers, then delete --etcd_servers flag and the resulting dead code.
if len(s.EtcdServerList) > 0 && len(s.APIServerList) > 0 {
if len(s.APIServerList) == 0 {
glog.Fatalf("--api_server is required.")
} else if len(s.EtcdServerList) >0 {
glog.Infof("Both --etcd_servers and --api_servers are set. Not using etcd source.")
s.EtcdServerList = util.StringList{}
}
Expand Down

0 comments on commit 604df04

Please sign in to comment.