In this workshop, we will work with the Wordsmith application which is the demo project shown at DockerCon EU 2017 and 2018.
NB: Please try to find your own solutions before getting response from the repository.
We have 3 containers to manage for Wordsmith App.
-
db : is a Postgresql database which stores words like Nouns, Adjectives and Verbs.
-
api : is a Java REST API which serves words read from the database and expose them through specific endpoints.
-
web : is a Go web application which calls the api and builds words into sentences
- Clone the project in your local machine.
git clone git@github.com:codeworks-secops/docker-compose-k8s-workshop.git- Checkout the
code-basebranch to start.
git checkout code-base-
Create a new directory named
.dck8sin the root of your local project -
Create a new directory named
composeinside.dck8sdirectory. -
Create a new manifest file named
docker-compose.ymlinside.dck8s/composedirectory. -
Create 3 new services according to the architecture schema :
- db : service to manage Postgresql database docker resources
- api : service to manage API docker resources
- web : service to manage WEB docker resources
-
Play with all commands offered by Docker Compose, like : build, images, ls, up, down, start, stop, logs,...
-
Test your Docker Compose manifest file.
-
Could you see your App deployed ?
-
If you prefer, push your 3 images to the Docker Hub using your personal docker hub access.
-
Create a new directory named
k8sinside.dck8Sdirectory. -
Create 3 new directories named respectively
api,dbandwebinsidek8sdirectory. -
On each directory :
-
Create a new manifest service by project.
-
Create a new manifest deployment by project.
-
-
Tips : use Secret workload to manage sensitive data like postgres user password and database name.
-
Try to respect exposed ports according to the architecture schema.
-
Test all your workloads.
-
Could you access your application ?
-
Could you access your databases from anywhere ?
Change deployment manifest to statefulSet for db project to have persistence status for your Postgres database
Docker Compose : click here
Kubernetes Manifest Deployment : click here
Kubernetes Manifest StatefulSet : click here
