Skip to content

Commit

Permalink
OpenStack Kubespray engine
Browse files Browse the repository at this point in the history
This engine can provision k8s cluster in OpenStack using kubespray.
  • Loading branch information
Sergey Skripnick committed Jun 26, 2018
1 parent d9c8d85 commit ea78be9
Show file tree
Hide file tree
Showing 9 changed files with 716 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ ENV/
# ViM swp files
*.swp

#vscode project files
.vscode

# NPM asset dir
node_modules/

Expand Down
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* && \
mkdir /var/log/kqueen-api

# install kubespray
RUN git clone -b v2.5.0 https://github.com/kubernetes-incubator/kubespray.git && \
pip install -r kubespray/requirements.txt

# copy app
COPY . .
RUN pip install .
COPY . kqueen
RUN pip install ./kqueen

ENV KQUEEN_KS_KUBESPRAY_PATH /code/kubespray
ENV KQUEEN_KS_ANSIBLE_CMD /usr/local/bin/ansible
ENV KQUEEN_KS_ANSIBLE_PLAYBOOK_CMD /usr/local/bin/ansible-playbook

# run app
WORKDIR /code/kqueen
CMD ./entrypoint.sh
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include kqueen/config/default_policy.json
include kqueen/utils/logger_config.yml
include kqueen/engines/resources/heat/kubespray/*
10 changes: 10 additions & 0 deletions docs/kqueen.engines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ ManualEngine
:undoc-members:
:show-inheritance:
:exclude-members: app


OpenstackKubesprayEngine
------------------------

.. automodule:: kqueen.engines.openstack_kubespray
:members:
:undoc-members:
:show-inheritance:
:exclude-members: app
11 changes: 11 additions & 0 deletions kqueen/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ class BaseConfig:
KQUEEN_HOST = '127.0.0.1'
KQUEEN_PORT = 5000

POOL_MAX_WORKERS = 64

# Kubespray settings
KS_FILES_PATH = "/tmp/kqueen"
KS_KUBESPRAY_PATH = "/tmp/kubespray"
KS_SSH_CMD = "/usr/bin/ssh"
KS_SSH_KEYGEN_CMD = "/usr/bin/ssh-keygen"
KS_ANSIBLE_CMD = "/usr/bin/ansible"
KS_ANSIBLE_PLAYBOOK_CMD = "/usr/bin/ansible-playbook"
KS_DEFAULT_NAMESERVERS = "1.1.1.1,8.8.8.8"

# etcd settings
# ETCD_HOST
# ETCD_PORT
Expand Down
4 changes: 3 additions & 1 deletion kqueen/engines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
from .manual import ManualEngine
from .gce import GceEngine
from .aks import AksEngine
from .openstack_kubespray import OpenstackKubesprayEngine

__all__ = ['JenkinsEngine', 'ManualEngine', 'GceEngine', 'AksEngine']
__all__ = ['JenkinsEngine', 'ManualEngine', 'GceEngine',
'AksEngine', 'OpenstackKubesprayEngine']
Loading

0 comments on commit ea78be9

Please sign in to comment.