Skip to content

matthieugusmini/k8s-patch-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k8s-patch-app

This Go application provides functionality to patch Kubernetes deployments using JSON patches. It utilizes the Kubernetes client library.

🚀 Prerequisites

Ensure you have the following prerequisites installed:

  • Go
  • Kubernetes cluster access
  • kubectl configured (for obtaining kubeconfig)

💾 Installation

Clone the repository:

git clone [email protected]:matthieugusmini/k8s-patch-app.git
cd k8s-patch-app

Build the application:

make build

✍ Usage

Run the application with the following command:

./k8s-patch-app -n <deployment-name> -p <json-patch>

For more details:

$ ./k8s-patch-app --help
Usage of ./k8s-patch-app:
  -k string
        (optional) absolute path to the kubeconfig file
  -n string
        Deployment name to patch
  -p string
        JSON patch

Example:

./k8s-patch-app -n=foo -p='[{"op": "replace", "path": "/spec/replicas", "value": 42}]'

📝 Description

The application reads the Kubernetes configuration from the provided kubeconfig file or uses the default location (~/.kube/config). It then patches the specified deployment with the provided JSON patch.

To-Do List

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published