Author: Dave Krier
This tool will allow you to build really neat Web Demo / Presentation sites so you can deliver kick butt demos and presenations. You may share the links used in your presentation via the link to your demo or you can download a PDF file with all the links and attach it to an email.
-
Docker application (Front End)
You may also run this as a Node.js app
-
Cloudant DB - (Datastore)
Note: You will need to have an IBM Cloud Account to host a CloudantDB
- Log into IBM Public Cloud - https://cloud.ibm.com
- Go to the catalog
- Select Cloudant from the catalog
- provision a cloudant service
- You can name this anything you want and it's ok to accept all the defaults. The lite plan will work just fine for this app.
Once the service is provisioned you will need to configure your database
-
Find your new service in the list of cloud foundry services.
-
Select your service.
-
Click on service credentials.
-
Generate NEW service credentials.
-
You can view the new credentials once you generate it.
-
Save the following information, you will need to provide this informatin to the applciation that will connect to this app.
- host
- password
- username
- url
-
Create a new database named dazzledb
-
Click on the new databse.
-
Click on the plus sign next to the design documents
-
Create a NEW query index
-
Replace the JSON in the index field with the following.
{
"index": {
"fields": [
"timestamp"
]
},
"name": "ts-json-index",
"type": "json"
}
- click on create index
You are now ready to go!!!
- Sensitive information is passed into this application via a Docker environment variable file. You will need to do the following.
-
Clone this repository
-
Create a new file called docker.env in the root of the project folder. Look at the EXAMPLE file called:
RENAME_THIS_TO docker.env EXAMPLE.ONLY
-
Add your userid, password, db url, to the file. You will need to first create a CloudantDB in IBM Cloud Public first.
-
You will need to pass this into the your container using the --env-file param as such:
--env-file=./docker.env
- sensitive information is passed into this application via .env environment variable file. You will need to do the following.
-
Clone this repository
-
Create a new file called .env in the root of the project folder. Look at the EXAMPLE file called:
RENAME_THIS_TO .env EXAMPLE.ONLY
-
Add your userid, password, db url, to the file. You will need to first create a CloudantDB in IBM Cloud Public first.
-
The application will pick up this file on load, so all you need to do is have this file in the root directory and it will pick it up.
It is assumed that you have a kubernetes environment already up and running. In my specific case, I am deploying this to IBM Cloud Private.
-
You must first login and define a Image Pull Policy. To do that you need to log into your ICP admin console. Click on the
Manage
menu item. Then selectResource Security
andImage Policies
. -
Create a new image pull policy with the following settings.
- Name your policy (Can be anything you want)
- Scope: namespace
- Pick your deployment namespace.
- Add your repo url. Because I hosted my container in docker hub I used this format
docker.io/<DockerAccount>/*
- Save your policy.
I used a rather general policy that will allow me to deploy anything from my docker hub account. You may want to be more specific to what you allow. That's up to you.
-
Edit the kubernetes deployment yaml file to map to your repo. I included an EXAMPLE, but you will need to modify it.
- The example yaml file is located in the
kubernetes_deployment
folder. - Modify the namespace (located in two places)
- Modify the image location and tag name (all one line)
- Modify the values for the env prams (db_name, db_full_url, db_userid, db_password, debug)
- The example yaml file is located in the
-
To deploy the application, you will need to issue a kubectl create command like such.
Note: You must fully qualify the path to the yaml or be in the current directory to do the deployment.
kubectl create -f kubernetes_deployment.yaml