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

Ubuntu-distro: Kubelet and kube-proxy talk to apiserver not etcd. #5245

Merged
merged 2 commits into from
Mar 16, 2015

Conversation

erictune
Copy link
Member

No description provided.

@erictune
Copy link
Member Author

@WIZARD-CXY
Could you review and test this change please?
We have moved to a model where only apiserver should access kubernetes objects directly from apiserver. Also, kubelet and kube-proxy need to POST to apiserver to record events. This change points them at the apiserver url instead of etcd url.

@erictune erictune changed the title Kubelet and kube-proxy talk to apiserver not etcd. Ubuntu-distro: Kubelet and kube-proxy talk to apiserver not etcd. Mar 10, 2015
@WIZARD-CXY
Copy link
Contributor

@erictune The changing in the cluster/ubuntu directory is ok, because it handles the single node situation where master and minion component is on the same machine.
But ubuntu-cluster is not fine since minion node is not on the same machine where apiserver lives ,so 127.0.0.1:8080 is not correct.

@WIZARD-CXY
Copy link
Contributor

diff --git a/cluster/ubuntu-cluster/configure.sh b/cluster/ubuntu-cluster/configure.sh
index 0667728..810ea19 100755
--- a/cluster/ubuntu-cluster/configure.sh
+++ b/cluster/ubuntu-cluster/configure.sh
@@ -130,6 +130,8 @@ do
     item="$name=http://$i:2380"
     if [ "$ii" == 1 ]; then 
         cluster=$item
+        #record the masterIP for later use.
+        masterIP=$i
     else
         cluster="$cluster,$item"
         if [ "$ii" -gt 2 ]; then
@@ -192,6 +194,8 @@ while true; do
             configEtcd $etcdName $myIP $cluster
             # set MINION IP in default_scripts/kubelet
             sed -i "s/MY_IP/${myIP}/g" default_scripts/kubelet
+            sed -i "s/MASTER_IP/${masterIP}/g" default_scripts/kubelet         
+            sed -i "s/MASTER_IP/${masterIP}/g" default_scripts/kube-proxy        
            cpMinion
            break
            ;;
diff --git a/cluster/ubuntu-cluster/default_scripts/kube-proxy b/cluster/ubuntu-cluster/default_scripts/kube-proxy
`index 82a41b8..1122464 100644
--- a/cluster/ubuntu-cluster/default_scripts/kube-proxy
+++ b/cluster/ubuntu-cluster/default_scripts/kube-proxy
@@ -4,7 +4,7 @@


-KUBE_PROXY_OPTS="--etcd_servers=http://127.0.0.1:4001 \
+KUBE_PROXY_OPTS="--master=http://MASTER_IP:8080 \
 --logtostderr=true"

diff --git a/cluster/ubuntu-cluster/default_scripts/kubelet b/cluster/ubuntu-cluster/default_scripts/kubelet
index 64a4eb5..9da03d8 100644
--- a/cluster/ubuntu-cluster/default_scripts/kubelet
+++ b/cluster/ubuntu-cluster/default_scripts/kubelet
@@ -8,7 +8,7 @@
 KUBELET_OPTS="--address=0.0.0.0 \
 --port=10250 \
 --hostname_override=MY_IP \
---etcd_servers=http://127.0.0.1:4001 \
+--master=http://MASTER_IP:8080 \
 --logtostderr=true"

The above diff will do the change work.

@resouer
Copy link
Contributor

resouer commented Mar 11, 2015

@erictune Hi eric, it's so kind of you to notify us by a PR. 😄

We think you should also update configure.sh like the comment above. BTW, from which release Kubelet and kube-proxy will talk to apiserver? We'd like to test it.

@erictune
Copy link
Member Author

Thanks. Fixed.

@erictune
Copy link
Member Author

@resouer
Please test when you have a chance.

@resouer
Copy link
Contributor

resouer commented Mar 16, 2015

@erictune Test OK, LGTM!

cc @WIZARD-CXY

@WIZARD-CXY
Copy link
Contributor

LGTM too!

@erictune
Copy link
Member Author

LGTM. Oncall please merge.

@erictune erictune added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 16, 2015
@erictune erictune self-assigned this Mar 16, 2015
@erictune
Copy link
Member Author

@jlowdermilk

j3ffml added a commit that referenced this pull request Mar 16, 2015
Ubuntu-distro: Kubelet and kube-proxy talk to apiserver not etcd.
@j3ffml j3ffml merged commit 221f226 into kubernetes:master Mar 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants