DEV Community

Cover image for 20 Life hacks for DevOps Engineers
Jake Page for Glasskube

Posted on

20 Life hacks for DevOps Engineers

Tricks of the trade, hacks, trade secrets, cheat sheets, best practices, call them what you will. Every industry has them, and anyone who sticks around long enough builds an arsenal of techniques and finely tuned tools to excel at their job.

Some things simply take time to master. My dad, a retired builder, could tile a medium-sized bathroom in under an astonishing three hours, while it would take me a full day just to do the grouting afterwards. Experience is key for certain skills, but there are also tips that don’t require years of practice to acquire.

gif

DevOps is no different. There are no shortcuts to becoming a god-tier DevOps savant, put the years in and you might just get there. Having said that, there are some tricks of the trade, life hacks and useful tooling that are sure to give you an instant boost in productivity.

Here is my non-comprehensive list of life hacks guaranteed to make any DevOps engineer’s life easier.

The list is broken down into:

  • Tooling 🧰
  • Skills 🤸
  • Habits 🔁
  • Scripts, configs and extensions 💻

Tooling: 🧰

Did you know that if you really want to get somebodies attention in Germany, sending a fax is your best bet?
Also, in Japan up until this year, floppy disks were still in use by government institutions.

Knowing which context you find yourself in is essential to then choose the best tools for the job. Even though it’s important not to obsess over having the best, newest, or shiniest tool on the market. The following tools can be real game-changers for DevOps engineers.

"You don’t need to be the sharpest tool in the shed to use the sharpest tools in the shed" - Anonymous (I might have made it up)

gif-2

1. k9s

K9s is a terminal-based UI for interacting with your Kubernetes clusters. It takes very little time to get accustomed to navigating, observing, and managing your live applications through the tool. And once you do, you might never go back. K9s continually monitors Kubernetes for changes and offers many useful commands to interact with your observed resources.

Link to instal.

k9s

2. tmux

tmux is a powerful terminal multiplexer that enhances productivity by allowing session persistence, window and pane management, and customization through key bindings and configuration files. It supports scripting for automation, facilitates collaboration with shared sessions, and integrates well with various shells and tools.

tmux

3. Glasskube

Glasskube is an Open Source package manager for Kubernetes. It makes deploying, updating, and configuring packages on Kubernetes 20 times faster than tools like Helm or Kustomize. Inspired by the simplicity of Homebrew and npm. You can decide if you want to use the Glasskube UI, CLI, or directly deploy packages via GitOps.

glasskube-dash

Care to support us?

If this is the first time you've heard of Glasskube, we are working to build the next generation Package Manager for Kubernetes.

If you like our content and want to support us on this mission, we'd appreciate it if you could give us a star ⭐️ on GitHub.

star-gif

⭐️ Star us on GitHub 🙏

4. ripgrep

Riggrep is a powerful search tool known for its speed, flexibility, and user-friendly output. It quickly processes large codebases using advanced algorithms, supports a wide range of search patterns, and presents clear, highlighted results. Riggrep integrates well with other tools, is cross-platform, and customizable.

ripgrep

5. Firefox containers for multi cloud account access

Firefox Multi-Account Containers is a such an underestimated browser extension for it's utility. It helps manage online activity by separating websites into different containers or tabs, preventing sessions tracking across sites. It’s most useful feature is that it allows users to log into multiple accounts simultaneously within the same browser. By isolating sessions through cookie separation, it protects personal data and improves the overall browsing experience. Have multiple AWS accounts? Not an issues, you can log in to all of them from the same browser window.

firefox-tabs

6. VPA

Vertical Pod Autoscaler (VPA) frees users from the necessity of setting up-to-date resource limits and requests for the containers in their pods. When configured, it will set the requests automatically based on usage and there after allow proper scheduling onto nodes so that appropriate resource amounts are available for each pod.

Install it here.

Example config:

apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: my-app-vpa
spec:
  targetRef:
    apiVersion: "apps/v1"
    kind:       Deployment
    name:       my-app
  updatePolicy:
    updateMode: "Auto"
Enter fullscreen mode Exit fullscreen mode

7. Kctx and Kubens

Is just hand’s down the most useful CLI tool for Kubernetes context and Namespace switching.

Install it here

kubectx

8. ChatGPT for guidance

Use ChatGPT as if it were a senior member on your team who is never busy and always happy to answer all of your questions. Make sure your intention is deeper understanding and not blind task resolution.

Prime ChatGPT to be a senior team member with a prompt like this:

You will act as a Senior DevOps Engineer to provide life hacks and tips on how to excel in the field of DevOps. You will also be ready to help junior team members with any questions they might have. Please include practical advice, recommended tools, and best practices for managing infrastructure and continuous integration/continuous deployment (CI/CD) pipelines. Write the output using my communication style, which is clear, concise, and practical. Here are examples of my communication style:

  • "Focus on automating repetitive tasks to save time and reduce errors."

  • "Leverage tools like Docker and Kubernetes for containerization and orchestration."

  • "Always monitor system performance and be proactive in identifying potential issues."

  • "When mentoring juniors, be patient and explain concepts in simple terms."

