Skip to content

Commit

Permalink
Expanded cloud example and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ProTip committed Aug 18, 2018
1 parent ea41b2d commit 180f966
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
4 changes: 4 additions & 0 deletions cloud/.env.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Set pro options if applicable
# RUNDECK_IMAGE=rundeckpro/team:SNAPSHOT
# RUNDECK_LICENSE_FILE=

AWS_CREDENTIALS=
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_BUCKET=
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_REGION=
Expand Down
2 changes: 2 additions & 0 deletions cloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG RUNDECK_IMAGE

FROM ${RUNDECK_IMAGE:-rundeck/rundeck:SNAPSHOT}

COPY --chown=rundeck:rundeck ./libext ./libext
19 changes: 18 additions & 1 deletion cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ This exhibit demonstrates what a typical cloud or multi-server
deployment may look like.

On display:
* Running Rundeck behind a reverse proxy
* Storage backend connected to a database server
* Execution logs stored in S3
* Bundling extra plugins

### Reverse proxy
This configuration exposes rundeck at `http://localhost:80` through nginx.
A similiar setup is possible behind a cloud provider proxy, such as AWS ELB[v2],
and the key is the `RUNDECK_SERVER_FORWARDED=true` environment variable which instructs
Rundeck to respect the standard `X-Forwarded-*` headers.

## Setup
**Fetch S3 log plugin**
Expand All @@ -18,5 +24,16 @@ wget https://github.com/rundeck-plugins/rundeck-s3-log-plugin/releases/download/
```

**Populate `.env` file**
```bash
cp .env.dist .env
vim .env
```

`docker-compose up`
**Build and Up**
> **NOTE:** Building is not necessary the first time, however
it will be to use newer or different images after the
first build.
```
docker-compose build
docker-compose up
```
18 changes: 15 additions & 3 deletions cloud/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,36 @@ version: '3'

services:
rundeck:
build: ./
build:
context: ./
args:
RUNDECK_IMAGE: ${RUNDECK_IMAGE:-rundeck/rundeck:SNAPSHOT}
links:
- mysql
environment:
RUNDECK_GRAILS_URL: http://localhost
RUNDECK_SERVER_FORWARDED: 'true'
RUNDECK_DATABASE_DRIVER: com.mysql.jdbc.Driver
RUNDECK_DATABASE_USERNAME: rundeck
RUNDECK_DATABASE_PASSWORD: rundeck
RUNDECK_DATABASE_URL: jdbc:mysql://mysql/rundeck?autoReconnect=true&useSSL=false
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE: org.rundeck.amazon-s3
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE: com.rundeck.rundeckpro.amazon-s3
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_BUCKET: ${RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_BUCKET}
RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_REGION: ${RUNDECK_PLUGIN_EXECUTIONFILESTORAGE_S3_REGION}
RUNDECK_STORAGE_CONVERTER_1_CONFIG_PASSWORD: ${RUNDECK_STORAGE_PASSWORD}
RUNDECK_CONFIG_STORAGE_CONVERTER_1_CONFIG_PASSWORD: ${RUNDECK_STORAGE_PASSWORD}
volumes:
- data:/home/rundeck/server/data
- ${AWS_CREDENTIALS}:/home/rundeck/.aws/credentials
- ${RUNDECK_LICENSE_FILE:-/dev/null}:/home/rundeck/etc/rundeckpro-license.key
nginx:
image: nginx
links:
- rundeck
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- 4440:4440
- 80:80
mysql:
image: mysql:5.7
expose:
Expand Down
17 changes: 17 additions & 0 deletions cloud/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
events {
worker_connections 1024;
}

http {
server {
location / {
proxy_pass http://rundeck:4440;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
}
}
}

0 comments on commit 180f966

Please sign in to comment.