The second week began and I was ready to tackle this challenge. I received some handy tips and guidelines from Bjorn for the start of this week. One of them was to use an Ingress on the Kubernetes cluster for better access to my applications. An Ingress will receive all of the incoming traffic and route the requests to the correct application. With the use of the Kubernetes-wiki, which will act as a lifesaver throughout this whole project, it was fairly easy to implement the Ingress on the cluster. The next step will be to add readiness and liveness probes to the backend of the application.
These probes will check every 2 seconds if the application is alive and if it is ready to use, this becomes really handy when impatient users try to access the application when it is still starting. So far I implemented the changes that were advised in about an hour or so, at this pace I will be done with this project in no time, right?
Sadly, this won’t be the truth. My next challenge was to be able to collect the logs of the Kubernetes pods. Hours of research have passed and I managed to deploy an Elasticsearch application combined with Fluentd agents who collects the logs of the Kubernetes pods and sends them back to Elasticsearch. This sounds fairly easy and straightforward if you have some knowledge of this topic. I, on the other hand had Google as my friend. After exploring the depths of the internet, with that I mean the third result page on Google, I found enough information to piece this thing together. For now only the pod logs are being collected. In the future I will need to find a solution to collect the logs of the application itself as well as they are also needed, but that will be a headache for later.
On a happy subject, I was asked to spend a couple of days a week at the other office located in Mechelen. The reason for this was that my mentor Jan will be leaving for a vacation, I guess the rebels called. In the meanwhile, Bjorn will be helping me with my project in Mechelen. Arriving in Mechelen, a beautiful office building was awaiting me. Weirdly it didn’t resemble the Swamps of Dagobah at all. The first challenge that awaited me was getting into the JIDOKA office place. Guarded by 2 doors that require badge authorisation, my chances were slim. Luckily I saw 2 other JIDOKANS walking to the office so I managed to slip in with them.
The office space in Mechelen looks really cool, there’s even a dartboard to settle personal differences among the colleagues. After claiming a spot, I started to work on deploying the frontend of the application. Slowly but surely this application is starting to get shape. The frontend is based on an Angular application, this was fairly easy to deploy as it mostly resembles the Spring boot deployment apart from the different image and port.
Now that the face and the brains of the application were alive, I could start wiring them together. My first problem was that the frontend received a JSON file with a missing environment variable. Basically, the frontend had not received the environment variable with the path of the backend so it didn’t knew where to find the brains. I tried multiple ways of passing this piece of data to the frontend but the problem was that the pod kept overwriting it with the default JSON file. After some consultation with Bjorn, we decided to make a copy of a finished JSON file with all the needed environment variables, and to pass that file with a ConfigMap to the pod. To dodge the problem with overwriting the default file, we changed the code to not deploy a default file as we will be providing the correct file ourselves. As small of a problem as this seemed, it took the majority of a day to fix. It made me realise that there will be days where progress is going to be slower, but as long as there is progress, there is hope.
Before Jan went on his vacation, he left a little present. The present was in the form of a working Kubernetes cluster on AWS. Now I could migrate all of my Kubernetes deployments to the cloud and my little laptop can finally catch a breath.
Looking back on this week, I can confidently say that some good progress was made. If this trend should continue next week, I might have a fully working application on Kubernetes, or everything crashes and burns and I have to start from scratch. Who knows what will happen, tune in next week to find out.