Here are some questions you can ask ChatGPT to further fine tune the prompt:

  1. Do you want the advice and explanations to cater more to beginner-level juniors or those with some experience in DevOps?

  2. Could you provide more detailed examples of your communication style, especially in scenarios where you explain complex concepts to juniors?

  3. Are there specific challenges or areas of focus within DevOps (e.g., automation, monitoring, security) that you want to prioritize for the advice and junior support?

Skills: 🤸

It's no surprise that skills can't be absorbed instantly, they require time and effort. In the ever-evolving tech world, determining which skills to cultivate can be confusing. However, as DevOps engineers, you can't go wrong with mastering scripting and prioritizing documentation.

“Build your skills not your resume.” — Sheryl Sandberg

skills

9. Scripting

Scripting is like a swiss army knife for DevOps engineers because it automates repetitive tasks, provides essential glue between processes, and ensures consistency across environments. Learning and practicing scripting involves familiarizing yourself with tools like Makefiles, regular expressions (regex) for efficient text processing, and Bash scripting for powerful command-line operations.

Don't feel like you have to master scripting before implementing it at work. Look for manual steps in your current software or infrastructure delivery processes and try to script automations that make sense. Leverage an LLM for help if needed.

10. Documentation

Write everything down. It’s the best way to take care of your future you.

Try out a few note taking solutions here are a few:

It doesn’t matter which one you choose as long as you only choose one and you stick to it.

🤔 Don’t fall into the trap of spending too much time organising and optimising your notes. Notes don’t have to be perfect only functional. Spending too much time on note maintenance is meta-work.

Habits: 🔁

You will never get far if you rely solely on pure motivation to get things done and improve. Well-defined and consistent habits are the glue that keep you growing and effective, even when your motivation wanes. Habits seamlessly integrate tools and skills, ensuring you are effective at your job.

"Motivation is what gets you started. Habits is what keeps you going." - Jim Ryun

practice

11. Don’t write to-do lists, block time.

I’ve been heavily influenced by Cal Newport’s writing on Deep Work and I’m quite convinced that efforts to preserve a certain amount of time per week dedicated to uninterrupted deep work is crucial for an individual who wants to contributor meaningfully to a team.

To-do list on their own are just wish lists. Once you plot them on a calendar, that’s when you have a plan.

It’s important to point out that I know very few people who execute on their time block plans with 100% fidelity every day of the week. Use them as north stars, schedule rest time when you need it. Update the list throughout the day even. But at least hold yourself to a plan.

time-block

12. Reciprocal meeting blocks

Unless you are your own boss, you’re most likely not 100% in charge of the meetings and commitments you might be obliged to participate in. Reciprocal meeting blocks is a way to counteract unexpected time commitments that just pop up in your calendar.
The idea here to reserve an equivalent deep work block every time a new meeting is added to you calendar. That way you can stay flexible and relatively available without having to compromise on your weekly deep work quota.

13. Have a shutdown routine

Especially useful if you are a remote worker. A shutdown routine is a series of questions and steps your run through to finish your working day. Ideally once you complete the checklist you should be able to forget about your work until the next day.

What I track is the following:

  • Did I exercise?

  • Did I address all of the miscellaneous tasks I had?

  • Do I have any open conversations?

  • Do I need to push any tasks to the next day?

  • Did I write a diary entry? (not work related but I like to get it done before I leave the desk)

  • How many deep hours did I do?

  • Did I check the metrics I’m tracking one last time before I close the laptop for the day?

14. Take notes during meetings

Taking notes during meetings and sharing them afterward should ideally be a common practice in your organization. If it isn't, this is a perfect opportunity for you to start. Not only does it ensure that no important details slip through your fingers, but it also provides a great service to your team.

15. Test run outages

Test run outages are essential for DevOps engineers to prepare for real incidents. You have to know exactly how to swiftly and efficiently connect to your clusters or VMs before an unexpected 1 a.m. alert for example, you can’t be caught off guard.

Familiarize yourself with moving files, retrieving container logs, and other critical tasks. Setting up SSH keys, kubeconfigs, and other access tools in advance will save valuable time and reduce stress during actual outages. Proactively testing and optimizing these processes ensures that you are ready to respond effectively to any disruption.

Scripts, configs and extensions: 💻

If you have to do something more than once, automate it. Why write out a full command when you can save time by using an alias? Over a long career, it might be hard to calculate exactly how much time is saved by typing "k" instead of "kubectl." One thing is for sure: it's a lot, and it's well worth it.

“You’re either the one that creates the automation or you’re getting automated.” — Tom Preston-Werner

automation

16. Use helpful aliases

