• Stars
    star
    168
  • Rank 225,507 (Top 5 %)
  • Language HCL
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Quickstart guide for Kubernetes on DC/OS

Kubernetes on DC/OS

Kubernetes is now available as a DC/OS package to quickly, and reliably run Kubernetes clusters on Mesosphere DC/OS.

NOTE: The latest dcos-kubernetes-quickstart doesn't support any Kubernetes framework version before 2.0.0-1.12.1. The reason is that now creating Kubernetes clusters requires the installation of the Mesosphere Kubernetes Engine.

Known limitations

Before proceeding, please check the current package limitations.

Pre-Requisites

Check the requirements for running this quickstart:

  • Linux or MacOS
  • Terraform 0.11.x. On MacOS, you can install with brew:
    $ brew install terraform
  • Google Cloud or AWS account with enough permissions to provide the needed infrastructure

Quickstart

Once the pre-requisites are met, clone this repo:

$ git clone [email protected]:mesosphere/dcos-kubernetes-quickstart.git && cd dcos-kubernetes-quickstart

Prepare infrastructure configuration

This quickstart defaults to Google Cloud

First, make sure you have have followed the Google Cloud setup instructions.

Then, start by generating the default infrastructure configuration:

$ make gcp

This will output sane defaults to .deploy/terraform.tfvars. Now, edit said file and set your gcp_project and the ssh_public_key_file (the SSH public key you will use to log-in into your new VMs later).

WARNING: Please, do not set a smaller instance (VM) type on the risk of failing to install Kubernetes.

cluster_name = "dcos-kubernetes"
cluster_name_random_string = true

dcos_version = "1.12.3"

num_of_masters = "1"
num_of_private_agents = "4"
num_of_public_agents = "1"

bootstrap_instance_type = "n1-standard-1"
master_instance_type = "n1-standard-8"
private_agent_instance_type = "n1-standard-8"
public_agent_instance_type = "n1-standard-8"

# admin_ips = "0.0.0.0/0" # uncomment to access master from any IP

gcp_project = "YOUR_GCP_PROJECT"
gcp_region = "us-central1"
ssh_public_key_file = "/PATH/YOUR_GCP_SSH_PUBLIC_KEY.pub"
#
# If you want to use GCP service account key instead of GCP SDK
# uncomment the line below and update it with the path to the key file
# gcp_credentials = "/PATH/YOUR_GCP_SERVICE_ACCOUNT_KEY.json"
#

NOTE: The current release of the DC/OS GCP Terraform module also requires the GOOGLE_PROJECT and GOOGLE_REGION environment variables to be set. Please set them with appropriates values for your deployment:

$ export GOOGLE_PROJECT="YOUR_GCP_PROJECT"
$ export GOOGLE_REGION="us-central1"

Kubernetes configuration

RBAC

NOTE: This quickstart will provision a Kubernetes cluster with RBAC support.

To deploy a cluster with RBAC disabled RBAC update .deploy/options.json:

{
  "service": {
    "name": "dev/kubernetes01"
  },
  "kubernetes": {
    "authorization_mode": "AlwaysAllow"
  }
}

If you want to give users access to the Kubernetes API check documentation.

NOTE: The authorization mode for a cluster must be chosen when installing the package. Changing the authorization mode after installing the package is not supported.

HA Cluster

NOTE: By default, it will provision a Kubernetes cluster with one (1) worker node, and a single instance of every control plane component.

To deploy a highly-available cluster with three (3) private Kubernetes nodes update .deploy/options.json:

{
  "service": {
    "name": "dev/kubernetes01"
  },
  "kubernetes": {
    "high_availability": true,
    "private_node_count": 3
  }
}

Download command-line tools

If you haven't already, please download DC/OS client, dcos and Kubernetes client, kubectl:

$ make get-cli

The dcos and kubectl binaries will be downloaded to the current workdir. It's up to you to decided whether or not to copy or move them to another path, e.g. a path included in PATH.

Install

You are now ready to provision the DC/OS cluster and install the Kubernetes package:

$ make deploy

Terraform will now try and provision the infrastructure on your chosen cloud provider, and then proceed to install DC/OS.

When DC/OS is up and running, the Kubernetes package installation will take place.

