Remove deprecated Kubernetes on Mesos docs (#6668)
* Removed depreciated Kubernetes on Mesos docs * remove mesos referencesreviewable/pr7220/r1
parent
a7d76d7f80
commit
bd230c86ef
|
@ -73,7 +73,6 @@ toc:
|
|||
- docs/getting-started-guides/rkt/index.md
|
||||
- docs/getting-started-guides/rkt/notes.md
|
||||
|
||||
- docs/getting-started-guides/mesos/index.md
|
||||
- docs/getting-started-guides/mesos-docker.md
|
||||
|
||||
- title: Bare Metal
|
||||
|
|
|
@ -1,320 +0,0 @@
|
|||
---
|
||||
approvers:
|
||||
- jdef
|
||||
- karlkfi
|
||||
title: Kubernetes on Mesos on Docker
|
||||
---
|
||||
|
||||
The mesos/docker provider uses docker-compose to launch Kubernetes as a Mesos framework, running in docker with its
|
||||
dependencies (etcd & mesos).
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
|
||||
## Cluster Goals
|
||||
|
||||
- kubernetes development
|
||||
- pod/service development
|
||||
- demoing
|
||||
- fast deployment
|
||||
- minimal hardware requirements
|
||||
- minimal configuration
|
||||
- entry point for exploration
|
||||
- simplified networking
|
||||
- fast end-to-end tests
|
||||
- local deployment
|
||||
|
||||
Non-Goals:
|
||||
|
||||
- high availability
|
||||
- fault tolerance
|
||||
- remote deployment
|
||||
- production usage
|
||||
- monitoring
|
||||
- long running
|
||||
- state persistence across restarts
|
||||
|
||||
## Cluster Topology
|
||||
|
||||
The cluster consists of several docker containers linked together by docker-managed hostnames:
|
||||
|
||||
| Component | Hostname | Description |
|
||||
|-------------------------------|-----------------------------|-----------------------------------------------------------------------------------------|
|
||||
| docker-grand-ambassador | | Proxy to allow circular hostname linking in docker |
|
||||
| etcd | etcd | Key/Value store used by Mesos |
|
||||
| Mesos Master | mesosmaster1 | REST endpoint for interacting with Mesos |
|
||||
| Mesos Slave (x2) | mesosslave1, mesosslave2 | Mesos agents that offer resources and run framework executors (e.g. Kubernetes Kublets) |
|
||||
| Kubernetes API Server | apiserver | REST endpoint for interacting with Kubernetes |
|
||||
| Kubernetes Controller Manager | controller | |
|
||||
| Kubernetes Scheduler | scheduler | Schedules container deployment by accepting Mesos offers |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Required:
|
||||
|
||||
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - version control system
|
||||
- [Docker CLI](https://docs.docker.com/) - container management command line client
|
||||
- [Docker Engine](https://docs.docker.com/) - container management daemon
|
||||
- On Mac, use [Docker Machine](https://docs.docker.com/machine/install-machine/)
|
||||
- [Docker Compose](https://docs.docker.com/compose/install/) - multi-container application orchestration
|
||||
|
||||
Optional:
|
||||
|
||||
- [Virtual Box](https://www.virtualbox.org/wiki/Downloads)
|
||||
- Free x86 virtualization engine with a Docker Machine driver
|
||||
- [Golang](https://golang.org/doc/install) - Go programming language
|
||||
- Required to build Kubernetes locally
|
||||
- [Make](https://en.wikipedia.org/wiki/Make_(software)) - Utility for building executables from source
|
||||
- Required to build Kubernetes locally with make
|
||||
|
||||
### Install on Mac (Homebrew)
|
||||
|
||||
It's possible to install all of the above via [Homebrew](http://brew.sh/) on a Mac.
|
||||
|
||||
Some steps print instructions for configuring or launching. Make sure each is properly set up before continuing to the next step.
|
||||
|
||||
```shell
|
||||
brew install git
|
||||
brew install caskroom/cask/brew-cask
|
||||
brew cask install virtualbox
|
||||
brew install docker
|
||||
brew install docker-machine
|
||||
brew install docker-compose
|
||||
```
|
||||
|
||||
### Install on Linux
|
||||
|
||||
Most of the above are available via apt and yum, but depending on your distribution, you may have to install via other
|
||||
means to get the latest versions.
|
||||
|
||||
It is recommended to use Ubuntu, simply because it best supports AUFS, used by docker to mount volumes. Alternate file
|
||||
systems may not fully support docker-in-docker.
|
||||
|
||||
In order to build Kubernetes, the current user must be in a docker group with sudo privileges.
|
||||
See the docker docs for [instructions](https://docs.docker.com/installation/ubuntulinux/#create-a-docker-group).
|
||||
|
||||
|
||||
#### Docker Machine Config (Mac)
|
||||
|
||||
If on a Mac using docker-machine, the following steps will make the docker IPs (in the virtualbox VM) reachable from the
|
||||
host machine (Mac).
|
||||
|
||||
1. Create VM
|
||||
|
||||
oracle-virtualbox
|
||||
|
||||
```shell
|
||||
docker-machine create --driver virtualbox kube-dev
|
||||
eval "$(docker-machine env kube-dev)"
|
||||
```
|
||||
|
||||
2. Set the VM's host-only network to "promiscuous mode":
|
||||
|
||||
oracle-virtualbox
|
||||
|
||||
```conf
|
||||
docker-machine stop kube-dev
|
||||
VBoxManage modifyvm kube-dev --nicpromisc2 allow-all
|
||||
docker-machine start kube-dev
|
||||
```
|
||||
|
||||
This allows the VM to accept packets that were sent to a different IP.
|
||||
|
||||
Since the host-only network routes traffic between VMs and the host, other VMs will also be able to access the docker
|
||||
IPs, if they have the following route.
|
||||
|
||||
1. Route traffic to docker through the docker-machine IP:
|
||||
|
||||
```shell
|
||||
sudo route -n add -net 172.17.0.0 $(docker-machine ip kube-dev)
|
||||
```
|
||||
|
||||
Since the docker-machine IP can change when the VM is restarted, this route may need to be updated over time.
|
||||
To delete the route later: `sudo route delete 172.17.0.0`
|
||||
|
||||
|
||||
## Walkthrough
|
||||
|
||||
1. Checkout source
|
||||
|
||||
```shell
|
||||
git clone https://github.com/kubernetes/kubernetes
|
||||
cd kubernetes
|
||||
```
|
||||
|
||||
By default, that will get you the bleeding edge of master branch.
|
||||
You may want a [release branch](https://github.com/kubernetes/kubernetes/releases) instead,
|
||||
if you have trouble with master.
|
||||
|
||||
1. Build binaries
|
||||
|
||||
You'll need to build kubectl (CLI) for your local architecture and operating system and the rest of the server binaries for linux/amd64.
|
||||
|
||||
Building a new release covers both cases:
|
||||
|
||||
```shell
|
||||
KUBERNETES_CONTRIB=mesos build/release.sh
|
||||
```
|
||||
|
||||
For developers, it may be faster to [build locally](#build-locally).
|
||||
|
||||
1. [Optional] Build docker images
|
||||
|
||||
The following docker images are built as part of `./cluster/kube-up.sh`, but it may make sense to build them manually the first time because it may take a while.
|
||||
|
||||
1. Test image includes all the dependencies required for running e2e tests.
|
||||
|
||||
```shell
|
||||
./cluster/mesos/docker/test/build.sh
|
||||
```
|
||||
|
||||
In the future, this image may be available to download. It doesn't contain anything specific to the current release, except its build dependencies.
|
||||
|
||||
1. Kubernetes-Mesos image includes the compiled linux binaries.
|
||||
|
||||
```shell
|
||||
./cluster/mesos/docker/km/build.sh
|
||||
```
|
||||
|
||||
This image needs to be built every time you recompile the server binaries.
|
||||
|
||||
1. [Optional] Configure Mesos resources
|
||||
|
||||
By default, the mesos-slaves are configured to offer a fixed amount of resources (cpus, memory, disk, ports).
|
||||
If you want to customize these values, update the `MESOS_RESOURCES` environment variables in `./cluster/mesos/docker/docker-compose.yml`.
|
||||
If you delete the `MESOS_RESOURCES` environment variables, the resource amounts will be auto-detected based on the host resources, which will over-provision by > 2x.
|
||||
|
||||
If the configured resources are not available on the host, you may want to increase the resources available to Docker Engine.
|
||||
You may have to increase you VM disk, memory, or cpu allocation. See the Docker Machine docs for details
|
||||
([Virtualbox](https://docs.docker.com/machine/drivers/virtualbox))
|
||||
|
||||
|
||||
1. Configure provider
|
||||
|
||||
```shell
|
||||
export KUBERNETES_PROVIDER=mesos/docker
|
||||
```
|
||||
|
||||
This tells cluster scripts to use the code within `cluster/mesos/docker`.
|
||||
|
||||
1. Create cluster
|
||||
|
||||
```shell
|
||||
./cluster/kube-up.sh
|
||||
```
|
||||
|
||||
If you manually built all the above docker images, you can skip that step during kube-up:
|
||||
|
||||
```shell
|
||||
MESOS_DOCKER_SKIP_BUILD=true ./cluster/kube-up.sh
|
||||
```
|
||||
|
||||
After deploying the cluster, `~/.kube/config` will be created or updated to configure kubectl to target the new cluster.
|
||||
|
||||
1. Explore tutorials
|
||||
|
||||
To learn more about Pods, Volumes, Labels, Services, and Replication Controllers, start with the
|
||||
[Kubernetes Tutorials](/docs/tutorials/).
|
||||
|
||||
To skip to a more advanced example, see the [Guestbook Example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/guestbook/)
|
||||
|
||||
1. Destroy cluster
|
||||
|
||||
```shell
|
||||
./cluster/kube-down.sh
|
||||
```
|
||||
|
||||
## Addons
|
||||
|
||||
The `kube-up` for the mesos/docker provider will automatically deploy KubeDNS and KubeUI addons as pods/services.
|
||||
|
||||
Check their status with:
|
||||
|
||||
```shell
|
||||
./cluster/kubectl.sh get pods --namespace=kube-system
|
||||
```
|
||||
|
||||
### KubeUI
|
||||
|
||||
The web-based Kubernetes UI is accessible in a browser through the API Server proxy: `https://<apiserver>:6443/ui/`.
|
||||
|
||||
By default, basic-auth is configured with user `admin` and password `admin`.
|
||||
|
||||
The IP of the API Server can be found using `./cluster/kubectl.sh cluster-info`.
|
||||
|
||||
|
||||
## End To End Testing
|
||||
|
||||
Warning: e2e tests can take a long time to run. You may not want to run them immediately if you're just getting started.
|
||||
|
||||
While your cluster is up, you can run the end-to-end tests:
|
||||
|
||||
```shell
|
||||
./cluster/test-e2e.sh
|
||||
```
|
||||
|
||||
Notable parameters:
|
||||
- Increase the logging verbosity: `-v=2`
|
||||
- Run only a subset of the tests (regex matching): `-ginkgo.focus=<pattern>`
|
||||
|
||||
To build, deploy, test, and destroy, all in one command (plus unit & integration tests):
|
||||
|
||||
```shell
|
||||
make test_e2e
|
||||
```
|
||||
|
||||
## Kubernetes CLI
|
||||
|
||||
When compiling from source, it's simpler to use the `./cluster/kubectl.sh` script, which detects your platform &
|
||||
architecture and proxies commands to the appropriate `kubectl` binary.
|
||||
|
||||
ex: `./cluster/kubectl.sh get pods`
|
||||
|
||||
|
||||
## Helpful scripts
|
||||
|
||||
- Kill all docker containers
|
||||
|
||||
```shell
|
||||
docker ps -q -a | xargs docker rm -f
|
||||
```
|
||||
|
||||
- Clean up unused docker volumes
|
||||
|
||||
```shell
|
||||
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
|
||||
```
|
||||
|
||||
## Build Locally
|
||||
|
||||
The steps above tell you how to build in a container, for minimal local dependencies. But if you have Go and Make installed you can build locally much faster:
|
||||
|
||||
```shell
|
||||
KUBERNETES_CONTRIB=mesos make
|
||||
```
|
||||
|
||||
However, if you're not on linux, you'll still need to compile the linux/amd64 server binaries:
|
||||
|
||||
```shell
|
||||
KUBERNETES_CONTRIB=mesos build/run.sh hack/build-go.sh
|
||||
```
|
||||
|
||||
The above two steps should be significantly faster than cross-compiling a whole new release for every supported platform (which is what `./build/release.sh` does).
|
||||
|
||||
Breakdown:
|
||||
|
||||
- `KUBERNETES_CONTRIB=mesos` - enables building of the contrib/mesos binaries
|
||||
- `hack/build-go.sh` - builds the Go binaries for the current architecture (linux/amd64 when in a docker container)
|
||||
- `make` - delegates to `hack/build-go.sh`
|
||||
- `build/run.sh` - executes a command in the build container
|
||||
- `build/release.sh` - cross compiles Kubernetes for all supported architectures and operating systems (slow)
|
||||
|
||||
## Support Level
|
||||
|
||||
|
||||
IaaS Provider | Config. Mgmt | OS | Networking | Docs | Conforms | Support Level
|
||||
-------------------- | ------------ | ------ | ---------- | --------------------------------------------- | ---------| ----------------------------
|
||||
Mesos/Docker | custom | Ubuntu | Docker | [docs](/docs/getting-started-guides/mesos-docker) | | Community ([Kubernetes-Mesos Authors](https://github.com/mesosphere/kubernetes-mesos/blob/master/AUTHORS.md))
|
||||
|
||||
For support level information on all solutions, see the [Table of solutions](/docs/getting-started-guides/#table-of-solutions) chart.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
approvers:
|
||||
- jdef
|
||||
- sttts
|
||||
- thockin
|
||||
|
|
@ -1,341 +0,0 @@
|
|||
---
|
||||
approvers:
|
||||
- jdef
|
||||
title: Kubernetes on Mesos
|
||||
---
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
|
||||
## About Kubernetes on Mesos
|
||||
|
||||
<!-- TODO: Update, clean up. -->
|
||||
|
||||
Mesos allows dynamic sharing of cluster resources between Kubernetes and other first-class Mesos frameworks such as [HDFS][1], [Spark][2], and [Chronos][3].
|
||||
Mesos also ensures applications from different frameworks running on your cluster are isolated and that resources are allocated fairly among them.
|
||||
|
||||
Mesos clusters can be deployed on nearly every IaaS cloud provider infrastructure or in your own physical datacenter. Kubernetes on Mesos runs on-top of that and therefore allows you to easily move Kubernetes workloads from one of these environments to the other.
|
||||
|
||||
This tutorial will walk you through setting up Kubernetes on a Mesos cluster.
|
||||
It provides a step by step walk through of adding Kubernetes to a Mesos cluster and starting your first pod with an nginx webserver.
|
||||
|
||||
**NOTE:** There are [known issues with the current implementation][7] and support for centralized logging and monitoring is not yet available.
|
||||
Please [file an issue against the kubernetes-mesos project][8] if you have problems completing the steps below.
|
||||
|
||||
Further information is available in the Kubernetes on Mesos [contrib directory][13].
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Understanding of [Apache Mesos][6]
|
||||
- A running [Mesos cluster on Google Compute Engine][5]
|
||||
- A [VPN connection][10] to the cluster
|
||||
- A machine in the cluster which should become the Kubernetes *master node* with:
|
||||
- Go (see [here](https://git.k8s.io/community/contributors/devel/development.md) for required versions)
|
||||
- make (i.e. build-essential)
|
||||
- Docker
|
||||
|
||||
**Note**: You *can*, but you *don't have to* deploy Kubernetes-Mesos on the same machine the Mesos master is running on.
|
||||
|
||||
### Deploy Kubernetes-Mesos
|
||||
|
||||
Log into the future Kubernetes *master node* over SSH, replacing the placeholder below with the correct IP address.
|
||||
|
||||
```shell
|
||||
ssh jclouds@${ip_address_of_master_node}
|
||||
```
|
||||
|
||||
Build Kubernetes-Mesos.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/kubernetes-incubator/kube-mesos-framework
|
||||
cd kube-mesos-framework
|
||||
make
|
||||
```
|
||||
|
||||
Set some environment variables.
|
||||
The internal IP address of the master may be obtained via `hostname -i`.
|
||||
|
||||
```shell
|
||||
export KUBERNETES_MASTER_IP=$(hostname -i)
|
||||
export KUBERNETES_MASTER=http://${KUBERNETES_MASTER_IP}:8888
|
||||
```
|
||||
|
||||
Note that KUBERNETES_MASTER is used as the api endpoint. If you have existing `~/.kube/config` and point to another endpoint, you need to add option `--server=${KUBERNETES_MASTER}` to kubectl in later steps.
|
||||
|
||||
### Deploy etcd
|
||||
|
||||
Start etcd and verify that it is running:
|
||||
|
||||
```shell
|
||||
sudo docker run -d --hostname $(uname -n) --name etcd \
|
||||
-p 4001:4001 -p 7001:7001 quay.io/coreos/etcd:v2.2.1 \
|
||||
--listen-client-urls http://0.0.0.0:4001 \
|
||||
--advertise-client-urls http://${KUBERNETES_MASTER_IP}:4001
|
||||
```
|
||||
|
||||
```shell
|
||||
$ sudo docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
fd7bac9e2301 quay.io/coreos/etcd:v2.2.1 "/etcd" 5s ago Up 3s 2379/tcp, 2380/... etcd
|
||||
```
|
||||
|
||||
It's also a good idea to ensure your etcd instance is reachable by testing it
|
||||
|
||||
```shell
|
||||
curl -L http://${KUBERNETES_MASTER_IP}:4001/v2/keys/
|
||||
```
|
||||
|
||||
If connectivity is OK, you will see an output of the available keys in etcd (if any).
|
||||
|
||||
### Start Kubernetes-Mesos Services
|
||||
|
||||
Update your PATH to more easily run the Kubernetes-Mesos binaries:
|
||||
|
||||
```shell
|
||||
export PATH="$(pwd)/_output/local/go/bin:$PATH"
|
||||
```
|
||||
|
||||
Identify your Mesos master: depending on your Mesos installation this is either a `host:port` like `mesos-master:5050` or a ZooKeeper URL like `zk://zookeeper:2181/mesos`.
|
||||
In order to let Kubernetes survive Mesos master changes, the ZooKeeper URL is recommended for production environments.
|
||||
|
||||
```shell
|
||||
export MESOS_MASTER=<host:port or zk:// url>
|
||||
```
|
||||
|
||||
Create a cloud config file `mesos-cloud.conf` in the current directory with the following contents:
|
||||
|
||||
```shell
|
||||
$ cat <<EOF >mesos-cloud.conf
|
||||
[mesos-cloud]
|
||||
mesos-master = ${MESOS_MASTER}
|
||||
EOF
|
||||
```
|
||||
|
||||
Now start the kubernetes-mesos API server, controller manager, and scheduler on the master node:
|
||||
|
||||
```shell
|
||||
$ km apiserver \
|
||||
--address=${KUBERNETES_MASTER_IP} \
|
||||
--etcd-servers=http://${KUBERNETES_MASTER_IP}:4001 \
|
||||
--service-cluster-ip-range=10.10.10.0/24 \
|
||||
--port=8888 \
|
||||
--cloud-provider=mesos \
|
||||
--cloud-config=mesos-cloud.conf \
|
||||
--secure-port=0 \
|
||||
--v=1 >apiserver.log 2>&1 &
|
||||
|
||||
$ km controller-manager \
|
||||
--master=${KUBERNETES_MASTER_IP}:8888 \
|
||||
--cloud-provider=mesos \
|
||||
--cloud-config=./mesos-cloud.conf \
|
||||
--v=1 >controller.log 2>&1 &
|
||||
|
||||
$ km scheduler \
|
||||
--address=${KUBERNETES_MASTER_IP} \
|
||||
--mesos-master=${MESOS_MASTER} \
|
||||
--etcd-servers=http://${KUBERNETES_MASTER_IP}:4001 \
|
||||
--mesos-user=root \
|
||||
--api-servers=${KUBERNETES_MASTER_IP}:8888 \
|
||||
--cluster-dns=10.10.10.10 \
|
||||
--cluster-domain=cluster.local \
|
||||
--v=2 >scheduler.log 2>&1 &
|
||||
```
|
||||
|
||||
Disown your background jobs so that they'll stay running if you log out.
|
||||
|
||||
```shell
|
||||
disown -a
|
||||
```
|
||||
|
||||
#### Validate KM Services
|
||||
|
||||
Interact with the kubernetes-mesos framework via `kubectl`:
|
||||
|
||||
```shell
|
||||
$ kubectl get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
```
|
||||
|
||||
```shell
|
||||
# NOTE: your service IPs will likely differ
|
||||
$ kubectl get services
|
||||
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
k8sm-scheduler 10.10.10.113 <none> 10251/TCP 1d
|
||||
kubernetes 10.10.10.1 <none> 443/TCP 1d
|
||||
```
|
||||
|
||||
Lastly, look for Kubernetes in the Mesos web GUI by pointing your browser to
|
||||
`http://<mesos-master-ip:port>`. Make sure you have an active VPN connection.
|
||||
Go to the Frameworks tab, and look for an active framework named "Kubernetes".
|
||||
|
||||
## Spin up a pod
|
||||
|
||||
Write a JSON pod description to a local file:
|
||||
|
||||
```shell
|
||||
$ cat <<EOPOD >nginx.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
EOPOD
|
||||
```
|
||||
|
||||
Send the pod description to Kubernetes using the `kubectl` CLI:
|
||||
|
||||
```shell
|
||||
$ kubectl create -f ./nginx.yaml
|
||||
pod "nginx" created
|
||||
```
|
||||
|
||||
Wait a minute or two while `dockerd` downloads the image layers from the internet.
|
||||
We can use the `kubectl` interface to monitor the status of our pod:
|
||||
|
||||
```shell
|
||||
$ kubectl get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
nginx 1/1 Running 0 14s
|
||||
```
|
||||
|
||||
Verify that the pod task is running in the Mesos web GUI. Click on the
|
||||
Kubernetes framework. The next screen should show the running Mesos task that
|
||||
started the Kubernetes pod.
|
||||
|
||||
## Launching kube-dns
|
||||
|
||||
Kube-dns is an addon for Kubernetes which adds DNS-based service discovery to the cluster. For a detailed explanation see [DNS in Kubernetes][4].
|
||||
|
||||
The kube-dns addon runs as a pod inside the cluster. The pod consists of three co-located containers:
|
||||
|
||||
- a local etcd instance
|
||||
- the [kube-dns][11] DNS server
|
||||
|
||||
We assume that kube-dns will use
|
||||
|
||||
- the service IP `10.10.10.10`
|
||||
- and the `cluster.local` domain.
|
||||
|
||||
Note that we have passed these two values already as parameter to the apiserver above.
|
||||
|
||||
A template for a replication controller spinning up the pod with the 3 containers can be found at [cluster/addons/dns/kubedns-controller.yaml.in][12] in the repository. The following steps are necessary in order to get a valid replication controller yaml file:
|
||||
|
||||
{% assign dns_replicas = "{{ pillar['dns_replicas'] }}" %}
|
||||
{% assign dns_domain = "{{ pillar['dns_domain'] }}" %}
|
||||
- replace `{{ dns_replicas }}` with `1`
|
||||
- replace `{{ dns_domain }}` with `cluster.local.`
|
||||
- add `--kube_master_url=${KUBERNETES_MASTER}` parameter to the kube2sky container command.
|
||||
|
||||
In addition the service template at [cluster/addons/dns/kubedns-controller.yaml.in][12] needs the following replacement:
|
||||
|
||||
{% assign dns_server = "{{ pillar['dns_server'] }}" %}
|
||||
- `{{ dns_server }}` with `10.10.10.10`.
|
||||
|
||||
To do this automatically:
|
||||
|
||||
```shell{% raw %}
|
||||
sed -e "s/{{ pillar\['dns_replicas'\] }}/1/g;"\
|
||||
"s,\(command = \"/kube2sky\"\),\\1\\"$'\n'" - --kube_master_url=${KUBERNETES_MASTER},;"\
|
||||
"s/{{ pillar\['dns_domain'\] }}/cluster.local/g" \
|
||||
cluster/addons/dns/kubedns-controller.yaml.in > kubedns-controller.yaml
|
||||
sed -e "s/{{ pillar\['dns_server'\] }}/10.10.10.10/g" \
|
||||
cluster/addons/dns/kubedns-svc.yaml.in > kubedns-svc.yaml{% endraw %}
|
||||
```
|
||||
|
||||
Now the kube-dns pod and service are ready to be launched:
|
||||
|
||||
```shell
|
||||
kubectl create -f ./kubedns-controller.yaml
|
||||
kubectl create -f ./kubedns-svc.yaml
|
||||
```
|
||||
|
||||
Check with `kubectl get pods --namespace=kube-system` that 3/3 containers of the pods are eventually up and running. Note that the kube-dns pods run in the `kube-system` namespace, not in `default`.
|
||||
|
||||
To check that the new DNS service in the cluster works, we start a busybox pod and use that to do a DNS lookup. First create the `busybox.yaml` pod spec:
|
||||
|
||||
```shell
|
||||
cat <<EOF >busybox.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: busybox
|
||||
namespace: default
|
||||
spec:
|
||||
containers:
|
||||
- image: busybox
|
||||
command:
|
||||
- sleep
|
||||
- "3600"
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: busybox
|
||||
restartPolicy: Always
|
||||
EOF
|
||||
```
|
||||
|
||||
Then start the pod:
|
||||
|
||||
```shell
|
||||
kubectl create -f ./busybox.yaml
|
||||
```
|
||||
|
||||
When the pod is up and running, start a lookup for the Kubernetes master service, made available on 10.10.10.1 by default:
|
||||
|
||||
```shell
|
||||
kubectl exec busybox -- nslookup kubernetes
|
||||
```
|
||||
|
||||
If everything works fine, you will get this output:
|
||||
|
||||
```shell
|
||||
Server: 10.10.10.10
|
||||
Address 1: 10.10.10.10
|
||||
|
||||
Name: kubernetes
|
||||
Address 1: 10.10.10.1
|
||||
```
|
||||
|
||||
## Support Level
|
||||
|
||||
|
||||
IaaS Provider | Config. Mgmt | OS | Networking | Docs | Conforms | Support Level
|
||||
-------------------- | ------------ | ------ | ---------- | --------------------------------------------- | ---------| ----------------------------
|
||||
Mesos/GCE | | | | [docs](/docs/getting-started-guides/mesos/) | | Community ([Kubernetes-Mesos Authors](https://github.com/mesosphere/kubernetes-mesos/blob/master/AUTHORS.md))
|
||||
|
||||
|
||||
For support level information on all solutions, see the [Table of solutions](/docs/getting-started-guides/#table-of-solutions/) chart.
|
||||
|
||||
## What next?
|
||||
|
||||
Try out some of the standard [Kubernetes examples][9].
|
||||
|
||||
Read about Kubernetes on Mesos' architecture in the [contrib directory][13].
|
||||
|
||||
**NOTE:** Some examples require Kubernetes DNS to be installed on the cluster.
|
||||
Future work will add instructions to this guide to enable support for Kubernetes DNS.
|
||||
|
||||
**NOTE:** Please be aware that there are [known issues with the current Kubernetes-Mesos implementation][7].
|
||||
|
||||
[1]: https://docs.mesosphere.com/latest/usage/service-guides/hdfs/
|
||||
[2]: https://docs.mesosphere.com/latest/usage/service-guides/spark/
|
||||
[3]: https://mesos.github.io/chronos/docs/getting-started.html
|
||||
[4]: https://releases.k8s.io/{{page.githubbranch}}/cluster/addons/dns/README.md
|
||||
[5]: https://dcos.io/docs/latest/administration/installing/cloud/gce/
|
||||
[6]: http://mesos.apache.org/
|
||||
[7]: https://github.com/kubernetes-incubator/kube-mesos-framework/blob/master/docs/issues.md
|
||||
[8]: https://github.com/mesosphere/kubernetes-mesos/issues
|
||||
[9]: https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/
|
||||
[10]: http://open.mesosphere.com/getting-started/cloud/google/mesosphere/#vpn-setup
|
||||
[11]: https://git.k8s.io/kubernetes/cluster/addons/dns/README.md#kube-dns
|
||||
[12]: https://git.k8s.io/kubernetes/cluster/addons/dns/kubedns-controller.yaml.in
|
||||
[13]: https://github.com/kubernetes-incubator/kube-mesos-framework/blob/master/README.md
|
Binary file not shown.
Before Width: | Height: | Size: 87 KiB |
Binary file not shown.
Before Width: | Height: | Size: 43 KiB |
|
@ -33,7 +33,7 @@ a Kubernetes cluster from scratch.
|
|||
|
||||
* [Ubuntu on LXD](/docs/getting-started-guides/ubuntu/local/) supports a nine-instance deployment on localhost.
|
||||
|
||||
* [IBM Cloud Private-CE (Community Edition)](https://github.com/IBM/deploy-ibm-cloud-private) can use VirtualBox on your machine to deploy Kubernetes to one or more VMs for development and test scenarios. Scales to full multi-node cluster.
|
||||
* [IBM Cloud Private-CE (Community Edition)](https://github.com/IBM/deploy-ibm-cloud-private) can use VirtualBox on your machine to deploy Kubernetes to one or more VMs for development and test scenarios. Scales to full multi-node cluster.
|
||||
|
||||
# Hosted Solutions
|
||||
|
||||
|
@ -138,8 +138,6 @@ These solutions are combinations of cloud providers and operating systems not co
|
|||
|
||||
These solutions provide integration with third-party schedulers, resource managers, and/or lower level platforms.
|
||||
|
||||
* [Kubernetes on Mesos](/docs/getting-started-guides/mesos/)
|
||||
* Instructions specify GCE, but are generic enough to be adapted to most existing Mesos clusters
|
||||
* [DCOS](/docs/getting-started-guides/dcos/)
|
||||
* Community Edition DCOS uses AWS
|
||||
* Enterprise Edition DCOS supports cloud hosting, on-premises VMs, and bare metal
|
||||
|
|
Loading…
Reference in New Issue