Skip to content

Commit

Permalink
Added instructions to install KRR in-cluster (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavangudiwada authored Dec 31, 2024
1 parent 4c657aa commit ce724a1
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,28 @@ us-central1-docker.pkg.dev/genuine-flight-317411/devel/krr:v1.8.3
We do **not** recommend installing KRR from source in airgapped environments due to the headache of installing Python dependencies. Use one of the above methods instead and contact us (via Slack, GitHub issues, or email) if you need assistance.
</details>

<details>
<summary>In-Cluster</summary>

Apart from running KRR as a CLI tool you can also run KRR inside your cluster. We suggest installing KRR via the <a href="https://platform.robusta.dev/#">Robusta Platform</a>
. It gives you a <a href="https://platform.robusta.dev/#">free UI</a> with some features like the following
* View application usage history graphs on which recommendations are based.
* Get application, namespace and cluster level recommendations.
* YAML configuration to apply the suggested recommendation and more

<img src="./images/ui_screenshot_new.png">

<img src="./images/ui_recommendation.png">

You can also run KRR in-cluster as a Kubernetes Job, if you don't want to view results easily in a <a href="https://platform.robusta.dev/#">UI</a>.

```
kubectl apply -f https://raw.githubusercontent.com/robusta-dev/krr/refs/heads/main/docs/krr-in-cluster/krr-in-cluster-job.yaml
```
</details>


<details>
<summary>From Source</summary>

Expand Down
122 changes: 122 additions & 0 deletions docs/krr-in-cluster/krr-in-cluster-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: krr-cluster-role
namespace: default
rules:
- apiGroups:
- ""
resources:
- configmaps
- daemonsets
- deployments
- namespaces
- pods
- replicasets
- replicationcontrollers
- services
verbs:
- get
- list
- watch

- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch

- apiGroups:
- apps
resources:
- daemonsets
- deployments
- deployments/scale
- replicasets
- replicasets/scale
- statefulsets
verbs:
- get
- list
- watch

- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- deployments/scale
- ingresses
- replicasets
- replicasets/scale
- replicationcontrollers/scale
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- "autoscaling"
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: krr-service-account
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: krr-cluster-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: krr-cluster-role
subjects:
- kind: ServiceAccount
name: krr-service-account
namespace: default

---
apiVersion: batch/v1
kind: Job
metadata:
name: krr
namespace: default
spec:
template:
spec:
containers:
- command:
- /bin/sh
- -c
- "python krr.py simple --max-workers 3 --width 2048 "
image: robustadev/krr:v1.17.0
imagePullPolicy: Always
name: krr
resources:
limits:
memory: 2Gi
requests:
memory: 1Gi
restartPolicy: Never
serviceAccount: krr-service-account
serviceAccountName: krr-service-account
Binary file added images/ui_recommendation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/ui_screenshot.jpeg
Binary file not shown.
Binary file added images/ui_screenshot_new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ce724a1

Please # to comment.