Skip to content

A comprehensive repository for Kubernetes Operators and Helm Charts development, featuring customizable Helm charts, operator CRDs, reconciliation logic, example deployments, and detailed documentation for efficient Kubernetes application management.

License

Notifications You must be signed in to change notification settings

Randul-Malinhara/kubernetes-operators-helm-charts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Operators and Helm Charts Repository

Welcome to the Kubernetes Operators and Helm Charts Repository, a comprehensive project designed for seamless deployment and management of Kubernetes applications using Helm Charts and custom Operators.


Repository Structure

kubernetes-operators-helm-charts/
├── charts/               # Helm chart definitions
│   └── myapp/            # Helm chart for `myapp`
│       ├── Chart.yaml    # Helm chart metadata
│       ├── values.yaml   # Default configuration values
│       └── templates/    # Kubernetes resource templates
├── operators/            # Kubernetes operator implementations
│   └── myapp-operator/   # Operator for `myapp`
│       ├── Dockerfile    # Operator container image definition
│       ├── Makefile      # Build and deployment commands
│       ├── config/       # Configuration for the operator
│       │   ├── crd/      # Custom Resource Definitions (CRDs)
│       │   └── samples/  # Sample CR instances
│       ├── api/          # Custom resource API definitions
│       │   └── v1alpha1/ # API version implementation
│       └── controllers/  # Reconciliation logic
├── examples/             # Examples of deployments and configurations
├── docs/                 # Documentation for setup, optimization, and troubleshooting
├── .gitignore            # Ignored files for Git
├── LICENSE               # Project license
└── README.md             # Overview and usage guide

Getting Started

Prerequisites

Ensure the following tools are installed on your system:

  • Kubernetes Cluster (Minikube, KIND, or cloud-based clusters)
  • kubectl (CLI tool for Kubernetes)
  • Helm (Package manager for Kubernetes)
  • Operator SDK (CLI for building Kubernetes operators)

Clone the Repository

git clone <repository-url>
cd kubernetes-operators-helm-charts

Helm Chart Deployment

Chart Overview

The Helm chart is located under charts/myapp/. It includes:

  • Chart.yaml: Metadata for the chart.
  • values.yaml: Default configuration values.
  • templates/: Kubernetes resource templates (e.g., Deployment, Service).

Deploy the Helm Chart

  1. Lint the chart:
    helm lint charts/myapp
  2. Install the chart:
    helm install myapp charts/myapp
  3. Verify the deployment:
    kubectl get all

Operator Development

Operator Overview

The custom Kubernetes operator is located under operators/myapp-operator/ and includes:

  • CRDs: Define the custom resources (config/crd/).
  • Reconciliation Logic: Implemented in the controller (controllers/myapp_controller.go).
  • Container Image: Defined in the Dockerfile.

Steps to Build and Deploy the Operator

  1. Build the operator binary:
    cd operators/myapp-operator
    make build
  2. Run the operator locally:
    make run
  3. Deploy the operator to the cluster:
    make deploy

Examples

The examples/ directory includes sample configurations for testing:

  • sample_deployment.yaml: Basic Deployment example.
  • hpa_example.yaml: Horizontal Pod Autoscaler configuration.
  • vpa_example.yaml: Vertical Pod Autoscaler configuration.

To apply a sample configuration:

kubectl apply -f examples/sample_deployment.yaml

Documentation

Refer to the docs/ directory for detailed guides:

  • setup.md: Step-by-step setup instructions.
  • optimization.md: Techniques to optimize deployments.
  • troubleshooting.md: Common issues and solutions.

Contributing

We welcome contributions! Follow these steps:

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes.
  4. Open a pull request.

License

This project is licensed under the MIT License.


Contact

For questions or support, reach out via GitHub Issues or contact the maintainer directly.

About

A comprehensive repository for Kubernetes Operators and Helm Charts development, featuring customizable Helm charts, operator CRDs, reconciliation logic, example deployments, and detailed documentation for efficient Kubernetes application management.

Resources

License

Stars

Watchers

Forks

Packages

No packages published