GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - InditexTech/k8s-overcommit-operator: A Kubernetes operator designed to intelligently manage resource overcommit on pod resource requests.

BranchesTags
Open more actions menu

Latest commit

 

History

69 Commits
69 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
LICENSES
LICENSES
 
 
api/v1alphav1
api/v1alphav1
 
 
bundle
bundle
 
 
chart
chart
 
 
cmd
cmd
 
 
config
config
 
 
deploy
deploy
 
 
docs
docs
 
 
hack
hack
 
 
internal
internal
 
 
pkg/overcommit
pkg/overcommit
 
 
test/e2e
test/e2e
 
 
.dockerignore
.dockerignore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.golangci.yml
.golangci.yml
 
 
.sync-exclude
.sync-exclude
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
NOTICE
NOTICE
 
 
PROJECT
PROJECT
 
 
README.md
README.md
 
 
REUSE.toml
REUSE.toml
 
 
SECURITY.md
SECURITY.md
 
 
Tiltfile
Tiltfile
 
 
bundle.Dockerfile
bundle.Dockerfile
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
repolinter.json
repolinter.json
 
 

Repository files navigation

๐Ÿš€ k8s-overcommit Operator

Intelligent resource overcommit management for Kubernetes clusters

GitHub License GitHub Release Go Version Build Status

Kubernetes Operator SDK Go Helm REUSE Compliance

GitHub Issues GitHub Pull Requests GitHub Stars GitHub Forks

๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿค Contributing โ€ข ๐Ÿ“ License

Logo

๐ŸŽฏ Overview

The k8s-overcommit Operator is a Kubernetes operator designed to intelligently manage resource overcommit on pod resource requests. It automatically adjusts CPU and memory requests based on configurable overcommit classes, enabling better cluster resource utilization while maintaining workload performance.

โœจ Key Features

  • ๐ŸŽ›๏ธ Flexible Overcommit Classes: Define different overcommit policies for different workload types
  • ๐Ÿท๏ธ Label-Based Configuration: Apply overcommit using pod or namespace labels
  • ๐Ÿ›ก๏ธ Namespace Exclusions: Protect critical namespaces from overcommit policies
  • ๐Ÿ“Š Default Policies: Fallback overcommit values when no specific class is defined
  • ๐Ÿ”’ Admission Webhooks: Seamless integration with Kubernetes admission controllers
  • ๐Ÿ“ˆ Resource Optimization: Improve cluster resource utilization efficiency

๐Ÿ“ฆ Where to find it

The operator is published in the community OLM catalogs, so it can be installed without cloning this repository:

Catalog Where it is available Package Channels
OperatorHub.io Any Kubernetes cluster running OLM k8s-overcommit stable (default), alpha
OpenShift community operators OpenShift 4.15 and later, through the embedded OperatorHub k8s-overcommit stable (default), alpha
Project catalog Any Kubernetes cluster running OLM, catalog published from this repository k8s-overcommit stable (default), alpha

On a disconnected cluster, mirror the catalog image into your own registry before installing; the operator image and cert-manager have to be mirrored as well.


๐Ÿš€ Quick Start

๐ŸŽฏ Method 1: Helm Installation (Recommended)

1๏ธโƒฃ Clone the Repository

Clone the repository to your local machine:

git clone https://github.com/InditexTech/k8s-overcommit-operator.git
cd k8s-overcommit-operator

2๏ธโƒฃ Configure Values

Edit the values.yaml file to customize your deployment. Below is an example configuration:

# Example configuration
deployment:
  image:
    registry: ghcr.io
    image: inditextech/k8s-overcommit-operator
    tag: 1.3.6

3๏ธโƒฃ Install with Helm

Install the operator using Helm:

helm install k8s-overcommit-operator chart

๐Ÿ”ง Method 2: OLM Installation

Option A: From the community catalogs (recommended)

The operator is published in the community OLM catalogs, so there is nothing to clone: on OpenShift 4.15 or later it is part of the embedded OperatorHub, and on upstream OLM clusters it comes from OperatorHub.io.

Create the Subscription:

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: k8s-overcommit
  namespace: openshift-operators
spec:
  channel: stable
  name: k8s-overcommit
  source: community-operators
  sourceNamespace: openshift-marketplace

community-operators in openshift-marketplace is the OpenShift catalog. On clusters that consume OperatorHub.io instead, use source: operatorhubio-catalog and sourceNamespace: olm. In the web console it is the same thing through Operators โ†’ OperatorHub, searching for "K8s Overcommit".

Option B: From this repository's own catalog

Use this when you want the catalog published by this project instead of the community one.

1. Install the CatalogSource

kubectl apply -f https://raw.githubusercontent.com/InditexTech/k8s-overcommit-operator/refs/heads/main/deploy/catalog_source.yaml

2. Apply the OperatorGroup

kubectl apply -f https://raw.githubusercontent.com/InditexTech/k8s-overcommit-operator/refs/heads/main/deploy/operator_group.yaml

3. Create the Subscription

The repository ships a working Subscription in deploy/subscription.yaml; apply it with:

kubectl apply -f https://raw.githubusercontent.com/InditexTech/k8s-overcommit-operator/refs/heads/main/deploy/subscription.yaml

