k8or extensively utilizes custom controllers to facilitate integration with various cloud providers. These custom controllers enable k8or clusters to interact with cloud-specific services and resources, extending its functionality and management capabilities within different cloud environments.
How it works:
Introduction:
For example, the AWS Controllers for Kubernetes (ACK) project aims to simplify managing AWS resources within Kubernetes clusters. This is achieved by enabling users to define the desired state of AWS resources using the familiar Kubernetes API and configuration language.
Functionality:
At its core, the ACK framework leverages custom resources (CRs) within Kubernetes. These CRs represent the desired state of corresponding AWS resources, such as Amazon S3 buckets or, in this specific case, DynamoDB tables.
Workflow:
This document presents an example hGraph visualization of how DynamoDB interacts with various entities within an AWS environment.
-
At its core, the ACK framework leverages custom resources (CRs) within Kubernetes. These CRs represent the desired state of corresponding AWS resources, such as Amazon S3 buckets or, in this specific case, DynamoDB tables.
-
Kubernetes API server:
Kira applies the manifest file usingk apply
. The Kubernetes API server validates the CR and verifies user permissions. -
CR creation:
Upon successful validation and authorization, the API server stores the CR in its etcd data store. -
ACK DynamoDB controller notification:
Running within a standard Kubernetes pod on a worker node, the ACK DynamoDB controller is notified about the newly created CR. -
AWS interaction:
The ACK DynamoDB controller interacts with the AWS DynamoDB API, calling theCreateTable
operation to provision the table in the user's AWS account based on the CR specifications. -
Status update:
After successful table creation, the ACK controller updates the CR'sStatus
field within the Kubernetes API server, reflecting the actual state of the table in AWS.
Drift Detection and Remediation:
ACK implements mechanisms to detect and address situations where the desired configuration (defined in the CR) and the actual state of the AWS resource diverge. This can happen due to manual modifications outside of ACK, through tools like the AWS CLI or console. The ACK DynamoDB controller periodically checks for such discrepancies (drift) and attempts to rectify them by reconfiguring the DynamoDB table based on the latest CR specifications. The default drift detection interval is 10 hours, but this can be customized.
Benefits:
By leveraging ACK, users can manage their entire application ecosystem, including both Kubernetes and AWS resources, through a unified interface. This streamlines infrastructure management and simplifies resource provisioning and configuration.
Instead of manually managing a Kubernetes control plane, use Amazon Elastic Kubernetes Service (EKS). This fully managed service handles upgrades, patching, and scaling, making it ideal for beginners.
For a managed relational database, choose Amazon RDS. It supports various engines like MySQL, PostgreSQL, and Aurora. For NoSQL, consider Amazon DynamoDB or Amazon DocumentDB.
Leverage AWS CodePipeline for building, testing, and deploying your applications to the cluster. It integrates seamlessly with other AWS services.
Opt for Amazon Managed Streaming Service (MSK) for Apache Kafka. It offers managed deployment, scaling, and monitoring of Kafka clusters.
Simplify service-to-service communication with AWS App Mesh. It provides traffic management, observability, and security features.
Use Amazon API Gateway for managing and securing external access to your applications. It simplifies API development and provides scalability.
Employ Amazon CloudWatch for comprehensive monitoring of your cluster and applications. It collects metrics, logs, and events for analysis and troubleshooting.
For centralized log management, use Amazon CloudWatch Logs. It aggregates logs from various sources and allows filtering and analysis.
Depending on your needs, consider:
-
Amazon S3:
Object storage for unstructured data like backups and media. -
Amazon Elastic Block Store (EBS):
Block storage for persistent volumes attached to applications. -
Amazon Elastic File System (EFS):
Shared file system for containerized applications.
Store and manage container images securely with Amazon Elastic Container Registry (ECR). It integrates seamlessly with EKS deployments.
-
Create an AWS Account: Sign up for a free tier account on AWS.
-
Configure Managed Services:
-
Database:
Create RDS or DynamoDB instances following their respective documentation. -
Continuous Integration and Delivery:
Set up a CodePipeline with necessary stages for code building, testing, and deployment to EKS. -
Streaming and Messaging:
Deploy an MSK cluster based on your requirements. -
Service Mesh:
Enable App Mesh for your EKS cluster and configure service meshes for your applications. -
API Gateway:
Create and configure API Gateway resources to expose your applications publicly or privately. -
Monitoring:
Set up CloudWatch monitoring agents on your cluster nodes to collect data. -
Logging:
Set up CloudWatch logging agents on your cluster nodes to collect data. -
Storage:
Create appropriate storage volumes or file systems based on your application needs. -
Container Registry:
Set up an ECR repository to store and manage your container images.
-
-
Deploy Applications: Use kubectl or tools like Helm to deploy your applications to the EKS cluster, leveraging container images from ECR.
Additional Resources:
-
AWS Documentation:
The official documentation for each service offers detailed instructions and best practices. -
AWS Getting Started Guides:
Various AWS services provide Getting Started guides that simplify initial setup. -
AWS Workshops:
Participate in free online or in-person workshops from AWS to gain hands-on experience with various services.
Looking to expand your k8or knowledge?
k8or is easier to use with a basic understanding of Kubernetes principles and core concepts. Learn and apply fundamental k8or practices to run your application in k8or.

Explore BLOCK framework, k8orization, custom images, deployments, and more