Don’t waste time typing out the full commands you write every day.

Here is a small snippet of a few of my configured aliases:

k=kubectl
kctx='kubectl ctx'
kgp='kubectl get pods'
kns='kubectl ns'
l='ls -lah'
la='ls -lAh'
ll='ls -lh'
ls='ls -G'
lsa='ls -lah'
md='mkdir -p'
rd=rmdir
run-help=man
Enter fullscreen mode Exit fullscreen mode

17. Efficiently cleaning up finished jobs with TTL controller

You can specify the lifespan of finished jobs or pods before they are automatically removed by setting the .spec.ttlSecondsAfterFinished field. If you working in a job heavy environment finished jobs can quickly accumulate and become quite resource heavy.

Example config:

apiVersion: batch/v1
kind: Job
metadata:
  name: test-ttl-job
spec:
  ttlSecondsAfterFinished: 100
  ...
Enter fullscreen mode Exit fullscreen mode

18. Git script to keep synced with the upstream

git remote add upstream <upstream-url>
git fetch upstream
git rebase upstream/main
git push --force-with-lease
Enter fullscreen mode Exit fullscreen mode

19. Kubectl auto complete

Kubectl autocompletion lets you create an alias for kubectl. This feature saves time by reducing the need for cheat sheets and is especially useful for managing Kubernetes clusters. It's also recommended for the CKA exam due to its time efficiency.

Set up for Linux:

# install bash-completion
sudo apt-get install bash-completion

# Add the completion script to your .bashrc file
echo 'source <(kubectl completion bash)' >>~/.bashrc

# Apply changes
source ~/.bashrc

Enter fullscreen mode Exit fullscreen mode

Check out other installation methods here.

20. Visual Studio Code Remote – SSH

The Remote - SSH extension lets you use any SSH-enabled remote machine for development, making it easier to develop on the same OS you deploy to, use powerful hardware, switch between environments, and debug applications remotely.

Install it here.

Final thoughts

There’s no magic formula for becoming a top 1% DevOps engineer. Like in most professions, it’s a matter of time, dedication, and experience that will gradually shape you into a highly effective professional. Over time, you'll get much better at recognizing patterns, recalling past situations, and finding quick solutions to recurring issues. So, don’t expect any single life hack from this list to instantly earn you a 50% raise and a promotion.

However, if you consistently focus on refining your tools, honing your skills, refusing to break good habits, and implementing smart automations, you’ll be well on your way to rapidly evolving and surpassing your current self. And who knows, maybe that promotion is just around the corner.


If you like our content and want to support us on this mission, we'd appreciate it if you could give us a star ⭐️ on GitHub.

giff

⭐️ Star us on GitHub 🙏

Top comments (17)

Collapse
 
racs profile image
Racs

This was a great article, good tips. Thanks

Collapse
 
jakepage91 profile image
Jake Page

Appreciate the comment Racs!

Collapse
 
wolfsrudel profile image
Wolfsrudel

In my opinion Zellij (zellij.dev/) is the way better tmux. It's faster and easier to handle (you don't have to deal with thousands of (memorable) finger twists just to perform an action).

Collapse
 
auser profile image
Ari

I like zellij, but tmux stays out of your way while zellij does not :/

Collapse
 
jakepage91 profile image
Jake Page

Very cool, haven't heard of Zellij, will check it out for sure!

Collapse
 
dagelf profile image
Coenraad Loubser

Awesome tips!

Collapse
 
jakepage91 profile image
Jake Page

Thanks @dagelf !

Collapse
 
martinbaun profile image
Martin Baun

thanks for compliling this in detail, gold!

Collapse
 
jakepage91 profile image
Jake Page

Appreciate the comment Martin!

Collapse
 
tyaga001 profile image
Ankur Tyagi

nice post @jakepage91

Collapse
 
jakepage91 profile image
Jake Page

appreciate it Ankur!

Collapse
 
karadza profile image
Juraj

I'm a k9s enjoyer myself 😄
Good tips!

Collapse
 
jakepage91 profile image
Jake Page

Appreciate it @karadza

Collapse
 
figspville profile image
Salli Figler

Very thoughtful article!

Collapse
 
jakepage91 profile image
Jake Page

Much appreciated @figspville

Collapse
 
kiera_bryant_c56c8dced62f profile image
Kiera Bryant • Edited

This article provides a fantastic compilation of web apps that can significantly enhance productivity and streamline workflows. The suggestions are practical and cover a wide range of needs. For those who are also looking to improve their professional profile, Resume Folks offers expert resume services to help you stand out in your job search. It's always great to discover tools and services that can boost both work efficiency and career prospects. Thanks for sharing these valuable resources!

Collapse
 
sfritsch09 profile image
Sebastian Fritsch • Edited

Nice Post: Continue Reading for more: Top 10 Exciting Tools For DevOps

Some comments may only be visible to logged-in visitors. Sign in to view all comments.