Skip to content

Commit

Permalink
Update docs for v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
morningspace committed Sep 19, 2019
1 parent e490281 commit 9ceb1b5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 25 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,30 @@ Keywords: Kubernetes, Container, DIND, Vagrant

This lab project is a playground for you to play with Kubernetes easily and efficiently.

It includes an `All-in-One Playground` that can launch a multi-node cluster with configurable Kubernetes version on your local machine in minutes even without network connectivity!
It includes an `All-in-One Playground` that can launch a multi-node cluster with configurable Kubernetes version on your local machine in minutes in a repeatable manner even without network connectivity!

* If you want to try the `All-in-One Playground`, please refer to ["The All-in-One Kubernetes Playground Overview"](/docs/All-in-One-Playground-Overview.md), ["The All-in-One Kubernetes Playground Usage Guide"](/docs/All-in-One-Playground-Usage-Guide.md) or ["All-in-One K8S Playground中文使用指南"](https://morningspace.github.io/tech/all-in-one-k8s-playground/).
* If you want to know what is the magic behind, please refer to ["Launch multi-node Kubernetes cluster locally in one minute, and more..."](https://morningspace.github.io/tech/k8s-run/), and the video series on [YouTube](https://www.youtube.com/watch?v=0uVdF3Inv48&list=PLVQM6jLkNkfqHgd0aX7TnjioOiQrqsXIa) or [YouKu](https://v.youku.com/v_show/id_XNDI2Mzk1NDcyMA==.html?f=52221532).
* If you want to start in a funny way, please take look at this [`special function`](https://morningspace.github.io/lab-k8s-playground/docs/slides/#/10/1) written in shell script and taken from the online ["Introduction Slides"](https://morningspace.github.io/lab-k8s-playground/docs/slides).
* If you want to start in a funny way, please take look at this [`special function`](https://morningspace.github.io/lab-k8s-playground/docs/slides/#/11/1) written in shell script and taken from the online ["Introduction Slides"](https://morningspace.github.io/lab-k8s-playground/docs/slides).

More cool features will be coming soon... Have Fun!

## Demos

Below are demos created based on the `All-in-One Playground`.

> Use Dashboard, Grafana, Kiali, Jaeger when run Istio Bookinfo demo app.
> Use [Dashboard](https://github.com/kubernetes/dashboard), [Grafana](https://grafana.com), [Kiali](https://www.kiali.io), [Jaeger](https://www.jaegertracing.io) when run [Istio](https://istio.io) [Bookinfo](https://istio.io/docs/examples/bookinfo) demo app.
![](/docs/demo-apps.gif)

> Run Kubernetes-related command line tools from both normal terminal and web terminal.
![](/docs/demo-tools.gif)

> Re-launch Kubernetes cluster and deploy Helm where there is no network connectivity.
> Re-launch Kubernetes cluster and deploy [Helm](https://helm.sh) where there is no network connectivity.
![](/docs/demo-offline.gif)

> Launch [API Connect](https://developer.ibm.com/apiconnect) on top of Kubernetes cluster in the All-in-One Playground.
![](/docs/demo-apic.gif)
36 changes: 24 additions & 12 deletions docs/APIC-Quick-Guide.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Quick Guide to Launch APIC Playground

This guide will work you through the steps to launch [IBM API Connect(APIC)](https://www.ibm.com/support/knowledgecenter/en/SSMNED_2018/mapfiles/getting_started.html) on top of the All-in-One Kubernetes Playground for a cluster with 3 worker nodes on a single machine!
> This guide also has a Chinese version: [把API Connect关进All-in-One K8S Playground里](https://morningspace.github.io/tech/all-in-one-apic-playground/).
## API Connect

[IBM API Connect(APIC)](https://developer.ibm.com/apiconnect) is an integrated API management offering, with capabilities and tooling for all phases of the API lifecycle. It is built on top of the great open source project [LoopBack](https://loopback.io/) as a platform for building APIs and microservices in Node.js.

The standard APIC installation is a bit complicated. Depends on its system resource requirements, e.g. CPU, memory, disk volume, it usually requires multiple virtual or bare metal machines and takes hours or even days to finish the deployment. For more details, please refer to its [Documentation](https://www.ibm.com/support/knowledgecenter/SSMNED_2018/mapfiles/getting_started.html).

As an advanced usage case of the open source project [lab-k8s-playground](https://github.com/morningspace/lab-k8s-playground), this guide will work you through the steps to launch APIC using the [All-in-One Kubernetes Playground](https://github.com/morningspace/lab-k8s-playground/) on top of a multi-node Kubernetes cluster on a single machine in minutes with only 5 steps in a repeatable manner!

![](demo-apic.gif)

## Step 1. Prepare the playground
## Step 1. Initialize the playground

Clone the playground repository, go into the repository root directory, run command to init the environment:
```shell
Expand All @@ -23,7 +31,7 @@ export K8S_VERSION=v1.15
export NUM_NODES=3
```

Reload `.bashrc` to apply your change, enable bash completion and other features in current login session:
Reload `.bashrc` to apply your changes, enable bash completion and other features in current login session:
```shell
$ . ~/.bashrc
```
Expand All @@ -44,18 +52,20 @@ portal-images-kubernetes_lts_v2018.4.1.4.tgz

> Here, `$LAB_HOME` refers to the repository root directory.
## Step 3. Review and change APIC settings
> You can find the APIC installation packages from the official IBM download site. That will not be covered in this guide.
## Step 3. Change and review APIC settings

Specify APIC hostnames and other settings in below file as needed:
You can specify APIC hostnames and other settings in below file as needed:
```shell
$ vi $LAB_HOME/install/targets/apic/settings.sh
```

You can set `apic_skip_load_images` to `1` in `settings.sh` after the first launch, to skip the step of loading APIC images into local private registry because you don't have to repeat that if the registry has already been provisioned. To skip this can make the launch faster.
You can set `apic_skip_load_images` to `1` in `settings.sh` after the first launch to skip the step of loading APIC images into local private registry because you don't have to repeat that if the registry has already been provisioned. To skip this can make the launch faster.

If you are interested in APIC settings customization, please check [Appendix: Customize APIC settings](#appendix-customize-apic-settings)
If you are interested in APIC settings customization, please refer to [Appendix: Customize APIC settings](#appendix-customize-apic-settings)

## Step 4. Launch Kubernetes and APIC
## Step 4. Launch APIC

Run command to launch Kubernetes and install Helm:
```shell
Expand All @@ -64,18 +74,18 @@ $ launch default helm

> After finished, you can run `kubectl version` and `helm version` to verify if everything works fine.
> Run `export IS_IN_CHINA=1` before `launch` if you are located in China who cannot pull images from Google website that are required by the cluster.
> Run `export IS_IN_CHINA=1` before `launch` if you are located in China who cannot pull images from Google site that are required by the cluster.
Then, deploy APIC:
Then, launch APIC:
```shell
$ launch apic
```

It takes time to finish the launch which depends on your system configuration, e.g., on my virtual machine, it usually takes less than 15 minutes to finish all the work before I can use.
It takes time to finish the launch which depends on your system configuration, e.g., on my virtual machine, when `apic_skip_load_images` is set to `1`, it usually takes less than 15 minutes to finish all the work before I can use.

> After finished, you can run `kubectl get pods -n apiconnect` to verify if all APIC pods are deployed correctly.
If you want to destroy the current cluster for whatever reason and re-launch a new one, please run below command:
If you want to destroy the current cluster for whatever reason and re-launch a new one, just run below command:
```shell
$ launch apic::clean kubernetes::clean registry::up kubernetes helm apic
```
Expand Down Expand Up @@ -109,3 +119,5 @@ data-storage-size-gb 10 ✘ data-storage-size-gb must be 200 or greater
```

It indicates the `data-storage-size-gb` used by `analytics` subsystem must be 200 or greater. You can ignore these failures if you are sure the specified value is sufficient for you to launch APIC in your particular environment.

Have fun!
12 changes: 10 additions & 2 deletions docs/All-in-One-Playground-Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The below applications are deployed along with the playground for you to evaluat
* [Kiali](https://www.kiali.io)
* [Jaeger](https://www.jaegertracing.io)
* [Prometheus](https://prometheus.io)
* [IBM API Connect](https://www.ibm.com/cloud/api-connect), for more details, please refer to [Quick Guide to Launch APIC Playground](APIC-Quick-Guide.md)
* [IBM API Connect](https://www.ibm.com/cloud/api-connect), for more details, please refer to [Quick Guide to Launch APIC Playground](APIC-Quick-Guide.md) or [把API Connect关进All-in-One K8S Playground里](https://morningspace.github.io/tech/all-in-one-apic-playground/)

## Tools

Expand All @@ -27,7 +27,7 @@ The below Kubernetes-related command line tools are integrated with the playgrou
* [kubetail](https://github.com/johanhaleby/kubetail)
* [kube-shell](https://github.com/cloudnativelabs/kube-shell)

## Private Registry
## Private Registries

The playground runs a set of private registries that can be used to mimic below public container regiestries:
* [Google Container Registry](https://gcr.io)
Expand All @@ -38,6 +38,14 @@ By storing all images into private registries, it can boost your playground laun

For more details, please refer to ["Can I launch the playground without network?"](All-in-One-Playground-Usage-Guide.md#can-i-launch-the-playground-without-network), ["Can I share private registries with others?"](All-in-One-Playground-Usage-Guide.md#can-i-share-private-registries-with-others).

## Operating Systems

The playground can be launched in:
* [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/)

## Launch

The playground provides a Vagrant Box out of the box that can be launched by a single line of command. Meanwhile, it can also be launched on your host machine directly.
Expand Down
15 changes: 8 additions & 7 deletions docs/Launch-Utility-Usage-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ The `Launch Utility` supports many pre-defined targets. They are listed as below

| Target | Description
| ---- |:----
|apic | Deploy [IBM API Connect](https://developer.ibm.com/apiconnect) to the playground
|base | As a special target, will launch target docker, docker-compose, kubectl
|default | As a special target, will launch target base, registry, kubernetes
|docker | Install docker
|docker-compose | Install docker-compose
|endpoints | List all application endpoints available in the playground with healthiness status
|helm | Install helm
|helm | Install [helm](https://helm.sh)
|init | Initialize the playground environment
|istio | Deploy istio
|istio-bookinfo | Deploy istio demo app: bookinfo
|kubectl | Install kubectl
|istio | Deploy [istio](https://istio.io)
|istio-bookinfo | Deploy istio demo app: [bookinfo](https://istio.io/docs/examples/bookinfo)
|kubectl | Install [kubectl](https://kubernetes.io/docs/reference/kubectl)
|kubernetes | Manipulate kubernetes cluster
|registry | Manipulate private container registries
|registry-proxy | Manipulate private container registries that work as proxies to connect to their remote peers
Expand All @@ -47,22 +48,22 @@ Some targets may have multiple commands available for you to call, e.g. target `
|down | Stop the cluster but do not clean up the storage
|init | Initialize and bring up the cluster
|snapshot | Create snapshot for current running cluster
|up | Launch the cluster from snapshot
|up | Bring up the cluster

To call a particular command when launch a target, use the below format:
```shell
$ launch <target_name>::<command_name>
```

For example, this is to launch a cluster from snapshot:
For example, this is to bring up a cluster:
```shell
$ launch kubernetes::up
```

For the supported commands of other targets, you can explore by yourself using the `Launch Utility` auto-completion feature, e.g.:
```shell
$ launch registry::<tab><tab>
down init up
docker.io down init mr.io up
```

Typing two `<tab>`s after `::` will list all available commands of target `registry`.
Expand Down

0 comments on commit 9ceb1b5

Please sign in to comment.