From d477779df3a25b91a7c6d8e4a1bb0e52d5b549dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kukr=C3=A1l?= Date: Fri, 13 Oct 2017 10:31:43 +0200 Subject: [PATCH 1/4] use cluster kqueen-testing for in devenv script --- devenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devenv.py b/devenv.py index 0234680c..a9816cab 100755 --- a/devenv.py +++ b/devenv.py @@ -10,7 +10,7 @@ uuid_local = '2d51891a-adac-4bbc-a725-eed20cc67849' uuid_provisioner_jenkins = 'e8de24b0-43d1-4a3c-af55-7b1d3f700554' uuid_provisioner_local = '203c50d6-3d09-4789-8b8b-1ecb00814436' -kubeconfig_url = 'https://ci.mcp.mirantis.net/job/deploy-aws-k8s_ha_calico/199/artifact/kubeconfig' +kubeconfig_url = 'https://ci.mcp.mirantis.net/job/deploy-aws-k8s_ha_calico_sm/33/artifact/kubeconfig' try: From c1479fd8a0c80ed7ec1eb1d99e27c97163f2e9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kukr=C3=A1l?= Date: Fri, 13 Oct 2017 10:40:37 +0200 Subject: [PATCH 2/4] move rational to separate file + add link to readthedocs --- RATIONALE.md | 43 +++++++++++++++++++++++++++++++++++++++++++ README.md | 48 ++++-------------------------------------------- 2 files changed, 47 insertions(+), 44 deletions(-) create mode 100644 RATIONALE.md diff --git a/RATIONALE.md b/RATIONALE.md new file mode 100644 index 00000000..057574be --- /dev/null +++ b/RATIONALE.md @@ -0,0 +1,43 @@ +# Rationale + +Kubernetes is today's probably the most promising container orchestration platform and it is gaining huge momentum. There are many different installation tools and hosted solutions: + +* [Kubespray](https://github.com/kubernetes-incubator/kubespray) +* [Kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/) +* [Kubernetes Salt formula](https://github.com/salt-formulas/salt-formula-kubernetes) + + +* [Google Container engine](https://cloud.google.com/container-engine) +* [Azure Container Service](https://azure.microsoft.com/en-us/services/container-service/) + + +There is no need to develop new installation method because we already have many sufficient solutions and Kubernetes instllation isn't a rocket science. +However, there are still customers strugling to integrate Kubernetes because of missing solution for complex orchestration of multiple clusters. In this document we aim to address these problems and propose architecture. + +## User stories + +I'm application **developer** and I'd like to have a tool to quickly spin-up the cluster and run my application on it. I have multiple applications and need to have multiple clusters for different application. It would be nice to have a possibility to run diffirent application versions in on cluster. + +I'm KaaS administration and I need be able to manage all the clusters for our internal customers. I need to list then, control resources and get basic overview about each cluster. I can do administration manualy but I'd like to be able to kill some dead minions and replace them easily. Autoscaling clusters (with predefined range) would be a nice bonus. + + +## Architecture + +We have one central backend service (called *queen*) and this service listens for user requests (via API) and can orchestrate and operate clusters. + +### Required actions - MVP + +* **Create cluster** - This action will be used to deploy new clusters. However, *queen* service don't deploy cluster on it's own but I uses another service (Jenkins, GKE, ..) to create this cluster. +* **Read cluster information** - Read information about new (and existing) cluster and provide this information to users and administrators. This information must include endpoint for Kubernetes API server and all required credentials (token, basic auth or certificates) +* **Deploy application** - This will connect to cluster and deploy the application. TODO: define format (apply YAMLs, Helm, ...) +* **Delete cluster** - destroy the cluster + +### Additional actions + +* **Check** - read cluster information and give information about node usage and running workload +* **Scale** - add or remove minions +* **Backup** - backup resources in cluster and provide guidance for PV backup +* **Update** - install newer version of Kubernetes +* **Autoscale** - watch Kubernetes scheduler or pods and start new minions when all existing minions are fully utilized +* **Manage addons** - enable or disable cluster addons + diff --git a/README.md b/README.md index 45525ec9..b9e88865 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# KaaS +# KQueen - Kubernetes cluster manager + [![Build Status](https://travis-ci.org/Mirantis/kqueen.svg?branch=master)](https://travis-ci.org/Mirantis/kqueen) [![PyPI version](https://badge.fury.io/py/kqueen.svg)](https://badge.fury.io/py/kqueen) [![Coverage Status](https://coveralls.io/repos/github/Mirantis/kqueen/badge.svg?branch=master)](https://coveralls.io/github/Mirantis/kqueen?branch=master) @@ -21,47 +22,6 @@ We load configuration from file `config_dev.py` by default and this can be confi | --- | --- | --- | --- | | `KQUEEN_CONFIG_FILE` | Environment variable | `config_dev.py` | Configuration file to load | +## Documentation -## Rationale - -Kubernetes is today's probably the most promising container orchestration platform and it is gaining huge momentum. There are many different installation tools and hosted solutions: - -* [Kubespray](https://github.com/kubernetes-incubator/kubespray) -* [Kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/) -* [Kubernetes Salt formula](https://github.com/salt-formulas/salt-formula-kubernetes) - - -* [Google Container engine](https://cloud.google.com/container-engine) -* [Azure Container Service](https://azure.microsoft.com/en-us/services/container-service/) - - -There is no need to develop new installation method because we already have many sufficient solutions and Kubernetes instllation isn't a rocket science. -However, there are still customers strugling to integrate Kubernetes because of missing solution for complex orchestration of multiple clusters. In this document we aim to address these problems and propose architecture. - -## User stories - -I'm application **developer** and I'd like to have a tool to quickly spin-up the cluster and run my application on it. I have multiple applications and need to have multiple clusters for different application. It would be nice to have a possibility to run diffirent application versions in on cluster. - -I'm KaaS administration and I need be able to manage all the clusters for our internal customers. I need to list then, control resources and get basic overview about each cluster. I can do administration manualy but I'd like to be able to kill some dead minions and replace them easily. Autoscaling clusters (with predefined range) would be a nice bonus. - - -## Architecture - -We have one central backend service (called *queen*) and this service listens for user requests (via API) and can orchestrate and operate clusters. - -### Required actions - MVP - -* **Create cluster** - This action will be used to deploy new clusters. However, *queen* service don't deploy cluster on it's own but I uses another service (Jenkins, GKE, ..) to create this cluster. -* **Read cluster information** - Read information about new (and existing) cluster and provide this information to users and administrators. This information must include endpoint for Kubernetes API server and all required credentials (token, basic auth or certificates) -* **Deploy application** - This will connect to cluster and deploy the application. TODO: define format (apply YAMLs, Helm, ...) -* **Delete cluster** - destroy the cluster - -### Additional actions - -* **Check** - read cluster information and give information about node usage and running workload -* **Scale** - add or remove minions -* **Backup** - backup resources in cluster and provide guidance for PV backup -* **Update** - install newer version of Kubernetes -* **Autoscale** - watch Kubernetes scheduler or pods and start new minions when all existing minions are fully utilized -* **Manage addons** - enable or disable cluster addons - +For full documenation please refer to [kqueen.readthedocs.io](http://kqueen.readthedocs.io). From 1ab7d841510e9c1216ad137ff851b53cc03ee0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kukr=C3=A1l?= Date: Fri, 13 Oct 2017 11:23:16 +0200 Subject: [PATCH 3/4] add sphinx-autobuild --- docs/Makefile | 3 +++ requirements.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/docs/Makefile b/docs/Makefile index 0635f3c2..3accfbb0 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,6 +14,9 @@ help: .PHONY: help Makefile +livehtml: + sphinx-autobuild -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile diff --git a/requirements.txt b/requirements.txt index 5f9afbf2..2eedf986 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,4 +15,5 @@ pytest pytest-cov pytest-flask sphinx +sphinx-autobuild sphinx_rtd_theme From 8ec8018a27c0fb0a15659a450538efe97330d9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kukr=C3=A1l?= Date: Fri, 13 Oct 2017 11:23:40 +0200 Subject: [PATCH 4/4] make documentation little nicer --- docs/index.rst | 2 +- docs/kqueen.blueprints.rst | 2 +- docs/kqueen.provisioners.rst | 6 ++--- docs/kqueen.rst | 48 +++++++++++++++--------------------- docs/kqueen.storages.rst | 4 +-- 5 files changed, 27 insertions(+), 35 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 6dab5fe0..8502c7cd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,7 @@ Welcome to kqueen's documentation! ================================== .. toctree:: - :maxdepth: 2 + :maxdepth: 3 :caption: Contents: kqueen diff --git a/docs/kqueen.blueprints.rst b/docs/kqueen.blueprints.rst index 3c9eae2e..bfdcef78 100644 --- a/docs/kqueen.blueprints.rst +++ b/docs/kqueen.blueprints.rst @@ -1,4 +1,4 @@ -kqueen\.blueprints package +Flask blueprints ========================== Subpackages diff --git a/docs/kqueen.provisioners.rst b/docs/kqueen.provisioners.rst index f8e489fb..9765137e 100644 --- a/docs/kqueen.provisioners.rst +++ b/docs/kqueen.provisioners.rst @@ -1,10 +1,10 @@ -kqueen\.provisioners package -============================ +Provisioners +============= Submodules ---------- -kqueen\.provisioners\.jenkins module +JenkinsProvisioner ------------------------------------ .. automodule:: kqueen.provisioners.jenkins diff --git a/docs/kqueen.rst b/docs/kqueen.rst index 66845790..e2afb0fb 100644 --- a/docs/kqueen.rst +++ b/docs/kqueen.rst @@ -1,27 +1,17 @@ kqueen package ============== -Subpackages ------------ - -.. toctree:: - - kqueen.blueprints - kqueen.provisioners - kqueen.storages -Submodules ----------- +Models +------- -kqueen\.config\_dev module --------------------------- - -.. automodule:: kqueen.config_dev +.. automodule:: kqueen.models :members: :undoc-members: :show-inheritance: -kqueen\.kubeapi module + +Kubernetes API ---------------------- .. automodule:: kqueen.kubeapi @@ -29,15 +19,15 @@ kqueen\.kubeapi module :undoc-members: :show-inheritance: -kqueen\.models module +Server --------------------- -.. automodule:: kqueen.models +.. automodule:: kqueen.server :members: :undoc-members: :show-inheritance: -kqueen\.helpers module +Helpers ----------------------- .. automodule:: kqueen.helpers @@ -45,8 +35,7 @@ kqueen\.helpers module :undoc-members: :show-inheritance: - -kqueen\.serializers module +Serializers -------------------------- .. automodule:: kqueen.serializers @@ -54,15 +43,8 @@ kqueen\.serializers module :undoc-members: :show-inheritance: -kqueen\.server module ---------------------- -.. automodule:: kqueen.server - :members: - :undoc-members: - :show-inheritance: - -kqueen\.wrappers module +Wrappers ----------------------- .. automodule:: kqueen.wrappers @@ -70,6 +52,16 @@ kqueen\.wrappers module :undoc-members: :show-inheritance: +Subpackages +----------- + +.. toctree:: + + kqueen.blueprints + kqueen.provisioners + kqueen.storages + + Module contents --------------- diff --git a/docs/kqueen.storages.rst b/docs/kqueen.storages.rst index f026573a..f2c4e55f 100644 --- a/docs/kqueen.storages.rst +++ b/docs/kqueen.storages.rst @@ -1,10 +1,10 @@ -kqueen\.storages package +Model storages ======================== Submodules ---------- -kqueen\.storages\.etcd module +Etcd ----------------------------- .. automodule:: kqueen.storages.etcd