If you are using a released version of Kubernetes, you should refer to the docs that go with that version.
The latest release of this document can be found [here](http://releases.k8s.io/release-1.1/docs/getting-started-guides/dcos.md).Documentation for other releases can be found at releases.k8s.io.
This guide will walk you through installing Kubernetes-Mesos on Datacenter Operating System (DCOS) with the DCOS CLI and operating Kubernetes with the DCOS Kubectl plugin.
Table of Contents
DCOS is system software that manages computer cluster hardware and software resources and provides common services for distributed applications. Among other services, it provides Apache Mesos as its cluster kernel and Marathon as its init system. With DCOS CLI, Mesos frameworks like Kubernetes-Mesos can be installed with a single command.
Another feature of the DCOS CLI is that it allows plugins like the DCOS Kubectl plugin. This allows for easy access to a version-compatible Kubectl without having to manually download or install.
Further information about the benefits of installing Kubernetes on DCOS can be found in the Kubernetes-Mesos documentation.
For more details about the Kubernetes DCOS packaging, see the Kubernetes-Mesos project.
Since Kubernetes-Mesos is still alpha, it is a good idea to familiarize yourself with the current known issues which may limit or modify the behavior of Kubernetes on DCOS.
If you have problems completing the steps below, please file an issue against the kubernetes-mesos project.
Explore the following resources for more information about Kubernetes, Kubernetes on Mesos/DCOS, and DCOS itself.
- DCOS Documentation
- Managing DCOS Services
- Kubernetes Examples
- Kubernetes on Mesos Documentation
- Kubernetes on Mesos Release Notes
- Kubernetes on DCOS Package Source
- A running DCOS cluster
- DCOS Community Edition is currently available on AWS.
- DCOS Enterprise Edition can be deployed on virtual or bare metal machines. Contact [email protected] for more info and to set up an engagement.
- DCOS CLI installed locally
-
Configure and validate the Mesosphere Multiverse as a package source repository
$ dcos config prepend package.sources https://github.com/mesosphere/multiverse/archive/version-1.x.zip $ dcos package update --validate
-
Install etcd
By default, the Kubernetes DCOS package starts a single-node etcd. In order to avoid state loss in the event of Kubernetes component container failure, install an HA etcd-mesos cluster on DCOS.
$ dcos package install etcd
-
Verify that etcd is installed and healthy
The etcd cluster takes a short while to deploy. Verify that
/etcd
is healthy before going on to the next step.$ dcos marathon app list ID MEM CPUS TASKS HEALTH DEPLOYMENT CONTAINER CMD /etcd 128 0.2 1/1 1/1 --- DOCKER None
-
Create Kubernetes installation configuration
Configure Kubernetes to use the HA etcd installed on DCOS.
$ cat >/tmp/options.json <<EOF { "kubernetes": { "etcd-mesos-framework-name": "etcd" } } EOF
-
Install Kubernetes
$ dcos package install --options=/tmp/options.json kubernetes
-
Verify that Kubernetes is installed and healthy
The Kubernetes cluster takes a short while to deploy. Verify that
/kubernetes
is healthy before going on to the next step.$ dcos marathon app list ID MEM CPUS TASKS HEALTH DEPLOYMENT CONTAINER CMD /etcd 128 0.2 1/1 1/1 --- DOCKER None /kubernetes 768 1 1/1 1/1 --- DOCKER None
-
Verify that Kube-DNS & Kube-UI are deployed, running, and ready
$ dcos kubectl get pods --namespace=kube-system NAME READY STATUS RESTARTS AGE kube-dns-v8-tjxk9 4/4 Running 0 1m kube-ui-v2-tjq7b 1/1 Running 0 1m
Names and ages may vary.
Now that Kubernetes is installed on DCOS, you may wish to explore the Kubernetes Examples or the Kubernetes User Guide.
-
Stop and delete all replication controllers and pods in each namespace:
Before uninstalling Kubernetes, destroy all the pods and replication controllers. The uninstall process will try to do this itself, but by default it times out quickly and may leave your cluster in a dirty state.
$ dcos kubectl delete rc,pods --all --namespace=default $ dcos kubectl delete rc,pods --all --namespace=kube-system
-
Validate that all pods have been deleted
$ dcos kubectl get pods --all-namespaces
-
Uninstall Kubernetes
$ dcos package uninstall kubernetes