Wait until all tasks are running before trying to access the Kubernetes API.

You can watch the progress what was deployed so far with:

$ make watch-kubernetes-cluster

Below is an example of how it looks like when the install ran successfully:

Using Kubernetes cluster: dev/kubernetes01
deploy (serial strategy) (COMPLETE)
   etcd (serial strategy) (COMPLETE)
      etcd-0:[peer] (COMPLETE)
   control-plane (dependency strategy) (COMPLETE)
      kube-control-plane-0:[instance] (COMPLETE)
   mandatory-addons (serial strategy) (COMPLETE)
      mandatory-addons-0:[instance] (COMPLETE)
   node (dependency strategy) (COMPLETE)
      kube-node-0:[kubelet] (COMPLETE)
   public-node (dependency strategy) (COMPLETE)

You can access DC/OS Dashboard and check Kubernetes package tasks under Services:

$ make ui

Exposing the Kubernetes API

Check the exposing Kubernetes API doc to understand how the Kubernetes API gets exposed. To actually expose the Kubernetes API for the new Kubernetes cluster using Marathon-LB, run:

$ make marathon-lb

NOTE: If you have changed in .deploy/terraform.tfvars file the number of num_of_public_agents to more than 1, please scale marathon-lb service to the same number, so you can access Kubernetes API from any DC/OS public agent.

Accessing the Kubernetes API

In order to access the Kubernetes API from outside the DC/OS cluster, one needs to configure kubectl, the Kubernetes CLI tool:

$ make kubeconfig

Let's test accessing the Kubernetes API and list the Kubernetes cluster nodes:

$ ./kubectl --context devkubernetes01 get nodes
NAME                                                  STATUS   ROLES    AGE     VERSION
kube-control-plane-0-instance.devkubernetes01.mesos   Ready    master   5m18s   v1.16.9
kube-node-0-kubelet.devkubernetes01.mesos             Ready    <none>   2m58s   v1.16.9

And now, let's check how the system Kubernetes pods are doing:

$ ./kubectl --context devkubernetes01 -n kube-system get pods
NAME                                                                          READY   STATUS    RESTARTS   AGE
calico-node-s9828                                                             2/2     Running   0          3m21s
calico-node-zc8qw                                                             2/2     Running   0          3m38s
coredns-6c7669957f-rvz85                                                      1/1     Running   0          3m38s
kube-apiserver-kube-control-plane-0-instance.devkubernetes01.mesos            1/1     Running   0          4m43s
kube-controller-manager-kube-control-plane-0-instance.devkubernetes01.mesos   1/1     Running   0          4m42s
kube-proxy-kube-control-plane-0-instance.devkubernetes01.mesos                1/1     Running   0          4m48s
kube-proxy-kube-node-0-kubelet.devkubernetes01.mesos                          1/1     Running   0          3m21s
kube-scheduler-kube-control-plane-0-instance.devkubernetes01.mesos            1/1     Running   0          4m26s
kubernetes-dashboard-5cbf45898-nkjsm                                          1/1     Running   0          3m37s
local-dns-dispatcher-kube-node-0-kubelet.devkubernetes01.mesos                1/1     Running   0          3m21s
metrics-server-594576c7d8-cb4pj                                               1/1     Running   0          3m35s

Accessing the Kubernetes Dashboard

You will be able to access the Kubernetes Dashboard by running:

$ kubectl --context devkubernetes01 proxy

Then pointing your browser at:

http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

Please note that you will have to sign-in into the Kubernetes Dashboard before being able to perform any action.

Uninstall Kubernetes

To uninstall the DC/OS Kubernetes package while leaving your DC/OS cluster up, run:

$ make uninstall

NOTE: This will only uninstall Kubernetes. Make sure you destroy your DC/OS cluster using the instructions below when you finish testing, or otherwise you will need to delete all cloud resources manually!

Destroy cluster

To destroy the whole deployment:

$ make destroy

Last, clean generated resources:

$ make clean

Documentation

For more details, please see the docs folder and as well check the official service docs

Community

Get help and connect with other users on the mailing list or on DC/OS community Slack in the #kubernetes channel.

More Repositories

1

marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
Scala
4,065
star
2

kubernetes-mesos

A Kubernetes Framework for Apache Mesos
641
star
3

