The All-in-One Kubernetes Playground

on GitHub

Watch Star Fork

by MorningSpace

What’s it?

A playground that allows you to launch single or multiple nodes k8s cluster with many popular applications deployed and command line tools integrated on single physical or virtual machine easily, quickly, repeatably, consistently and configurably.
## What it covers?
## Kubernetes Distributions * [Standard Kubernetes](https://kubernetes.io): v1.12, v1.13, v1.14, v1.15 * OpenShift: [OKD](https://www.okd.io/) v3.11, OpenShift 4.x by [CRC](https://code-ready.github.io/crc/)
## Applications * [Kubernetes dashboard](https://github.com/kubernetes/dashboard) * [Istio](https://istio.io) with demo app [bookinfo](https://istio.io/docs/examples/bookinfo) * [Grafana](https://grafana.com) * [Kiali](https://www.kiali.io) * [Jaeger](https://www.jaegertracing.io) * [Prometheus](https://prometheus.io) * [IBM API Connect](https://www.ibm.com/cloud/api-connect)
## Tools * [kubectl](https://kubernetes.io/docs/reference/kubectl) * [helm](https://helm.sh) * [kubectl autocompletion](https://kubernetes.io/docs/tasks/tools/install-kubectl/#optional-kubectl-configurations) * [kubectl aliases](https://github.com/ahmetb/kubectl-aliases) * [kubectx](https://github.com/ahmetb/kubectx) * [kubens](https://github.com/ahmetb/kubectx) * [kubebox](https://github.com/astefanutti/kubebox) * [kubetail](https://github.com/johanhaleby/kubetail) * [oc](https://docs.openshift.com/container-platform/4.2/cli_reference/openshift_cli/getting-started-cli.html)
## Private Registries * [Google Container Registry](https://gcr.io) * [Quay](https://quay.io) * [Docker Hub](https://hub.docker.com)
## Operating Systems * [Ubuntu](https://ubuntu.com/) * [CentOS](https://www.centos.org/) * [RHEL](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) * [MacOS](https://www.apple.com/macos/)
## How it looks?
### Demo: Applications ![](https://morningspace.github.io/lab-k8s-playground/docs/demo-apps.gif)
### Demo: Tools ![](https://morningspace.github.io/lab-k8s-playground/docs/demo-tools.gif)
### Demo: Offline ![](https://morningspace.github.io/lab-k8s-playground/docs/demo-offline.gif)
### Demo: OpenShift ![](https://morningspace.github.io/lab-k8s-playground/docs/demo-oc.gif)
## What’s behind? | Environment | K8S_PROVIDER | Description | ---- | ---- |:---- | Standard Kubernetes | dind | Run Docker in Docker | OpenShift 3.x | oc | Run on host directly | OpenShift 4.x | crc | Run in VM, then on host
## How to launch ## the playground?

Inside vagrant box

$ git clone https://github.com/morningspace/lab-k8s-playground.git
$ vagrant up

Outside vagrant box

$ git clone https://github.com/morningspace/lab-k8s-playground.git
$ ./install/launch.sh init
$ . ~/.bashrc # or re-login from terminal to auto-reload .bashrc
$ launch default

## What else I can do with ## the playground?

Launch Utility

$ launch

Usage: launch [targets]

  Targets are separated by space and launch in order of appearance one by one.

  Special pre-defined targets:
  * base      will launch target docker, docker-compose, and kubectl
  * default   will launch target base, registry, and kubernetes

  e.g.
  launch default tools istio
  launch kubernetes

### Demo: Launch API Connect ![](https://morningspace.github.io/lab-k8s-playground/docs/demo-apic.gif)

Launch cluster from snapshot

$ launch kubernetes::snapshot
$ launch kubernetes::down
$ launch kubernetes::up

## What if images are changed?

Update private reigstries

$ vi ./install/targets/images.list
$ launch registry

## Can I share private registries ## with others?

Use reigstry proxy

$ export REGISTRY_REMOTE=<your_remote_registry_ip>
$ launch registry-proxy

## Can I launch the playground ## without network?
## Live Demo ### Launch Istio and its Bookinfo without network connectivity *With the help of target registry::docker.io*
## Can I customize ## the playground?
## Variant ways you can choose * Kubernetes distribution: `K8S_PROVIDER` * Kubernetes version: `K8S_VERSION` * Number of cluster nodes: `NUM_NODES` * Launch different targets: `launch target1 target2` * Special optimization for users in China: `IS_IN_CHINA` * Write your own targets * ...
## What’s next?

# Just for fun;-) Choose one case then find the link(s) and click!
function to_learn_more {
  case $I_want in
  "to learn what it provides in general")
    cat "All-in-One K8S Playground Overview"
    ;;
  "to get started quickly")
    cat "All-in-One K8S Playground Usage Guide"
    cat "All-in-One K8S Playground 中文使用指南"
    ;;
  "to understand what's behind")
    cat "Launch multi-node k8s cluster locally in one minute, and more..."
    cat "视频教程 - Kubernetes实战: 如何1分钟内在本地启动一个多节点集群"
    cat "OpenShift v3的填坑之旅"
    cat "OpenShift v4的填坑之旅"
    ;;
  "to extend it by myself")
    cat "Launch Utility Usage Guide"
    cat "A Sample Target for Demo Purpose"
    ;;
  "to learn more cool features")
    cat "Quick Guide to Launch APIC Playground"
    cat "把API Connect关进All-in-One K8S Playground里"
    cat "All-in-One K8S Playground新增OpenShift支持"
    cat "All-in-One K8S Playground支持OpenShift v4"
    ;;
  "to contribute back")
    # Feel free to Watch Star and Fork
    git clone https://github.com/morningspace/lab-k8s-playground.git
    ;;
  esac
}

晴耕小筑#晴耕实验室

(MorningSpace Lab)

Created by MorningSpace

github.com/morningspace/lab-k8s-playground

morningspace.github.io