Code Monkey home page Code Monkey logo

cloud-portal's Introduction

Cloud Portal

Build Status Code Analysis

Overview

Self service web portal supporting multiple Cloud providers and use cases.

Self Service Cloud Portal - Use Case #1

Providers

Provisioners

Features

  • LDAP authentication & authorization
  • Use case provisioning with Hashicorp's Terraform
  • Provisioning history
  • Automated deprovisioning with terraform destroy (by expiration dates)
  • Execute bootstrap scripts for automated server configuration
  • Send HTML emails with customizable velocity templates and Terraform log data as attachment
  • Responsive WebUI with generic variable rendering
  • Optimized RESTful WebServices and CLI client for CD pipeline integrations
  • Dashboards showing important provisioning metrics
  • Scripting console exposing business logic services for Groovy scripting

Prerequisites

Usage

Client

  • See README.md file of cloud-portal-client module

Server

  • See README.md file of cloud-portal-server module

cloud-portal's People

Contributors

chrisipa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-portal's Issues

Add localization options to vm creation

Locale

Bash

sudo locale-gen "de_DE.UTF-8"
sudo update-locale LANG="de_DE.UTF-8"

Powershell

Set-WinUILanguageOverride -Language de-DE

Keyboard Layout

Bash

sudo sed -i 's|'XKBMODEL=.*'|'XKBMODEL=pc105'|g' /etc/default/keyboard
sudo sed -i 's|'XKBLAYOUT=.*'|'XKBLAYOUT=de'|g' /etc/default/keyboard

Powershell

Set-WinUserLanguageList -LanguageList DE-DE

Timezone

Bash

sudo timedatectl set-timezone Europe/Berlin

Powershell

Set-TimeZone -Name "W. Europe Standard Time"

Java Client Application

Please write a Java client application which is operating system agnostic. This will make it easier to integrate the client into a Continuous Delivery Pipeline in Jenkins running on Windows or MacOS.

Do not overwrite provisioning log entries

Provision log entries get overwritten if a virtual machine is deprovisioned successfully. So the creation log entry will disappear from the list which is bad in terms of auditability.

It would be possible to add a parent or child id to a provisioning log entry.

Switch to official terraform vsphere provider

Be aware: The user you use for your connection will need a lot of different rights for vcenter.

Example:

provider "vsphere" {
  user = "my_username"
  password = "my_password"
  vsphere_server = "my.server.url"
  allow_unverified_ssl = true
  version = "~> 1.1"
}

data "vsphere_datacenter" "dc" {
  name = "my_datacenter_name"
}

