LFX Mentorship - Kubespray mentee reflection - From user to contributor to reviewer

I quickly searched on Google for LFX Mentorship-related posts, and it seems no one from Taiwan has written an internship reflection yet. I’ll be the first to lead the way and write the first one!

This article is in English. For the Traditional Chinese version, please click here.
本篇文章為英文版本,繁體中文版本請點擊這裡

What is Kubespray?

Kubespray Logo

Kubespray is an open-source project under the Kubernetes ecosystem that provides a set of Ansible playbooks, roles, and variables to deploy a highly available and production-ready Kubernetes cluster. It supports multiple cloud providers and bare metal installations, offering flexibility and scalability for deployment environments. Kubespray is designed to simplify installing and managing Kubernetes clusters by automating many complex tasks, including networking, storage, and configuration management. With features like rolling upgrades, idempotency, and support for various plugins, Kubespray is widely used by IT administrators and DevOps engineers to deploy and maintain Kubernetes clusters efficiently.

Project website: https://kubespray.io
GitHub: https://github.com/kubernetes-sigs/kubespray

Why did I come across Kubespray?

While working as an intern for my company (shortly after completing my school internship), I needed to practice deploying on-premises Kubernetes. Manually installing it using Kubeadm could be quite time-consuming, as there were many installation details to consider.

Kubespray already has Ansible scripts written for Kubernetes installation. You just need to configure the inventory (host list) and group_vars, and the installation method will run automatically. For example, setting kube_network_plugin to calico or cilium will install the corresponding CNI based on the plugin selected (provided Kubespray has support for it; if not, you can write your contribution or open a feature request).

After getting familiar with Kubespray for a while and gaining insights into IT/SRE and Kubernetes monitoring, I wrote an article titled “Newbie IT/SRE Notes in 30 days”, which I submitted to the “2022 iThome Ironman competition”. I wrote about the installation process using Kubespray’s latest version (v2.19.1) and covered operations like adding and removing nodes. Regarding page views, Kubespray was my second most-read article (the first about installing Kube Prometheus Stack). Luckily, I was awarded Honorable Mention in the DevOps category.

Although I haven’t written any related articles in the last two years, mainly because I’ve been focusing on my master’s thesis, I’ve continued using the project.

Starting my contribution to Kubespray

After failing my application for LFX Mentorship 2024 Term 1, I began contributing to various projects, including finding a Kubespray issue that I could work on. I submitted my first PR (pull request) to Kubespray, which was merged successfully.

Ubuntu 24.04 was released at the end of April, and in early May, I submitted a PR to support the latest Ubuntu version in Kubespray. Through this, I learned how to use Vagrant. Although the CI tests initially failed, the tests finally passed after some effort and with the maintainers’ help in building the image for Ubuntu 24.04.

Kubespray was recruiting mentees for LFX Mentorship 2024 Term 2, so I applied again. With my past article contributions and recent involvement in the project, I was fortunate to be accepted as a mentee.

Received the acceptance letter for LFX Mentorship 2024 Term 2 - Kubespray

Tasks as a mentee

After a brief chat with my mentor Kay Yan (yankay), the mentorship’s primary goal was to submit PRs, and the mentor could interact with the mentee through the PR process. As long as mid-term and final reports were submitted for CNCF review, the process was simple for me, given my prior experience.

In this project, I have contributed by adding new features (such as Gateway API installation), fixing CI issues (like CentOS 7 EOL), updating application versions (including OpenStack Cloud Controller Manager, Cert Manager, and Kubernetes), reviewing pull requests from other contributors, and answering questions from the community.

Fixing CI and CentOS 7 EOL issues

One of my toughest challenges was the CI testing and CentOS 7 EOL issue. At that time, ant31 was restructuring CI logic and forgot to cherry-pick other branches. Also, the CentOS 7 tests needed to be removed due to its EOL. The CI restructuring PR needed to be cherry-picked, or CentOS 7 would cause the test to fail. Without a successful check, even if project maintainers gave lgtm and approve, the k8s-ci-robot wouldn’t merge the PR.

It might sound complicated, but here’s a meme I made to simplify the situation:

CentOS 7 EOL causes CI issues

Thanks to ant31 ‘s advice, I was able to fix the CentOS 7 CI (PR #11360), enabling successful cherry-picking without CentOS 7 failures. This allowed the release-2.24 and release-2.25 branches to be updated.

Assisting maintainers in debugging application issues

PR #11250 was a simple update to Node Feature Discovery (NFD), including updating CRD and ClusterRole. However, CI tests failed, so I began investigating the cause.

Using Vagrant to run Kubespray’s installation process, I observed the NFD deployment and found that the Liveness Probe failed due to the absence of /usr/bin/grpc_health_probe. After checking NFD’s installation details, I discovered that they had switched to K8s’ built-in gRPC checks.

After maintainers mzaian made the necessary changes, the CI tests passed, which gave me great accomplishment!

NFD debug success

Invited to become a Kubespray reviewer

By the end of week 9 (8/16), after reviewing numerous PRs, my mentor formally invited me to become a reviewer.

Invitation to become a Kubespray reviewer

I gladly accepted this role (PR #11453), and I continue reviewing contributions from others!

Internship reflections

Participating in the LFX Mentorship program has provided me with invaluable growth opportunities. First and foremost, I would like to thank my mentors, Kay Yan (yankay) and Mohamed Zaian (mzaian), as well as other maintainers like Antoine Legrand (ant31), for giving me the freedom to explore my ideas and for offering guidance on how to fix the CI of different branches at the right moments. Collaborating with such experts in the open-source community has been a great honor. In addition to gaining hands-on experience, I have broadened my technical horizons and feel confident about my future career plans. Although this Mentorship has ended, my contributions will not stop here. I will continue to dedicate my efforts to maintaining Kubespray in the future.


LFX Mentorship - Kubespray mentee reflection - From user to contributor to reviewer
https://blog.yangjerry.tw/lfx-mentorship-kubespray-en/
作者
Jerry Yang
發布於
2024年9月9日
許可協議