dbcloudbin docker and kubernetes support

Why dockerizing DBcloudbin (or any application)? The answer is simple and clear: from DBcloudbin we want to make life easier for our users, and Docker is the way to do it. Here are some reasons that support this idea: 

  1. Container provisioning/deprovisioning is extremely easy for users. 
  2. Avoid third party software installations or software dependency problems (with java versions for example).  
  3. Make the solution more flexible, scalable and cloud-friendly deployment (allowing DBcloudbin deployments in cloud application platforms like Kubernetes). 
  4. Simplify version upgrades: It would be as easy as launch a new container with the new docker image version. 

The running components that make up DBcloudbin installation are mainly two:  

  • DBcloudbin agent, to process all the requests launched by the CLI or indirectly by your application through SQL queries.
  • DBcloudbin CLI tool, to launch the common tasks as executing archive or purge operations. 

Since version 3.04 we are packaging and publishing in Docker Hub both components as images to be used as docker containers. IMPORTANT! This will not avoid the usage of DBcloudbin setup to configure the Database layer and adaptation of your application schema using the regular DBcloudbin install tool (you can request a FREE trial here). However you can install only the first two packages running the setup from any server or laptop with access to your database, and leave the agent and CLI running as Docker containers.

DBcloudbin setup package selection

If you want to know how you can use our Docker images, follow the instructions explained below: 

Agent 

We need to pass in the docker run command the DBcloudbin configuration database as environment variables and an external port if we want (and we should, otherwise the database would not be able to connect with our agent) to expose the docker internal agent port 8090. The available environment variables are:

  • DB_TECH: The database technology. By default ORACLE. Accepted MSSQL for SQL Server environments.
  • DB_HOST: The database server host. By default, “oracle”
  • DB_PORT: The database server port. By default 1521.
  • DB_SERVICE: Only for Oracle connections. the listener service. By default, XEPDB1
  • DB_PASSWORD: Database password credentials for the DBCLOUDBIN user created during setup.
  • DB_CONNECTION: Only for Oracle, as alternative to the DB_HOST, DB_PORT and DB_SERVICE parameters we can define the full database connection (in a jdbc connection string, it would be everything at the right of “jdbc:oracle:thin@”, excluding this prefix).

The command to run it will be: 

Sample agent launch command

docker run –rm -d –name dbcloudbin-agent -p8090:8090 -e DB_HOST=mydbhost  -e DB_SERVICE=ORCLPDB -e DB_PASSWORD=”myverysecret-password” tecknolab/dbcloudbin-agent:3.04.02

IMPORTANT! Our running agent must be reached by our DB host using the name and port defined when we run the setup tool. If this is no longer the case, we need to adjust the address so that our database host is able to correctly resolve the name and port to access our Docker infrastructure and container, use the DBcloudbin setup again in update mode to reconfigure the name and port. 

Command Line Interface (CLI)

After running the DBcloudbin agent, probably we will want to launch some DBcloudbin command using the CLI. To do it with a docker CLI container, it is very simple. There are a few environment variables you may need to use:

  • AGENT_HOST: The host (or container name) where the agent is running. By default, “dbcloudbin-agent”.
  • AGENT_PORT: The advertised agent port, by default 8090.
  • AGENT_PROTOCOL: The protocol used to connect to the agent. By default, “http” but depending how you are using your Docker/Kubernetes infrastructure, you may be using a https network load balancer, so this parameter would be set to https.

Use the CLI with a docker command as the following (for connecting with an agent launched as described above): 

Sample CLI command

docker run –rm -it tecknolab/dbcloudbin-cli:3.04.02 info

With the first launch, a CLI wizard will request us the target database credentials (that is the credentials of your application schema, the one selected in the setup for generating the transparency layer)To avoid introducing your database credentials every time you execute a DBcloudbin command, you must add an external docker volume mapped to the /profiles path. 

Sample with external profiles folder

docker run –rm -it -v /my_profiles:/profiles tecknolab/dbcloudbin-cli:3.04.02 info

You can find the DBcloudbin Docker images in our Docker Hub repository (https://hub.docker.com/r/tecknolab).