Git Product home page Git Product logo

dockube-nfs's Introduction

DocKube K8S

Docker container for Kubernetes deployment tools (via Kubespray).

==========================================================================
'########:::'#######:::'######::'##:::'##:'##::::'##:'########::'########:
 ##.... ##:'##.... ##:'##... ##: ##::'##:: ##:::: ##: ##.... ##: ##.....::
 ##:::: ##: ##:::: ##: ##:::..:: ##:'##::: ##:::: ##: ##:::: ##: ##:::::::
 ##:::: ##: ##:::: ##: ##::::::: #####:::: ##:::: ##: ########:: ######:::
 ##:::: ##: ##:::: ##: ##::::::: ##. ##::: ##:::: ##: ##.... ##: ##...::::
 ##:::: ##: ##:::: ##: ##::: ##: ##:. ##:: ##:::: ##: ##:::: ##: ##:::::::
 ########::. #######::. ######:: ##::. ##:. #######:: ########:: ########:
........::::.......::::......:::..::::..:::.......:::........:::........::
--------------------------------------------------------------------------

Features

  • Docker Container Environment
  • Kubespray (K8S Deployment)
  • Ansible
  • Portainer (Docker UI Tools)

How To Run DocKube

  • Setup Environment
    cp .env.example .env
    
  • Customize your own environment .env
  • Copy your public-key (id_rsa.pub) to each ssh-key in services folder.
  • Setup your own environment DocKube deployment in dockube-build.sh file.
    ENV="0"                    # container environment (0 = development, 1 = staging, 2 = production)
    SKIP_BUILD="0"             # (0 = with build process, 1 = bypass build process)
    REMOVE_CACHE="0"           # (0 = using cache, 1 = no-cache)
    RECREATE_CONTAINER="0"     # (0 = disable recreate container, 1 = force recreate container)
    DAEMON_MODE="1"            # (0 = disable daemon mode, 1 = running daemon mode / background)
    
    USERNAME=`echo $USER`
    PATH_HOME=`echo $HOME`
    
    CONTAINER_PRODUCTION="portainer k8s-master1 k8s-master2 k8s-node1 k8s-node2 k8s-node3 k8s-nfs workspace"
    CONTAINER_STAGING="portainer k8s-master1 k8s-master2 k8s-node1 k8s-node2 k8s-node3 k8s-nfs"
    CONTAINER_DEVELOPMENT="portainer k8s-master1 k8s-node1"
    
  • Running DocKube Services:
    make [services]:
      - dockube-run:    Running Container DocKube
      - compose-build:  Build spesific container services
      - compose-up:     Start all container
      - dockube-stop:   Stop all container DocKube
      - dockube-down:   Delete all container DocKube
    

How To Run Kubespray

  • Copy your public-key (id_rsa.pub) to each ssh-key in services folder.
  • Clone Repository Kubespray from our repo dockube/kubespray.
    Go to `workspace` folder clone `kubespray` from
    `https://github.com/dockube/kubespray`
    -----
    $ cd workspace
    $ git clone https://github.com/dockube/kubespray
    
  • Configure kubespray/ansible.cfg:
    ### Baremetal / AWS / GCP ###
    #remote_user=ubuntu
    
    ### OpenStack / DigitalOcean (DO) / DocKube ###
    remote_user=root
    
  • Setup your own environment kubespray deployment in workspace/kubespray/kubespray.sh file.
    ENV_KEY="0"                # Setup environment key private (0 = Not Used, 1 = DocKube, 2 = Staging, 3 = Production)
    VERBOSE_MODE="0"           # (0 = disable verbose mode, 1 = running verbose mode)
    VERBOSE_COMMAND="-vvv"
    
    INVENTORY_DOCKUBE="inventory/dockube/hosts.ini"
    INVENTORY_STAGING="inventory/k8s-staging/hosts.ini"
    INVENTORY_PRODUCTION="inventory/k8s-production/hosts.ini"
    
    DOCKUBE_PATH_KEY="/opt/keyserver/key-dockube.pem"
    STAGING_PATH_KEY="/opt/keyserver/key-staging.pem"
    PRODUCTION_PATH_KEY="/opt/keyserver/key-prod.pem"
    
  • Running Kubespray Services:
    make [services]:
      - dockube-cluster:      Build K8S cluster in DocKube environment
      - dockube-remove:       Remove K8S cluster in DocKube environment
      - dockube-reset:        Reset all configuration K8S cluster in DocKube environment
      - dockube-scale:        Scale new K8S cluster in DocKube environment
      - dockube-upgrade:      Upgrade K8S cluster in DocKube environment
    
      - staging-cluster:      Build K8S cluster in Staging environment
      - staging-remove:       Remove K8S cluster in Staging environment
      - staging-reset:        Reset all configuration K8S cluster in Staging environment
      - staging-scale:        Scale new K8S cluster in Staging environment
      - staging-upgrade:      Upgrade K8S cluster in Staging environment
    
      - production-cluster:   Build K8S cluster in Production environment
      - production-remove:    Remove K8S cluster in Production environment
      - production-reset:     Reset all configuration K8S cluster in Production environment
      - production-scale:     Scale new K8S cluster in Production environment
      - production-upgrade:   Upgrade K8S cluster in Production environment
    

SSH Docker Container

  • Copy your public-key (id_rsa.pub) to each ssh-key folder.

  • Check Container Running

    docker ps
    
  • Inspect IP Address

    docker inspect [container_id]
    -----
    docker inspect 1486 | grep IP    # container_id: workspace
    "IPAddress": "172.212.0.6"
    
  • Use root account

  • Check Container

    root@1486b2a592b3:~# go version
    go version go1.11.1 linux/amd64
    
    root@1486b2a592b3:~# ansible --version
    ansible 2.0.0.2
      config file = /etc/ansible/ansible.cfg
      configured module search path = Default w/o overrides
    

dockube-nfs's People

Contributors

zeroc0d3 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.