• Stars
    star
    138
  • Rank 259,412 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Kubernetes queen - cluster manager

KQueen - Kubernetes cluster manager

https://travis-ci.org/Mirantis/kqueen.svg?branch=master https://coveralls.io/repos/github/Mirantis/kqueen/badge.svg?branch=master https://readthedocs.org/projects/kqueen/badge/?version=master

Overview

More information about KQueen Architecture and use cases is described in RATIONALE file.

Requirements

  • Python v3.6 and higher.
  • Pip v3 and higher.
  • Docker stable release (v17.03 and higher is preferable).
  • Docker-compose stable release (v1.16.0 and higher is preferable).

Demo environment

  • Make sure you can reach Jenkins server defined in JENKINS_API_URL variable in file kqueen/config/prod.py.

  • Run these commands to run Kqueen API and UI in containers.

    docker-compose -f docker-compose.yml -f docker-compose.demo.yml up
    

    or with mounted etcd data directory:

    docker-compose -f docker-compose.etcd-volume.yml -f docker-compose.demo.yml up
    
  • You can login using user admin and password default. Default username and password can be changed in docker-compose.demo.yml file before first start of API.

  • Navigate to UI

Development

  • Install dependencies

    # Debian/Ubuntu
    sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
    
    # RedHat/CentOS:
    sudo yum install python-devel openldap-devel
    
  • Prepare python virtual environment

    python -m ensurepip --default-pip
    pip install --user pipenv
    pipenv --python 3.6
    pipenv install --dev
    
    pipenv shell
    
  • Start docker container with etcd storage

    docker-compose up -d
    
  • Initialize kqueen db: add admin user with default password

    ./bootstrap_admin.py DemoOrg demoorg admin default
    
  • Create directories to store Kqueen data and log files

    mkdir - m 666 /var/log/kqueen-api
    mkdir - m 666 /opt/kqueen
  • Install kubespray or provide path to the existing installation by specifying KS_KUBESPRAY_PATH in the config file

git clone -b v2.5.0 https://github.com/kubernetes-incubator/kubespray.git && \
pip install -r kubespray/requirements.txt
  • You can start KQueen API service directly

    kqueen &
    chrome --new-tab http://127.0.0.1:5000/api/docs/
    
  • Prepare kubernetes config file

Kubernetes configuration file that describes existing cluster can be used in Kqueen. Rename it with kubernetes_remote and place to the root of the project. For test purposes this file can be empty, but should be added manually.

How-to's

  • Clean etcd storage after previous runs

    etcdctl rm --recursive /kqueen
    
  • Add admin user, organization, mock clusters and provisioners to etcd storage at once, execute the following

    ./devenv.py
    
  • To add a single admin user with default password within associated DemoOrg organization in provided demoorg namespace, execute the following

    ./bootstrap_admin.py DemoOrg demoorg admin default
    
  • Test access token. curl, jq should be installed in your system

    TOKEN=$(curl -s -H "Content-Type: application/json" --data '{"username":"admin","password":"default"}' -X POST localhost:5000/api/v1/auth | jq -r '.access_token')
    echo $TOKEN
    curl -H "Authorization: Bearer $TOKEN" localhost:5000/api/v1/clusters
    
  • Set up flask shell for manual testing and debugging

    export FLASK_APP=kqueen.server
    export prometheus_multiproc_dir=$(mktemp -d)
    flask shell
    
  • Update Docker image with code changes

There are two ways to test development changes. First is automatic: create a separate branch and push PR, then TravisCI build image and push it on Docker Hub automatically. Second one is just rebuild kqueen api-image locally:

docker build -t kqueen/api:your_tag .

Configuration

We load configuration from file config/dev.py by default and this can be configured by KQUEEN_CONFIG_FILE environment variable. Any environment variable matching name KQUEEN_* will be loaded and saved to configuration.

Documentation

Full documentation can be found at kqueen.readthedocs.io.

API reference is defined at api.yml and Swagger UI is available at <kqueen_api_url>/api/docs

DEMOs

Generic KQueen Overview

https://img.youtube.com/vi/PCAwCxPQc2A/0.jpg

AKS (Azure) in KQueen

https://img.youtube.com/vi/xHydnJGcs2k/0.jpg

Network policy management in KQueen

The following video provides an overview on how to manage the Calico network policy for a Kubernetes cluster provisioned with Google Kubernetes Engine using KQueen.

https://img.youtube.com/vi/MYXFI75Fm10/0.jpg

More Repositories

1

cri-dockerd

dockerd as a compliant Container Runtime Interface for Kubernetes
Go
1,008
star
2

virtlet

Kubernetes CRI implementation for running VM workloads
Go
735
star
3

k8s-AppController

AppController is a pod that you can spawn in your Kubernetes cluster which will take care of your complex deployments for you.
Go
219
star
4

pipeline-library

Groovy
97
star
5

k8s-externalipcontroller

External IP controller is k8s application which is deployed on top of k8s cluster and which configures External IPs on k8s worker node(s) to provide IP connectivity.
Go
78
star
6

k8s-netchecker-server

Basic network checker service to check DNS and connectivity in kubernetes cluster
Go
67
star
7

compliance

Docker Enterprise Edition Security Controls for Compliance
Go
66
star
8

openstack-lbaas

Load balancing service for OpenStack
Python
53
star
9

criproxy

Multiple CRIs per node & running CRI implementations inside pods
Go
41
star
10

k8s-apps

Kubernetes Helm charts
Go
40
star
11