data "vsphere_datastore" "datastore" {
  name          = "my_datastore_name"
  datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

data "vsphere_resource_pool" "pool" {
  name          = "my_resource_pool"
  datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

data "vsphere_network" "network" {
  name          = "my_network"
  datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

data "vsphere_virtual_machine" "template" {
  name          = "my_template"
  datacenter_id = "${data.vsphere_datacenter.dc.id}"
}

resource "vsphere_virtual_machine" "vm" {

  name             = "my_vm"
  resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
  datastore_id     = "${data.vsphere_datastore.datastore.id}"

  num_cpus = 2
  memory   = 1024
  guest_id = "${data.vsphere_virtual_machine.template.guest_id}"
  folder = "my/folder/path"

  network_interface {
    network_id = "${data.vsphere_network.network.id}"
  }

  disk {
    name = "my_vm.vmdk"
    size = 20
  }

  clone {
    template_uuid = "${data.vsphere_virtual_machine.template.id}"    
  }  
}

output "datacenter id" {
    value = "${data.vsphere_datacenter.dc.id}"
}

output "datastore id" {
    value = "${data.vsphere_datastore.datastore.id}"
}

output "resource pool id" {
    value = "${data.vsphere_resource_pool.pool.id}"
}

output "network id" {
    value = "${data.vsphere_network.network.id}"
}

output "template id" {
    value = "${data.vsphere_virtual_machine.template.id}"
}

See also:

Additional disks for vsphere VMs

  • The VM templates from vpshere have a fixed disk size
  • When provisioning VMs these templates are simply cloned
  • The clones will have the same VM size
  • Support additional disks for data storage
  • The current disk can be used for storing the OS and packages

Optimize documentation

  • Create real world example for docker-compose
  • Add hint: Project under heavy development: Data structures and configuration mechanisms are not fixed right now

Change deprovisioning algorithm

  • Maybe it's to hard to destroy a vm directly:
    • Shutdown vm first
    • Move to quarantine
    • Destroy after a special period of time
  • It could also be helpful to inform a user by mail

Create Virtual Machine > Authenticaton > Pubkey authentication

What: Setting only a public ssh key for provisioning should be possible.
This enables the user to directly use the VM without providing his private key.

How: Provisioning might be done with a randomly created ssh keypair, that will be deleted after successfull provisioning while the users public key will be added to the authorized keys.

Main Reasons: Providing your own private ssh key is unintuitive and potentially unsecure.

Additional VM Images

Add support for different flavours of Linux and Windows:

  • Debian
  • Red Hat Enterprise Linux
  • CentOS
  • Windows Server 2012

Allow parent use cases

  • It's pretty obvious that use cases can be dependant from each other, e.g:
    • Create a virtual machine on vsphere
    • Install Jenkins application on that machine (also see issue #44)
  • Here it could make sense to specify a parent child relationsship between use cases:
    • The application has to make sure that the use cases are provisioned in the correct order, e.g.: First VM then Jenkins
    • The results of a use case provisioning has to be accessible from a dependant provisioning job, e.g.: IP of the VM

Add support for ansible playbooks for bootstrapping

  • Create playbook.yml file:
- hosts: all
  vars:
    jenkins_hostname: 192.168.0.1
  roles:
    - role: geerlingguy.java
      become: yes
    - role: geerlingguy.jenkins
      become: yes
  • Parse playbook.yml for ansible galaxy roles
  • Use ansible-galaxy install to download roles
ansible-galaxy --ignore-certs install geerlingguy.jenkins
  • Execute ansible-playbook:
ansible-playbook -i 192.168.0.1, --extra-vars ansible_ssh_user=my_user --extra-vars ansible_sudo_pass='my_pass' --extra-vars ansible_python_interpreter=/usr/bin/python3 playbook.yml

Support for workflow actions

Refactor application to allow different workflow actions after provisioning. Create initial mechanism for workflow actions.

Ideally Workflow actions (like email delivery) should be created by implementing a generic workflow action interface.

Maintenance mode for zero downtime deployments

An example for a zero downtime deployment could look like this:

  • Provisioning jobs are saved in a queue
  • If maintenance mode is active no new jobs will be executed
  • Deployment script for application waits until all provisioning jobs have finished
  • Deployment is performed and maintenance mode will be deactivated

Support for prepare and cleanup scripts

Allow an admin to configure scripts before and after user script execution:

  1. Execute prepare script (can be used to install common tools etc)
  2. Execute bootstrap script from user
  3. Execute cleanup script

Use cloud-portal from docker-compose: Login error

use docker-compose.yml

mongodb:
  image: mongo:3.4.10
  volumes:
   - /srv/docker/cloud-portal/data:/data/db

tomcat:
  image: chrisipa/cloud-portal:latest
  links: 
  - mongodb
  environment:    
  - TOMCAT_SESSION_TIMEOUT=720
  - application.title=Cloud Portal
  - application.admin.group=my-admin-group
  - encryptor.secret=my-encryptor-secret
  - ldap.base.dn=dc=example,dc=com
  - ldap.group.attribute=memberOf
  - ldap.login.attribute=userPrincipalName
  - ldap.password=password
  - ldap.principal=cn=m y-admin-user,ou=users,dc=example,dc=com
  - ldap.url.string=ldap://192.168.0.62:389
  - ldap.user.search.filter=
  - [email protected]
  - mail.host=smtp.gmail.com
  - mail.send=true
  - spring.data.mongodb.uri=mongodb://mongodb:27017/cloud-portal
  volumes:
  - /srv/docker/cloud-portal/logs:/opt/tomcat/log
  ports:
   - "80:8080"
   - "443:8443"

Where [email protected] - Login E-mail,
password - Password

LDAP server - working

{'groups': [('cn=my-admin-group,dc=example,dc=com',
             {'cn': ['my-admin-group'],
              'description': ['my-admin-group'],
              'gidNumber': ['1'],
              'objectClass': ['posixGroup', 'top']})],
 'orgs': [('ou=Cloud Portal,dc=example,dc=com',
           {'description': ['Cloud Portal'],
            'objectClass': ['organizationalUnit', 'top'],
            'ou': ['Cloud Portal']}),
          ('ou=users,dc=example,dc=com',
           {'description': ['users'],
            'objectClass': ['organizationalUnit', 'top'],
            'ou': ['users']})],
 'users': [('cn=m y-admin-user,ou=users,dc=example,dc=com',
            {'cn': ['m y-admin-user'],
             'gidNumber': ['1'],
             'givenName': ['m'],
             'homeDirectory': ['/home/my-admin-user'],
             'initials': ['m.y.'],
             'loginShell': ['/bin/bash'],
             'mail': ['[email protected]'],
             'objectClass': ['inetOrgPerson', 'posixAccount', 'top'],
             'sn': ['y-admin-user'],
             'uid': ['my-admin-user'],
             'uidNumber': ['1002'],
             'userPassword': ['{SSHA}K7D/LX91DPJnIn+EHTCHsOpo+b0RUipL']})]}

/cloud-portal/login?error

here is my mistake?

OPEN LDAP authentication

getting invalid credential error while making an authentication to the application any idea how to fix it

Externalize provisioning worker into it's own microservice

In a corporate environment you often have the following scenario:

  • You generally have quite strict firewall and security policies
  • The Cloud self service portal is deployed in a central datacenter
  • The target environments for provisionings could be located in decentralized company sites
  • Maybe it's not allowed to open that communication from the central Cloud self service portal to that environments

Possible solution:

  • Externalize a provisioning worker service which is running on each site where a target environment is located
  • Provisioning jobs are routed to that provisioning workers

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.