I'm looking to deepen my understanding of Kubernetes and improve my Go programming skills by exploring different use cases for creating my own operator. So far, the only idea I have is an operator that analyzes cluster event logs and uses an AI API to offer security improvement suggestions. I'd love to hear about some practical examples from those of you who have successfully built your own operators!
5 Answers
A friend created an operator to handle Kubernetes addons across multiple clusters and wrote some tutorials on how to build operators. You can check them out at their GitHub: [kubernetes-controller-tutorial](https://github.com/gianlucam76/kubernetes-controller-tutorial).
Yeah, I remember that! Kops was great for managing things back then.
I developed a mutating webhook to inject an Oauth2proxy container into pods based on specific annotations. This setup helps secure my self-hosted services using Keycloak, and it also manages updates within the process to maintain network connectivity across namespaces.
That sounds like a neat use of Kubernetes features! Is the webhook written in Go?
I'm working on a pretty straightforward operator that launches a pod with an SSH sidecar. It finds a free port on the node and assigns a host port for direct SSH access. Essentially, it’s like giving clients a 'fake VM'. I'm still learning Go, so it's been an interesting challenge.
Do you have a Git repository for that?
My operator manages the lifecycle of database pods to ensure that quorum is maintained during upgrades and configuration changes. It also facilitates adding read-only replicas and takes backup snapshots from the cluster leader to avoid confusion during restorations.
I built an operator that uses the rclone image to sync S3 buckets across different regions. It was pretty simple, and I leveraged the operator SDK to set up the initial structure quickly.
Does it automatically mount the S3 buckets to specific deployments?
Is this the same as the addons controller on GitHub? I used to rely on kops for bootstrapping before shifting to managed clusters.