Auto-manage k8s resources
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
The Resource-Manager operator has built to automatically manage your kubernetes objects.
Here's why:
- You can easily create scheduled policies that will allow you to manage your kubernetes objects
- You shouldn't be doing the same tasks over and over like deleting some pods or namespaces
- add the helm repo
helm repo add resource-manager https://tikalk.github.io/resource-manager helm repo update
- Install the chart
helm install resource-manager resource-manager/resource-manager-operator \ --create-namespace -n resource-manager
Let's say you want to give a specific deployments only 8 hours to live. You can create this kind of policy by applying a ResourceManager object.
Delete every deployment in default namespace that has the 'app=nginx' label, after 8 hours from its creation time
apiVersion: resource-management.tikalk.com/v1alpha1
kind: ResourceManager
metadata:
name: resource-manager-example
namespace: default
spec:
resourceKind: "Deployment"
selector:
matchLabels:
app: nginx
action: delete
expiration:
after: "8h"
You can also delete a resource within a specific hour by using the 'at' key. let's say 12:00
Delete a specific deployment on 12:00, on a daily basis
apiVersion: resource-management.tikalk.com/v1alpha1
kind: ResourceManager
metadata:
name: resource-manager-example
namespace: default
spec:
resourceKind: "Deployment"
selector:
matchLabels:
app: nginx
action: delete
expiration:
at: "12:00"
Add the 'dry-run' key for only validate and verify the action
apiVersion: resource-management.tikalk.com/v1alpha1
kind: ResourceManager
metadata:
name: resource-manager-example
namespace: default
spec:
disabled: false
dry-run: false
selector:
matchLabels:
app: nginx
action: delete
expiration:
after: "30m"
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License.