[root@SN2014-12-200 pods]# kubectl get pods
NAME IMAGE(S) HOST LABELS STATUS5d70892e-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.201/ name=fedoraapache Running
5d715e56-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.202/ name=fedoraapache Running
5d717f8d-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.202/ name=fedoraapache Running
5d71c584-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.201/ name=fedoraapache Running
5d71a494-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.202/ name=fedoraapache Running
#自动生成出一个副本,保持6份的效果
[root@SN2014-12-200 pods]# kubectl get pods
NAME IMAGE(S) HOST LABELS STATUS5d717f8d-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.202/ name=fedoraapache Running
5d71c584-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.201/ name=fedoraapache Running
5d71a494-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.202/ name=fedoraapache Running
2a8fb993-8798-11e4-970d-000c292f1620 fedora/apache 192.168.1.201/ name=fedoraapache Running
5d70892e-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.201/ name=fedoraapache Running
5d715e56-8794-11e4-970d-000c292f1620 fedora/apache 192.168.1.202/ name=fedoraapache Running
2.测试不同角色模块中的hostPort
1)pod中hostPort为空,而replicationcontrollers为指定端口,则异常;两侧都指定端口,相同或不同时都异常;pod的hostport为指定,另replicationcon为空,则正常;pod的hostport为空,另replicationcon为空,则正常;结论是在replicationcontrollers场景不能指定hostport,否则异常,待持续测试。
2)结论:在replicationcontronllers.json中,"replicaSelector": {"name": "webserver_pod"}要与"labels": {"name": "webserver_pod"}以及service中的"selector": {"name": "webserver_pod"}保持一致;