Preparing For A DevOps Engineer Job With A Personal Project
By Sudheer S
The blog post attempts to answer some questions like:
- How to become a DevOps engineer?
- How to prepare for a DevOps engineer interview?
- How to get a DevOps engineer job?
In a previous blog post, I wrote about the path an aspiring DevOps engineer could follow.
In this blog post, I will lay out a concrete plan using which you can prepare yourself for a DevOps engineer job. If you follow the steps carefully, you will be armed with practical DevOps knowledge, and you will be able to apply for DevOps engineer jobs confidently.
Expertise areas of an associate/junior/beginner DevOps Engineer
- Linux system administration. The topics are well-structured in the LFCS certification syllabus.
- Programming: any popular programming language such as Python, Go, JavaScript.
- Git. The quintessential source code management system.
- Relational database: any one of MySQL, MariaDB, PostgreSQL.
- IAC(Infrastructure As Code): Ansible and Terraform.
- Public Cloud - any of AWS, GCP or Azure.
- CI/CD: Jenkins, ConCourseCI, Tekton, etc.
- Monitoring/Observability - any popular open source stack such as Prometheus and friends, Zabbix, etc.
- Containers and Kubernetes: basics.
The Plan
Build a web application from scratch. Do not copy others’ projects. Be original. The application need not be complex. But it must strive to be close to a real production application. You can choose any programming language you like for the backend and frontend. For beginners, I recommend this stack:
- Python for backend. A good alternative programming languag to learn for beginners is JavaScript. You can use JavaScript on both frontend and backend. One language to rule them all, if you will!
- JavaScript - vanilla JavaScript for frontend without any frameworks. For our purposes, you can use a two tier architecture. Tier one being the database and tier two being the application. ie, from the web application, generate the HTML using web frameworks such as Flask, Django, Laravel, Express, Ruby on Rails, etc. If you choose to adopt the three tier architecture and build a separate frontend application then, ReactJS or NextJS is recommended. Other choices are vue.js and Angular. TypeScript may be considered for full frontend applications.
- Web technologies: some amount of HTML, CSS and JavaScript will be required for the project. You don’t have to be an expert in these technologies. But you should learn whatever pieces are required for your application. For simple projects, it is possible to skip JavaScript entirely.
- Git. Maintain your application in Git. Github offers free Git hosting.
- Database: PostgreSQL, MySQL or MariaDB.
- Cloud: Once the application works well on your computer, prepare it to host it on the cloud. You
can choose any public cloud. You may incur some expense to host your application. In Particular, you have to pay an
annual fee for your domain name registration. Before you try to deploy the application to the cloud, mimic the
deployment on a virtual machine on your laptop. Make use of free tier plans from cloud providers. Use a good
architecture.
- Use private networks to host the database and application servers. Use a bastion host to connect to servers on private networks for administration.
- Use a reverse proxy such as Nginx
- Use the load balancer on public network
- Use TLS with certificates
- IAC: Once you understand how to deploy your application to the cloud, start automating the process. Use Terraform to create the cloud resources. On AWS, an alternative to Terraform is CloudFormation. Pulumi is another alternative to Terraform. Ever since HashiCorp made Terraform proprietary, I recommend exploring alternatives to Terraform. If Terraform fits the bill for your use-cases, I am fine with it. Personally, I would always look for an open source software first. Use Ansible to configure the services on top of compute instances.
- CI/CD. When you merge the application code from a feature branch to the
main/master
branch, the deployment process must kick off automatically. The latest code in themain
branch must be automatically deployed to the target environment. A tool such as Jenkins can be used for CI/CD. At this point, revisit the application and write some tests. Write some unit tests and integration tests. Frameworks offer integration with testing libraries. After you write some tests, incorporate them in your CI/CD pipeline. As soon as a commit it pushed, the CI server should start building and testing your project from source. If the tests fail, the CI solution must send a notification to you. - Observability/Monitoring:
- Metrics: Once you deploy the application you have to monitor it. When an incident occurs, you
should be notified by the system. Start with Linux commands such as
top
,htop
,free
,du
,df
,ps
, etc. Install the Prometheus stack to monitor your infrastructure and application. Monitor host metrics such as CPU and memory with the pipelineNode Exporter -> Prometheus -> Alert Manager
. Ship some metrics from your application. Some examples of metrics:number of people who logged on to the application in last one hour
,number of e-commerce checkouts in last one day
,active users in last x days
, etc. Collect the metrics and create some alerts and notifications. - Logs: Learn about logging.
logrotate
is the de-facto tool to enable rotation of old logs to free up the disks.syslog
andrsyslog
are must-learn systems and tools when it comes to logging on Linux. Revisit your application and play around with some logging. Explore and generate some logs from your application. An example could be generating a log entry when someone logs on to the application using the login form. Ship the logs to a central logging server and perform some analytics using the logs. Initially, you could use tools such as thegrep
command to query the log files. Eventually, you can explore sophisticated systems such as OpenSearch to store and analyze logs.
- Metrics: Once you deploy the application you have to monitor it. When an incident occurs, you
should be notified by the system. Start with Linux commands such as
- Containers and Kubernetes. Containerize your application. Learn Docker or Podman. Push your application container image to a registry. Many registries such as Docker Hub offer free tier plans to store some amount of private images. Make use of those free tier registries to store your container images. On the target environment such as your VM, deploy the application using the image in the registry. The target environment could be a VM running Docker or Podman. Or the target environment could be a Kubernetes cluster.
Be prepared to share the source code of your application and IAC repositories with the interviewer.
Start applying to the DevOps engineer positions and submit your resume. Along with your resume, include the links to
your project repositories.
Frequently Asked Questions
Question: Should a DevOps engineer learn a programming language?
Answer: Yes. The cornerstone of DevOps engineering is automation. Automation is achieved by writing programs. Be it sophisticated applications or small scripts or a combination thereof. As you start digging deeper into Linux system administration, you will discover that writing shell scripts is inevitable at some point. When you work with IAC tools and processes, you will find yourself writing scripts in Domain Specific Languages(DSL) such as YAML or HCL. And then, some bigger problems will require you to write non-trivial programs. To excel at all these day-to-day DevOps engineering challenges, you have to learn to program. You can start with one full-fledged and general purpose programming language such as Python. Eventually, you can learn other languages based on needs. If you have a firm grounding in programming, it is easy to understand scripting concepts in DSLs. By definition, DSLs try to solve a problem in their own domain. The constraints in which the DSLs operate are not suitable to create a good programming language. If you write your first program in such one of the DSLs, you won’t have a good developer experience. On the contrary, if you are well versed in a programming language such as Python, C, C++, Go, JavaScript, etc., you will instantly pick up the programming constructs in DSLs.
Question: What is a good way to learn Linux?
Answer. Install Linux on your laptop. Use Linux on your primary device day in and day out. Try to build a website or application using open source web applications such as WordPress, Drupal, etc. This path will help you learn Linux shell commands, web servers such as Apache or Nginx, DNS, SSH, Firewalls, etc. One the side, you can also learn a bit about web technologies - HTML, CSS, JavaScript, etc. Before deploying the web application on the cloud, experiment with a virtual machine. The ability to use virtual machines on your laptop for experimenting, development and testing is a must-have item in your DevOps skills toolbox. Virtualization helps you experiment with new projects, software tools, etc. right on your device without paying for the cloud. Local experimentation on virtual machines creates faster feedback loop.
Question: The job title says “Devops Engineer”; is an engineering degree required to apply for this role?
Answer: The short answer: no. The long answer: it depends. There are still many companies out there requiring a degree for the role of DevOps Engineer. There are also many companies that do not require an engineering degree from a university for the role of DevOps engineer. In my opinion, things that matter more than a formal degree are your skills, knowledge and experience. If you can do the job without a pedigree, you should not be discriminated based on a piece of paper. Obviously, I cannot speak for every company and candidate out there. Having a degree or not is a debatable topic and can have socio-economic consequences. Think thoroughly before deciding. More importantly, if you do not have a degree, start applying for jobs that do not require it. There are plenty of opportunities in the cloud engineering industry that do not demand a formal degree.
Question: Is it possible to pursue DevOps engineering without Linux, containers, Kubernetes, Programming language X, Cloud brand X, Git?
Answer: Yes.
Then why should I pursue the said projects and technologies?
Answer: the short answer: to become more employable and increase your chances of succeeding in DevOps engineering. It is perfectly possible to drop one or all of the projects mentioned and still perform DevOps engineering. One of the things that determines your success with technologies is the people and community behind the project. Open source by nature builds and nurtures communities around itself. Bigger the community, better the chances of sustaining the project in the long-term. More the people, more the quality of the project. The project names mentioned in the article such as Linux, Kubernetes, etc., are the de-facto solution, project and product in their respective spaces. They all have incredibly large, friendly and helping communities. When you are taking baby steps in the DevOps industry it is better to stick to popular and successful technologies. When you gain enough experience, you will be in a better position to judge for yourself. You can of course, choose your own path which might as well be an uncharted territory. If you are feeling adventurous: all the best!
Question: Can you summarize the list of projects, tools and technologies in the path?
Answer: Linux, Python, Git, HTML, CSS, JavaScript, PostgreSQL, Ansible, Terraform, Jenkins, Docker, Podman, Kubernetes, Cloud, Prometheus, Grafana. Of course, there are other combinations and paths.
Question: Can you point me to resources and tutorials to learn these topics?
Answer: Visit either youtube.com
or google.com
and type
the topic name. Something like Linux tutorial
or Linux course
should yield good results.