Validation

After installation, check that the CSV reached Succeeded and that the operator pod is running (the namespace is openshift-operators with Option A and k8s-overcommit with Option B):

kubectl get csv -A | grep k8s-overcommit
kubectl get pods -A | grep k8s-overcommit

๐Ÿ“ Configuration

๐ŸŽฏ Overcommit Resource

Important

It's a singleton CRD: only can exist one, and it has to be called cluster

First, deploy the main Overcommit resource named "cluster":

apiVersion: overcommit.inditex.dev/v1alphav1
kind: Overcommit
metadata:
  name: cluster
spec:
  overcommitLabel: inditex.com/overcommit-class
  labels:
    environment: production
  annotations:
    description: "Main overcommit configuration"

๐Ÿท๏ธ OvercommitClass Resource

Define overcommit classes for different workload types:

apiVersion: overcommit.inditex.dev/v1alphav1
kind: OvercommitClass
metadata:
  name: high
spec:
  cpuOvercommit: 0.2        # 20% of limits as requests
  memoryOvercommit: 0.8     # 80% of limits as requests
  excludedNamespaces: ".*(^(openshift|k8s-overcommit|kube).*).*"
  isDefault: true
  labels:
    workload-type: batch
  annotations:
    description: "High-density workloads with aggressive overcommit"

๐Ÿ’ก How It Works

๐Ÿ” Label Resolution Priority

  1. Pod Level: Check if pod has the overcommit class label
  2. Namespace Level: If not found, check namespace labels
  3. Default Class: Apply default overcommit class if configured

๐Ÿ“Š Calculation Example

Original Pod Specification:

apiVersion: v1
kind: Pod
metadata:
  name: test
  labels:
    inditex.com/overcommit-class: high
spec:
  resources:
    limits:
      cpu: "2"
      memory: "2Gi"

With OvercommitClass (cpuOvercommit: 0.2, memoryOvercommit: 0.8):

apiVersion: v1
kind: Pod
metadata:
  name: test
  labels:
    inditex.com/overcommit-class: high
spec:
  resources:
    limits:
      cpu: "2"           # Unchanged
      memory: "2Gi"      # Unchanged
    requests:
      cpu: "400m"        # 2 * 0.2 = 0.4 cores
      memory: "1638Mi"   # 2Gi * 0.8 = 1.6GiB

๐Ÿ›ก๏ธ Namespace Exclusions

Protect critical namespaces using regex patterns:

excludedNamespaces: ".*(^(openshift|k8s-overcommit|kube).*).*"

This excludes:

  • openshift-*
  • k8s-overcommit-*
  • kube-*

๐Ÿ“š Documentation

Topic Description Link
๐Ÿ—๏ธ Architecture Detailed architecture overview Architecture Guide
๐Ÿงช E2E Testing End-to-end testing guide E2E Testing
๐ŸŽฏ Helm Configuration Helm chart configuration options Helm Values
๐Ÿค Contributing How to contribute to the project Contributing Guide
๐Ÿ“‹ Code of Conduct Community guidelines Code of Conduct

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details on how to:

  • ๐Ÿ› Report bugs
  • ๐Ÿ’ก Request features
  • ๐Ÿ”ง Submit pull requests
  • ๐Ÿ“ Improve documentation

๐Ÿš€ Development Quick Start

# Generate the manifests
make generate manifests

# Install the CRDs
make install

# Run locally
make run

# Run tests
make test

# Build image
make docker-build

๐Ÿš€ Develop with Tilt

Tilt is a tool that streamlines Kubernetes development by automating build, deploy, and live-update workflows.

./hack/tilt/run_tilt.sh

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Built with โค๏ธ by the Inditex Tech team
  • Powered by Operator SDK
  • Inspired by Kubernetes community best practices

โญ Star this project if you find it useful!

Made with โค๏ธ for the Kubernetes community


๐Ÿ—๏ธ Architecture

Architecture Diagram

๐Ÿ”„ Kubernetes API Flow

flowchart LR
    subgraph "Main Flow"
    A[๐Ÿ“ API Request] --> B[๐Ÿ”ง API HTTP Handler]
    B --> C[๐Ÿ” Authentication & Authorization]
    C --> D[๐Ÿ”„ Mutating Admission]
    D --> E[โœ… Object Schema Validation]
    E --> F[๐Ÿ›ก๏ธ Validating Admission]
    F --> G[๐Ÿ’พ Persisted to etcd]
    end

    subgraph "Mutating Webhooks"
    direction LR
    D --> MW1[๐Ÿ”„ Overcommit Webhook]
    D --> MW2[๐Ÿ”„ Other Webhooks]
    end

    subgraph "Validating Webhooks"
    direction LR
    F --> VW1[โœ… Validation Webhook 1]
    F --> VW2[โœ… Validation Webhook 2]
    F --> VW3[โœ… Validation Webhook 3]
    end
Loading

โฌ†๏ธ Back to Top

About

A Kubernetes operator designed to intelligently manage resource overcommit on pod resource requests.

Topics

k8s-operatorkubernetesopenshiftoperator-sdkovercommit

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

150 stars

Watchers

3 watching

Forks

13 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.