Skip to content

Commit

Permalink
Add spring boot example and add to roadmap
Browse files Browse the repository at this point in the history
  • Loading branch information
wallies committed Jun 9, 2015
1 parent cb578a1 commit cbb78c6
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 8 deletions.
20 changes: 20 additions & 0 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ Mesos Frameworks
- [ ] Chronos framework
- [ ] Kubernetes framework
- [ ] Cassandra framework
- [ ] Myriad framework
- [ ] Spark framework
- [ ] Storm framework
- [ ] Mysos framework
- [ ] Elastiseach framework
- [ ] Mesosaurus framework
- [ ] Kafka framework

Providers
---------
Expand All @@ -28,25 +31,42 @@ Operating Systems
- [x] Ubuntu
- [ ] CentOS
- [ ] Fedora
- [ ] CoreOS

Features
--------
- [ ] Easier pluggability for frameworks
- [ ] Move all services to Docker containers
- [ ] Monitoring and alerts(nodes/services)
- [ ] Logging (nodes/services)
- [ ] Metrics (nodes/services)
- [ ] Distributed File storage (for nodes/services)
- [ ] Multi-Datacenter
- [ ] Multi-Cloud
- [ ] Autoscaling of Mesos slave nodes

Security
--------
- [ ] Manage Linux user accounts with Consul + Vault
- [ ] ACLs and encrpytion for Consul
- [ ] Encrypt network traffic with Weave
- [ ] Authentication and authorization for Mesos
- [ ] Authentication and authorization for Marathon
- [ ] Application dynamic firewalls (using consul template)
- [ ] Network and Data encryption with IPsec
- [ ] Utilise Docker Audit Toolkit in CI
- [ ] Add AppArmor to docker containers

Demonstrators / Examples
------------------------
- [ ] Continous Deployment with Marathon
- [ ] Mule ESB
- [ ] Drupal / MySQL
- [ ] Wordpress / MySQL
- [ ] Simple NodeJS webservice
- [x] Spring Boot microservice
- [ ] Jmeter
- [ ] API Management

Documentation
-------------
Expand Down
46 changes: 46 additions & 0 deletions examples/spring-boot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Spring Boot example

This example shows how to deploy spring boot application using Apollo and Marathon Mesos framework.

The example includes -

* A custom spring boot application

We'll use the [spring-boot](https://registry.hub.docker.com/_/mysql/) [Docker](https://www.docker.com/) image.

The examples are to be deployed on top of the Marathon Mesos framework.

### Start the Spring Boot Application

Start the services by running the following command (from somewhere you can access the REST interface of Marathon). Replace $MARATHON_IP with the actual hostname/ip address of the marathon instance.
Marathon by default should be deployed in the ```mesos_master``` nodes.

```
curl -X POST -HContent-Type:application/json -d @spring-boot.json http://$MARATHON_IP:8080/v2/apps
```

The service will be accessible through the HAProxy container (on port 80) at ```drupal.example.com``` by default. It is recommended that you set up your own DNS servers / hostname and override the ```haproxy_domain``` in [../roles/haproxy/defaults/main.yml](../roles/haproxy/defaults/main.yml).

### For cloud instances

To access the Spring Boot application, go to the Marathon dashboard at ```http://$MARATHON_IP:8080/#apps``` and click on ```/spring```. You should see an IP address and Port in the service definition, if you click on it you should be redirected to the spring boot application.

### For Vagrant only

If you are deploying this example in the Vagrant environment, simply add the following entry to your host machine in ```/etc/hosts```

```
172.31.1.14 spring.example.com
```

Where ```172.31.1.14``` is the Slave IP address configured in ```vagrant.yml```
If you access ```drupal.example.com``` through your browser that will hit the Haproxy container
running on the slave machine which will forward the traffic to the Drupal docker container.

### Removing the apps

You can remove the applications straight from the command line by running -

```
curl -XDELETE http://$MARATHON_IP:8080/v2/apps/spring-boot
```
31 changes: 31 additions & 0 deletions examples/spring-boot/spring-boot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"id": "/spring-boot",
"container": {
"docker": {
"type": "DOCKER",
"image": "capgemini/apollo-spring-boot:1.0.0",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 8080,
"hostPort": 0,
"protocol": "tcp"
}
]
}
},
"healthChecks": [{
"protocol": "TCP",
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"portIndex": 0,
"timeoutSeconds": 15,
"maxConsecutiveFailures": 3
}],
"env": {
"SERVICE_NAME": "spring-boot"
},
"cpus": 1,
"mem": 128.0,
"instances": 1
}
11 changes: 3 additions & 8 deletions terraform/aws-public/elb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@ resource "aws_elb" "web" {

listener {
instance_port = 80
instance_protocol = "tcp"
instance_protocol = "http"
lb_port = 80
lb_protocol = "tcp"
lb_protocol = "http"
}

health_check {
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 3
target = "HTTP:34180/haproxy_status"
target = "HTTP:80/"
interval = 30
}

instances = ["${aws_instance.mesos-slave.*.id}"]
cross_zone_load_balancing = true
}

resource "aws_proxy_protocol_policy" "http" {
load_balancer = "${aws_elb.web.name}"
instance_ports = ["80"]
}

0 comments on commit cbb78c6

Please sign in to comment.