Last updated on August 31, 2022
Whoo! The last couple weeks have been a little intense! As I mentioned in my last post, I mentioned I set up a Jenkins instance and used it to build a project on EC2, in preparation for the interview. I had a few more days before the interview so I also:
- Learned how to build a prometheus instance, and configure it to gather metrics using Node Exporter
- Learned how to build a grafana instance, connect it to prometheus as a data source, and configure plugins and a custom dashboard to view the prometheus data
- Learned how to use eksctl to connect to AWS, then spin up an EC2 EKS cluster, manipulate it, and break it down.
I’m glad I decided to figure out what I could before the interview! I definitely think it gave me a boost, both in terms of showcasing how quickly I can pick up new technologies, and in my own self confidence. The interview went well enough that by that evening I moved on to the next round – a coding assignment!
For the coding assignment, I had three deliverables. First, a custom dockerfile that build a configured postgresql container. Second, a custom dockerfile that builds a configured redmine container. Finally, a kubernetes deployment file in yaml that will launch instances of both containers to minikube, with the front end behind a load balancer. Now, I had a little experience with docker, and some theoretical knowledge about how kubernetes works, but I’d never built a dockerfile, and I’d never run deployed anything to kubernetes. So….time to put in some more work:
- First, I started with the dockerfiles, figuring those would be fairly easy. I went through some tutorials, which helped me understand how dockerfiles run as layers before it creates the final container.
- I then spent quite a bit of time running through how to install the software in a container, and then figuring out how to convert those steps into commands in the dockerfile
- Then I had to debug the actual image builds. There were a number of little problems I kept encountering, particularly with redmine – lots of dependencies, lots of issues with versions of dependencies. I’d never worked with ruby, either, which redmine depends on. It took a while, but finally I was able to build and run both images.
- Next – how does minikube work? I read up on the documentation, installed kubectl and learned how to configure minikube to run docker images. I also learned how to launch and connect to the minikube dashboard, which was very helpful later. I practiced launching some basic docker images into pods, and then interacting with them kubectl.
- Ok, I have custom images, I know how to use minikube – time to figure out how to deploy them using yaml. I found quite a few examples online, and use them to build a basic deployment file. I created the deployment using the file, with a test image from minikube….and it worked!
- Now it time for the real test – using my custom images. First try, I couldn’t even pull the images, and had to find the imagePullPolicy setting. Setting that to Never forces kubectl to look only for local docker images. Now kubectl can find my custom images, and will launch them…and keep launch them. For some reason, they keep crashing. It turns out, you explicitly need to start the service using CMD in the deployment file. It took me far longer than it should have to figure out, but finally I got it. Once I sorted that out….success!
- – Finally, I created services for each instance so they could communicate with each other, which seemed pretty straight forward.
It took me about four days to work through all this, in between work and home obligations. It was kind of an intense amount of learning for four days, but I feel pretty proud of how much I managed to grasp and apply in such a short time. I’ve submitted the coding assignment, and now we’ll see…
Originally Published 2/25/22
Be First to Comment