Merge pull request #2489 from derekwaynecarr/fix_vagrant

Fix vagrant regression
This commit is contained in:
bgrant0607 2014-11-20 10:28:14 -08:00
commit c6158b8aa9
6 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,8 @@
# Allow everyone to see cached values of who sits at what IP # Allow everyone to see cached values of who sits at what IP
{% set networkInterfaceName = "eth0" %}
{% if grains.networkInterfaceName is defined %}
{% set networkInterfaceName = grains.networkInterfaceName %}
{% endif %}
mine_functions: mine_functions:
network.ip_addrs: [eth0] network.ip_addrs: [{{networkInterfaceName}}]
grains.items: [] grains.items: []

View File

@ -10,6 +10,12 @@
{% set address = "-address=127.0.0.1" %} {% set address = "-address=127.0.0.1" %}
{% set publicAddressOverride = "" %}
{% if grains.publicAddressOverride is defined %}
{% set publicAddressOverride = "-public_address_override=" + grains.publicAddressOverride %}
{% endif %}
{% if grains.etcd_servers is defined %} {% if grains.etcd_servers is defined %}
{% set etcd_servers = "-etcd_servers=http://" + grains.etcd_servers + ":4001" %} {% set etcd_servers = "-etcd_servers=http://" + grains.etcd_servers + ":4001" %}
{% else %} {% else %}
@ -40,4 +46,4 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
DAEMON_ARGS="{{daemon_args}} {{address}} {{etcd_servers}} {{ cloud_provider }} --allow_privileged={{pillar['allow_privileged']}} {{portal_net}} {{cert_file}} {{key_file}} {{secure_port}} {{token_auth_file}}" DAEMON_ARGS="{{daemon_args}} {{address}} {{etcd_servers}} {{ cloud_provider }} --allow_privileged={{pillar['allow_privileged']}} {{portal_net}} {{cert_file}} {{key_file}} {{secure_port}} {{token_auth_file}} {{publicAddressOverride}}"

View File

@ -38,6 +38,8 @@
{% endif %} {% endif %}
{% if grains.cloud is defined %}
{% if grains.cloud == 'gce' %}
# Kubelet will run without this file but will not be able to send events to the apiserver. # Kubelet will run without this file but will not be able to send events to the apiserver.
/var/lib/kubelet/kubernetes_auth: /var/lib/kubelet/kubernetes_auth:
file.managed: file.managed:
@ -45,6 +47,8 @@
- user: root - user: root
- group: root - group: root
- mode: 400 - mode: 400
{% endif %}
{% endif %}
kubelet: kubelet:
group.present: group.present:
@ -65,5 +69,9 @@ kubelet:
{% if grains['os_family'] != 'RedHat' %} {% if grains['os_family'] != 'RedHat' %}
- file: /etc/init.d/kubelet - file: /etc/init.d/kubelet
{% endif %} {% endif %}
{% if grains.cloud is defined %}
{% if grains.cloud == 'gce' %}
- file: /var/lib/kubelet/kubernetes_auth - file: /var/lib/kubelet/kubernetes_auth
{% endif %}
{% endif %}

View File

@ -68,7 +68,9 @@ cat <<EOF >/etc/salt/minion.d/grains.conf
grains: grains:
node_ip: $MASTER_IP node_ip: $MASTER_IP
master_ip: $MASTER_IP master_ip: $MASTER_IP
publicAddressOverride: $MASTER_IP
network_mode: openvswitch network_mode: openvswitch
networkInterfaceName: eth1
etcd_servers: $MASTER_IP etcd_servers: $MASTER_IP
cloud: vagrant cloud: vagrant
cloud_provider: vagrant cloud_provider: vagrant

View File

@ -48,6 +48,8 @@ grains:
network_mode: openvswitch network_mode: openvswitch
node_ip: $MINION_IP node_ip: $MINION_IP
etcd_servers: $MASTER_IP etcd_servers: $MASTER_IP
networkInterfaceName: eth1
apiservers: $MASTER_IP
roles: roles:
- kubernetes-pool - kubernetes-pool
- kubernetes-pool-vagrant - kubernetes-pool-vagrant

View File

@ -51,6 +51,7 @@ The following enumerates the set of defined key/value pairs that are supported t
Key | Value Key | Value
------------- | ------------- ------------- | -------------
`apiservers` | (Optional) The IP address / host name where a kubelet can get read-only access to kube-apiserver
`cbr-cidr` | (Optional) The minion IP address range used for the docker container bridge. `cbr-cidr` | (Optional) The minion IP address range used for the docker container bridge.
`cloud` | (Optional) Which IaaS platform is used to host kubernetes, *gce*, *azure*, *aws*, *vagrant* `cloud` | (Optional) Which IaaS platform is used to host kubernetes, *gce*, *azure*, *aws*, *vagrant*
`cloud_provider` | (Optional) The cloud_provider used by apiserver: *gce*, *azure*, *vagrant* `cloud_provider` | (Optional) The cloud_provider used by apiserver: *gce*, *azure*, *vagrant*
@ -60,6 +61,8 @@ Key | Value
`node_ip` | (Optional) The IP address to use to address this node `node_ip` | (Optional) The IP address to use to address this node
`minion_ip` | (Optional) Mapped to the kubelet hostname_override, K8S TODO - change this name `minion_ip` | (Optional) Mapped to the kubelet hostname_override, K8S TODO - change this name
`network_mode` | (Optional) Networking model to use among nodes: *openvswitch* `network_mode` | (Optional) Networking model to use among nodes: *openvswitch*
`networkInterfaceName` | (Optional) Networking interface to use to bind addresses, default value *etho0*
`publicAddressOverride` | (Optional) The IP address the kube-apiserver should use to bind against for external read-only access
`roles` | (Required) 1. `kubernetes-master` means this machine is the master in the kubernetes cluster. 2. `kubernetes-pool` means this machine is a kubernetes-minion. Depending on the role, the Salt scripts will provision different resources on the machine. `roles` | (Required) 1. `kubernetes-master` means this machine is the master in the kubernetes cluster. 2. `kubernetes-pool` means this machine is a kubernetes-minion. Depending on the role, the Salt scripts will provision different resources on the machine.
These keys may be leveraged by the Salt sls files to branch behavior. These keys may be leveraged by the Salt sls files to branch behavior.