The WebApp Operator is a Kubernetes controller designed to simplify and automate the deployment and management of web applications. It provides a declarative, application-centric interface for developers, abstracting away the complexity of underlying Kubernetes resources like Deployments, Services, and Ingresses.
This operator introduces a WebApp Custom Resource Definition (CRD), which represents the desired state of a web application. When a developer creates a WebApp resource, the operator's controller provisions all the necessary backend components to run the application, configure its networking, and ensure the specified number of replicas are running.
Conversely, when a WebApp resource is deleted, the operator is responsible for a complete and clean teardown of all associated resources. This ensures that no orphaned components are left in the cluster, providing a lifecycle management solution for containerized web applications.
- Automated Application Provisioning: Automatically creates and configures
DeploymentandServiceresources based on theWebAppspecification. - Declarative Configuration: Allows users to define their application using high-level concepts like
image,replicas,port, andhost. - Simplified Lifecycle Management: Manages the entire lifecycle of the web application, from initial deployment to clean deletion.
- Status Reporting: Updates the
statusof theWebAppresource with conditions to provide observability into the state of the deployment. - Extensible Foundation: Built to be extended with more advanced features like automated TLS and autoscaling.
The core of the WebApp Operator is the WebApp custom resource. It captures the user's intent for their application in a simple, straightforward manner.
Below is an example of a WebApp resource definition:
apiVersion: kleff.io/v1
kind: WebApp
metadata:
name: my-nginx-app
spec:
deploymentID: "prod-nginx-001"
name: "production-web-server"
image: "nginx:1.21.6"
replicas: 3
port: 80
host: "my-app.example.com"This operator is designed to evolve into a comprehensive application management tool. Future versions will introduce more sophisticated automation and integration:
- Automated Ingress and TLS Management: Automatically create
Ingressresources for the specifiedhostand integrate withcert-managerto provision and manage TLS certificates. - Health and Readiness Probes: Add fields to the
WebAppspec to define custom liveness, readiness, and startup probes, which will be configured on the underlying Deployment. - HPA Integration: Introduce autoscaling parameters in the
WebAppspec to automatically create and configureHorizontalPodAutoscaler(HPA) resources. - Advanced Status Conditions: Enhance the
statusfield with more detailed conditions, such asAvailable,Progressing, andDegraded, to provide deeper insights into the application's health.