Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker-test #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docker-test/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RUNDECK_IMAGE=rundeck/rundeck:SNAPSHOT
BUILD_DEV_IMAGE=rundeckpro/env-builder:latest

RUNDECK_USER=admin
RUNDECK_PASSWORD=admin
27 changes: 27 additions & 0 deletions docker-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Docker rundeck environment

Use this environment to test the plugin
You need a kubernetes environment configured in your host machine (`$HOME/.kube/config`)
That config will be shared with the container

## Copy the plugin

In the root folder
````
./gradlew build
cp build/libs/kubernetes-X.Y.Z.zip docker-test/rundeck/plugins
````

## Run the environment

```
cd docker-test
docker-compose build
docker-compose up -d
```

## Access the environment

* go to http://localhost:4440/
* you will see a project called `Kubernetes-Demo` with resource model , node executor, and jobs configured

6 changes: 6 additions & 0 deletions docker-test/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG BUILD_DEV_IMAGE
FROM ${BUILD_DEV_IMAGE}

RUN mkdir -p /app/data
COPY projects /app/data/projects/
COPY import.yml /app/data/import.yml
7 changes: 7 additions & 0 deletions docker-test/client/import.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
projects:
- name: Kubernetes-Demo
archive: projects/Kubernetes-Demo.rdproject.jar

users:
- username: alice
email: alice@rundeck.io
Binary file not shown.
63 changes: 63 additions & 0 deletions docker-test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version: '3'
services:
rundeck:
container_name: rundeck
build:
context: rundeck
args:
RUNDECK_IMAGE: ${RUNDECK_IMAGE:-rundeck/rundeck:SNAPSHOT}
links:
- mysql
environment:
RUNDECK_GRAILS_URL: http://rundeck:4440
RUNDECK_SERVER_ADDRESS: 0.0.0.0
RUNDECK_MULTIURL_ENABLED: "true"
RUNDECK_SERVER_FORWARDED: "true"
RUNDECK_DATABASE_DRIVER: org.mariadb.jdbc.Driver
RUNDECK_DATABASE_USERNAME: rundeck
RUNDECK_DATABASE_PASSWORD: rundeck
RUNDECK_DATABASE_URL: jdbc:mariadb://mysql/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
RUNDECK_SECURITY_DBLOGIN_ENABLED: 'true'
RUNDECK_SECURITY_DBLOGIN_CREATEADMINUSERANDROLES: 'true'
RUNDECK_SECURITY_DBLOGIN_ADMINUSERNAME: ${RUNDECK_USER:-admin}
RUNDECK_SECURITY_DBLOGIN_ADMINPASSWORD: ${RUNDECK_PASSWORD:-admin}
RUNDECK_PLUGIN_CLUSTER_REMOTEEXECUTION_ENABLED: 'false'
ports:
- 4440:4440
volumes:
- $HOME/.kube/config:/home/rundeck/.kube/config
mysql:
container_name: mysql
image: mysql:8
ports:
- 33065:3306
cap_add:
- SYS_NICE # CAP_SYS_NICE reduces error messages in console
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: rundeck
MYSQL_USER: rundeck
MYSQL_PASSWORD: rundeck
ulimits:
nofile:
soft: 20000
hard: 40000
command: --max-connections=1000


client:
container_name: client
build:
context: client
args:
BUILD_DEV_IMAGE: ${BUILD_DEV_IMAGE:-rundeckpro/env-builder:latest}
environment:
CONFIG_FILE: /app/data/import.yml
CONFIG_FILES_PATH: /app/data
RUNDECK_URL: http://rundeck:4440
RUNDECK_API_URL: http://rundeck:4440
RUNDECK_USER: ${RUNDECK_USER:-admin}
RUNDECK_PASSWORD: ${RUNDECK_PASSWORD:-admin}



17 changes: 17 additions & 0 deletions docker-test/rundeck/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG RUNDECK_IMAGE
FROM ${RUNDECK_IMAGE}

USER root
RUN sudo apt-get update
RUN sudo apt-get install -y -qq --no-install-recommends wget git curl jq iputils-ping sysstat

RUN apt-get -y install python3-pip && \
pip3 install --upgrade pip

RUN ln -s /usr/bin/python3 /usr/bin/python

RUN pip3 install kubernetes

USER rundeck

COPY plugins/. /home/rundeck/libext
3 changes: 3 additions & 0 deletions docker-test/rundeck/plugins/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Hidden file to allow an empty-ish folder to show on GitHub.

9/15/2021 version 1.4.1: This folder should be blank as of this version/date. It can be used to include custom plugins in the Rundeck build.