cloudkeeper

Resoto creates an inventory of your cloud, provides deep visibility, and reacts to changes in your infrastructure. ⚡️
Python
637
star
4

mesos-dns

DNS-based service discovery for Mesos.
Go
483
star
5

marathon-lb

Marathon-lb is a service discovery & load balancing tool for DC/OS
Python
449
star
6

playa-mesos

Quickly build Mesos sandbox environments using Vagrant. Run apps on top!
Shell
441
star
7

universe

The Mesosphere Universe package repository.
Mustache
303
star
8

chaos

A lightweight framework for writing REST services in Scala.
Scala
251
star
9

RENDLER

A rendering web crawler for Apache Mesos.
Python
246
star
10

marathon-ui

The web-ui for Marathon (https://github.com/mesosphere/marathon)
JavaScript
223
star
11

traefik-forward-auth

Go
214
star
12

mesos-docker

Project has been superseded by native docker support in Mesos
Python
177
star
13

dcos-commons

DC/OS SDK is a collection of tools, libraries, and documentation for easy integration of technologies such as Kafka, Cassandra, HDFS, Spark, and TensorFlow with DC/OS.
Java
156
star
14

reactjs-components

🎨 A library of reusable React components
JavaScript
136
star
15

marathon-autoscale

Simple Proof-of-Concept for Scaling Application running on Marathon based on Utilization
Python
110
star
16

dcos-jenkins-service

Jenkins on DC/OS
Python
73
star
17

serenity

Intel:Mesosphere oversubscription technologies for Apache Mesos
C++
71
star
18

tweeter

A tiny Twitter clone for DC/OS
CSS
68
star
19

mesosaurus

Mesos task load simulator framework for (cluster and Mesos) performance analysis
Scala
59
star
20

mindthegap

Easily create and use bundles for air-gapped environments
Go
58
star
21

reactive-graphql

A GraphQL implementation based around RxJS, very well suited for client side only GraphQL usage
TypeScript
57
star
22

net-modules

Apache Mesos modules for network isolation.
Python
55
star
23

konvoy-training

55
star
24

dcos-vagrant-box

Vagrant box packer for building boxes for dcos-vagrant
Shell
54
star
25

csilvm

A LVM2 CSI plugin
Go
53
star
26

spark-build

Used to build the mesosphere/spark docker image and the DC/OS Spark package
Python
53
star
27

docker-mesos-marathon-screencast

The scripts used in the Docker Clustering on Mesos with Marathon screencast.
Shell
51
star
28

dcos-docs-site

D2iQ Product Documentation and Docs Website Code
SCSS
51
star
29

mesos-rxjava

RxJava client for Apache Mesos HTTP APIs
Java
42
star
30

letsencrypt-dcos

Let's Encrypt DC/OS!
Python
39
star
31

cd-demo

A continuous delivery demo using Jenkins on DC/OS.
Python
36
star
32

etcd-top

etcd realtime workload analyzer
Go
34
star
33

tachyon-mesos

A Mesos Framework for Tachyon, a memory-centric distributed file system.
Scala
32
star
34

dcos-kafka-service

Open source Apache Kafka running on DC/OS
Python
32
star
35

kubernetes-security-benchmark

A simple way to evaluate the security of your Kubernetes deployment against sets of best practices defined by various community sources
Go
29
star
36

coreos-setup

Deprecated. See DCOS Community Edition for how to currently deploy Mesos on CoreOS
28
star
37

cnvs

CNVS (pronounced "Canvas") is a system of user interface elements and components built for use across Mesosphere sites and products. CNVS defines stylistic guidelines for the design and structure of digital interfaces in an effort to ensure consistency in brand and interaction.
CSS
28
star
38

mesos-utils

Utilities for building distributed systems on top of mesos
Scala
24
star
39

scala-sbt-mesos-framework.g8

Scala
23
star
40

marathon-example-plugins

Example Plugins for Marathon Plugin Interface
Scala
22
star
41

star

Test program for network policies.
Rust
19
star
42

charts

D2IQ Helm Chart Repository
Mustache
18
star
43

marathon-client

Java Integration Library for Mesosphere Marathon
Java
17
star
44

marathon-pkg

Packaging utilities for Marathon.
17
star
45

mesos-dns-pkg

Packaging utilities for Mesos-DNS
Makefile
16
star
46

konvoy-image-builder

Go
15
star
47

mom

Mesos on Mesos
Go
15
star
48

dcos-openvpn

14
star
49

kommander-applications

Go
13
star
50

sample_mesos_executor

Sample mesos executor
Scala
13
star
51

dklb

Expose Kubernetes services and ingresses through EdgeLB.
Go
12
star
52

usi

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
Scala
12
star
53

dcos-flink-service

Shell
11
star
54

kubernetes-base-addons

Kubernetes Addon Repository for KSphere
Go
11
star
55

edgerouter

DCOS edgerouter
Python
11
star
56

dcosdev

Python
10
star
57

kudo-spark-operator

KUDO Spark Operator
Shell
10
star
58

jackson-case-class-module

Deserialization support for Scala case classes, including proper handling of default values.
Scala
10
star
59

kudo-cassandra-operator

KUDO Cassandra Operator
Go
10
star
60

mesos-http-adapter

Java
8
star
61

exhibitor-dcos

Exhibitor on DCOS
Shell
8
star
62

ANAGRAMMER

An anagram finder for Apache Mesos
Python
8
star
63

field-notes

7
star
64

cake-builder

Cake Docker Builder
Go
7
star
65

kubeaddons-kommander

Kommander Addon Repository
Go
7
star
66

d2iq-daggers

Collection of tasks and utilities to manage ci-cd pipelines
Go
7
star
67

dcos-helloworld

DCOS HelloWorld subcommand.
Python
6
star
68

docker-screencasts

Shell
6
star
69

chronos-pkg

Makefile
5
star
70

mesos-website-container

Scripts for building docker image for generating mesos.apache.org from sources
Shell
5
star
71

ip_vs_conn

Erlang
5
star
72

docker-mac-network

Shell
5
star
73

d2iq-engineering-blog

Just a techblog test repo for showcasing
SCSS
5
star
74

bun

Command-line program which detects the most common problems in a DC/OS cluster by analyzing its diagnostics bundle
Go
4
star
75

marathon-storage-tool

Marathon Storage Tool
Scala
4
star
76

kubeaddons-enterprise

Enterprise Addon Repository
Python
4
star
77

kubernetes-keygen

Scripts for generating RSA keys and SSL certificates/authorities for use by Kubernetes cluster deployments
Shell
4
star
78

aurora_tutorial

Shell
3
star
79

dispatch-catalog

Dispatch Official Catalog
Python
3
star
80

health-checks-scale-tests

Marathon and Mesos-native health checks testing rig
Python
3
star
81

golang-repository-template

Go
3
star
82

terraform-provider-dcos

a Terraform (http://terraform.io) provider for interacting with Mesosphere DC/OS
Go
3
star
83

marathon-ui-example-plugin

JavaScript
3
star
84

kubeaddons-kaptain

Kubeflow Addons
3
star
85

dynamic-credential-provider

Simplifies using the Kubelet image credential provider feature with multiple cloud infrastructures
Go
2
star
86

dcos-sdk-service-diagnostics

Fetches "SDK Service"-related diagnostics artifacts. Owned by the Data Services and Orchestration teams.
Python
2
star
87

mesosphere-zookeeper

Makefile
2
star
88

mesos-build-images

Shell
2
star
89

dkp-catalog-applications

Makefile
2
star
90

kubernetes-sre-addons

Go
2
star
91

marathon-demo

Resources for Marathon demos
Shell
2
star
92

kubeaddons-community

Community Addon Repository
2
star
93

marathon-integration-tests

A collection of Gatling simulations for Marathon.
Scala
2
star
94

marathon-perf-measurement

2
star
95

marathon-ui-plugin-sdk

2
star
96

dcos-perf-test-driver

💪 The DC/OS Performance and Scale Test Driver
Python
2
star
97

mesos-state-backed-collections

Persistent collection types backed by implementations of the Mesos state API.
Scala
2
star
98

kubeaddons-tests

tests for kubeaddons-enterprise catalog addons
Shell
1
star
99

sre-kommander-applications

Community Helm Releases - used for Demos and Internally
Smarty
1
star
100

cp-docker-images

Python
1
star