Another guest post today – hope you like it!
Although Kubernetes is notoriously complex, there are still many who choose to self deploy Kubernetes. Self, or DIY, deployment grants you full control over your clusters and configurations but requires significant expertise and experience. Before deciding if DIY deployment is right for you, consider the following aspects.
Pros of DIY Kubernetes Deployments
You retain full control over your cluster masters and all related components. This enables you to customize your clusters to exactly suit your needs. If you use a managed Kubernetes service, they handle configuration and you are restricted to the configurations they make available.
Flexible tooling and resources
You can choose whatever tooling or resources you want. This means you can deploy on-premise, or in hybrid or multi-cloud infrastructures as needed. It also means you can integrate existing tools more easily. In contrast, managed deployments typically limit which services and tools you can use. Vendors may also limit your ability to customize tools or resource use.
Provided you have the in-house expertise and time, DIY deployments can be cheaper than managed ones. You can scale DIY deployments at will and do not need to worry about getting locked into service contracts.
Cons of DIY Kubernetes Deployments
Deployment time and effort
DIY deployments take lots of expertise, planning, and refinement to implement successfully. In contrast, managed deployments take minimal time and effort since the vendor does all of the setup and deployment work.
Ongoing maintenance and management
You are responsible for keeping deployments up to date and ensuring that your clusters are running smoothly in DIY strategies. This can involve a steep learning curve and puts you at risk of downtime. Managed deployments handle updating for you and often include service level agreements ensuring availability.
Security and monitoring
The complexity of Kubernetes deployments can make configurations difficult to monitor and secure. Since these deployments often contain mission-critical data and processes, this difficulty can put you at significant risk. Meanwhile, managed deployments often provide out-of-the-box integration with cloud-native security and monitoring solutions.
Implementation Considerations for DIY Kubernetes
After you have weighed the pros and cons of DIY Kubernetes, you should consider the following.
Production-grade DIY deployments often take a considerable amount of time to plan, set up, and test. You need to configure and secure an array of components, including services, tooling, plug-ins, and integrations. This likely means three to five weeks of work, assuming that you already have professionals in-house who are familiar with Kubernetes. The time is likely to be longer if you have a complex infrastructure to begin with, such as hybrid or multi-cloud services.
Kubernetes deployments are a complex system of services and tooling. To ensure your deployment is running securely, much less efficiently, you need to perform continuous monitoring.
You also need to know what types of issues you may encounter and how those issues present. Issues may include SSL termination, invalid certificates, lack of network isolation, failed logging, or poorly distributed workloads. Even after you understand how and what to monitor, you still need to make sure that someone is available to respond to any alerts or issues that arise.
Troubleshooting and Maintenance
While monitoring can tell you what’s potentially wrong with your deployment, it doesn’t tell you how to fix the issue. This requires either previous experience, extensive searching, or the ability to test fixes until you find one that works. The latter two options are time-consuming and can cause more damage than the original issue if handled carelessly.
Additionally, Kubernetes receives frequent updates and patches that you need to stay on top of. If you ignore upgrades your deployment is less protected and may stop being supported entirely. You need to upgrade Kubernetes frequently and consistently to avoid running into larger issues.
Kubernetes DIY Tools
Once you have decided that a DIY Kubernetes deployment is the right option for you, there are several tools you can use to ease the process. There is also the Kubernetes the Hard Way guide, which explains how to set up clusters from start to finish and is invaluable for any DIY deployment.
Some additional tools you can use include:
- Terraform and/or Ansible—Terraform enables you to use a declarative infrastructure to perform installation tasks. With it, you can create automation scripts to handle tedious work. It also includes a Kubernetes-specific provider (module) that you can use to manage your resources. Ansible also enables you to create automation scripts but unlike Terraform, it lets you interact directly with the Kubernetes API server. It is better for managing software resources while Terraform is better at provisioning infrastructure.
- Kubernetes operations (kops)—a command-line tool you can use to create, delete, maintain, or upgrade clusters. It is currently officially supported for AWS and OpenStack and GCE are in beta. You can integrate this tool with Terraform.
- Kubeadm—a tool you can use to quickly deploy minimum viable clusters. It is a simple tool, meant to be used as the base for other, more elaborate tooling.
Hopefully, this article helped you better understand what it means to DIY Kubernetes. There are advantages and challenges to any approach, and the more you know the better prepared you’ll be. Experience will be your best guide, but information is always useful. Keep learning and experimenting, and share your result with the Kubernetes community. If you’re struggling with a problem, chances are someone out there already figured out a solution.
Gilad David Maayan is a technology writer who has worked with over 150 technology companies including SAP, Samsung NEXT, NetApp and Imperva, producing technical and thought leadership content that elucidates technical solutions for developers and IT leadership.