ceph-lcm

Python
36
star
12

disk_perf_test_tool

Python
36
star
13

reclass-system-salt-model

32
star
14

fuel

Ruby
32
star
15

mk-pipelines

Groovy
27
star
16

launchpad

27
star
17

fuelweb

Python
23
star
18

k8s-daemonupgradecontroller

DaemonSet upgrade controller for kubernetes
23
star
19

k8s-devbox

Reproducible Kubernetes development environment
Shell
19
star
20

mk-lab-salt-model

DEPRECATED - this lab model is outdated and not maintained.
Shell
16
star
21

stepler

Full documentation
Python
15
star
22

mos-integration-tests

Python
14
star
23

lens-extension-cc

A Lens Extension that makes it easy to connect Lens to a Mirantis Container Cloud instance and add its clusters to Lens.
JavaScript
14
star
24

k8s-netchecker-agent

Basic network checker agent to check DNS and connectivity in kubernetes cluster
Go
13
star
25

stackalytics

OpenStack contribution dashboard
Python
12
star
26

openstack-utils

Python
11
star
27

CloudFerry

Openstack workload migration tool
Python
9
star
28

kostyor

Orchestrate OpenStack upgrades
Python
9
star
29

kqueen-ui

Separated UI for https://github.com/Mirantis/kqueen
Python
9
star
30

solar

This repo is OUTDATED!!! We moved to OpenStack
Python
8
star
31

swift-encrypt

Python
8
star
32

mos-horizon

Python
7
star
33

cloudpipe-image-auto-creation

Fully automated cloudpipe image creation
Shell
7
star
34

release-openstack-k8s

Shell
7
star
35

tcp-qa

Python
6
star
36

gosa-openstack

Gosa plugin for managing Nova users
6
star
37

vmware-dvs

Python
6
star
38

dhcp-relay

DHCPv4-Relay (opinionated Golang implementation).
Go
5
star
39

fuel-main

Python
5
star
40

devops

Python
5
star
41

training-lab

Training lab for MCP in Azure
HCL
5
star
42

mcc-on-equinix-terraform-templates

mcc-on-equinix-terraform-templates
HCL
5
star
43

ceph-monitoring

Python
5
star
44

rabbitmq-autocluster

5
star
45

puppet-bootstrap

Bootstrap scripts for Foreman and Puppet servers
Shell
4
star
46

statkube

Kubernetes development stats
Go
4
star
47

openstack-fedora-specs

Shell
4
star
48

fuel-plugin-standalone-ceph

Puppet
4
star
49

nova-scheduler-volume-affinity-filter

Python
4
star
50

terraform-provider-k0sctl

Go
4
star
51

rally-plugins

Custom rally plugins for testing platform components
Python
4
star
52

zabbix-configuration-files

Zabbix configuration files
3
star
53

dataops-dataeng

A tool to scrape data from multiple integrations
Go
3
star
54

fuel-docs

Python
3
star
55

openstack-ha-tests

The repository with HA/destructive tests for OpenStack clouds
Python
3
star
56

telegraf

Go
3
star
57

kostyor-openstack-ansible

OpenStack Ansible driver for Kostyor.
Python
3
star
58

mos-tempest-runner

The repository with scripts which allow to run Tempest tests for OpenStack clouds
Python
3
star
59

security

Home of the Mirantis PSIRT
2
star
60

fuelweb-test

Python
2
star
61

mcp-common-scripts

Shell
2
star
62

stacklight-salt-model

Shell
2
star
63

launchpad-reports-summary

status
JavaScript
2
star
64

ucpbackup

Shell
2
star
65

puppet-savanna

Ruby
2
star
66

terraform-provider-msr

Go
2
star
67

docker-aptly

Shell
2
star
68

fuel-plugin-external-ceph

Puppet
2
star
69

tools-sustaining

Python
2
star
70

osagent

Python agent for Windows that sets password. Works with OpenStack + XCP
Python
2
star
71

astute

Ruby
2
star
72

container-cloud-cli

PowerShell
2
star
73

mos-ci-deployment-scripts

Shell
2
star
74

docker-jenkins

CSS
2
star
75

openstack-lbaas-cli

CLI for OpenStack LBaaS
Python
1
star
76

mirantis-demos

Shell
1
star
77

cvp-configuration

Shell
1
star
78

rpc_monitor

monitoring tools for oslo.messaging
Python
1
star
79

f2s

Python
1
star
80

mos-updates

1
star
81

docker-gerrit

CSS
1
star
82

openstack-k8s-virtual-lab

Shell
1
star
83

solar-qa

1
star
84

cvp-sanity-checks

Python
1
star
85

rundeck-cis-jobs

1
star
86

mira-ceph-ansible

Python
1
star
87

puppet-control-template

Generic template for Puppet Control repository
Ruby
1
star
88

fuel-provision

1
star
89

bird-containers

Shell
1
star
90

whale

Python
1
star
91

mos-components-ci

Shell
1
star
92

k8s-istio-webinar

Shell
1
star
93

k8srnd-sockshop-catalogue

Go
1
star
94

fuel-plugin-backup

Shell
1
star
95

ifmap-python-client

Python
1
star
96

rally

1
star
97

sriov-scheduler

Go
1
star
98

terraform-provider-mirantis

This is Mirantis' terraform module containing providers for all Mirantis products
Go
1
star
99

helm-charts

Smarty
1
star
100

ccp-docker-jenkins

Shell
1
star