diff --git a/Makefile b/Makefile index 1ae7e13..9549bda 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,9 @@ destroy: venv -e dcos_channel="$(DCOS_CHANNEL)" \ -e dcos_master_setup="$(DCOS_MASTER_SETUP)" +kubernetes: venv + venv/bin/ansible-playbook -v kubernetes.yml + dashboard: @open $$(./dcos config show core.dcos_url) diff --git a/README.md b/README.md index e1ae0c2..f4f9456 100644 --- a/README.md +++ b/README.md @@ -64,14 +64,20 @@ your browser: ### Use DCOS CLI -After running `make bootstrap`, you can also use the `./dcos` script to remotely +After bootstrapping DCOS, you can also use the `./dcos` script to remotely manage your cluster. The script is a convenience wrapper around the [dcos tool] -provided by Mesosphere. +provided by Mesosphere. Run `./dcos` without parameters to get a list of all +available commands. -This example shows how to use the CLI to install and use Kubernetes: +### Install Kubernetes + +This will deploy [Kubernetes] on top of DCOS: + + make kubernetes + +Afterwards, run the `kubectl` subcommand to control the Kubernetes cluster +manager. For example: - ./dcos package update - ./dcos package install --yes kubernetes ./dcos kubectl run nginx --image=nginx ### Destroy DCOS cluster @@ -98,3 +104,4 @@ infrastructure changes. [Mesosphere DCOS Community Edition EULA]: https://docs.mesosphere.com/community-edition-eula/ [dcos tool]: https://docs.mesosphere.com/using/cli/ [blog]: https://mlafeldt.github.io/blog/getting-started-with-the-mesosphere-dcos/ +[Kubernetes]: http://kubernetes.io/ diff --git a/kubernetes.yml b/kubernetes.yml new file mode 100644 index 0000000..e662908 --- /dev/null +++ b/kubernetes.yml @@ -0,0 +1,16 @@ +- hosts: localhost + connection: local + gather_facts: False + tasks: + - name: Get list of installed DCOS packages + command: ./dcos package list + register: package_list + ignore_errors: True + + - name: Update DCOS package index + command: ./dcos package update + when: "'/kubernetes' not in package_list.stdout" + + - name: Install Kubernetes on DCOS + command: ./dcos package install --yes kubernetes + when: "'/kubernetes' not in package_list.stdout"