Skip to content

Commit

Permalink
Merge pull request kubernetes#10877 from brendandburns/aws
Browse files Browse the repository at this point in the history
Fix AWS Setup.
  • Loading branch information
vmarmol committed Jul 8, 2015
2 parents dbc0e76 + 6d08ade commit 3be3603
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
21 changes: 21 additions & 0 deletions cluster/aws/templates/create-dynamic-salt-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ contexts:
current-context: service-account-context
EOF

mkdir -p /srv/salt-overlay/salt/kubelet
kubelet_kubeconfig_file="/srv/salt-overlay/salt/kubelet/kubeconfig"
cat > "${kubelet_kubeconfig_file}" <<EOF
apiVersion: v1
kind: Config
users:
- name: kubelet
user:
token: ${kubelet_token}
clusters:
- name: local
cluster:
insecure-skip-tls-verify: true
contexts:
- context:
cluster: local
user: kubelet
name: service-account-context
current-context: service-account-context
EOF

# Generate tokens for other "service accounts". Append to known_tokens.
#
# NB: If this list ever changes, this script actually has to
Expand Down
12 changes: 10 additions & 2 deletions cluster/saltbase/salt/docker/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,24 @@ lxc-docker-{{ override_docker_ver }}:
- lxc-docker-{{ override_docker_ver }}: /var/cache/docker-install/{{ override_deb }}
- require:
- file: /var/cache/docker-install/{{ override_deb }}
{% endif %}
{% endif %} # end override_docker_ver != ''

docker:
service.running:
# Starting Docker is racy on aws for some reason. To be honest, since Monit
# is managing Docker restart we should probably just delete this whole thing
# but the kubernetes components use salt 'require' to set up a dag, and that
# complicated and scary to unwind.
{% if grains.cloud is defined and grains.cloud == 'aws' %}
- enable: False
{% else %}
- enable: True
{% endif %}
- watch:
- file: {{ environment_file }}
{% if override_docker_ver != '' %}
- require:
- pkg: lxc-docker-{{ override_docker_ver }}
{% endif %}

{% endif %}
{% endif %} # end grains.os_family != 'RedHat'

0 comments on commit 3be3603

Please sign in to comment.