Skip to content

Commit

Permalink
added permissions for automatic right sizing with opt-out option (#109)
Browse files Browse the repository at this point in the history
* added permissions for automatic right sizing with opt-out option

* bump chart version

* update docs
  • Loading branch information
TalShafir authored Mar 17, 2024
1 parent f4224d5 commit 3ccbb65
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/ocean-kubernetes-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: ocean-kubernetes-controller
description: A Helm chart for Ocean Kubernetes Controller
type: application
version: 0.1.29
version: 0.1.30
appVersion: 2.0.50
kubeVersion: ">=1.20.0-0"
maintainers:
Expand Down
3 changes: 2 additions & 1 deletion charts/ocean-kubernetes-controller/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ocean-kubernetes-controller

![Version: 0.1.29](https://img.shields.io/badge/Version-0.1.29-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.50](https://img.shields.io/badge/AppVersion-2.0.50-informational?style=flat-square)
![Version: 0.1.30](https://img.shields.io/badge/Version-0.1.30-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.50](https://img.shields.io/badge/AppVersion-2.0.50-informational?style=flat-square)

A Helm chart for Ocean Kubernetes Controller.

Expand Down Expand Up @@ -135,6 +135,7 @@ Kubernetes: `>=1.20.0-0`
| spotinst.baseUrl | string | `""` | Base URL. (Optional) |
| spotinst.clusterIdentifier | string | `""` | Unique identifier used by the Ocean Controller to connect (Required) between the Ocean backend and the Kubernetes cluster. Ref: https://docs.spot.io/ocean/tutorials/spot-kubernetes-controller/ |
| spotinst.disableAutoUpdate | bool | `false` | Disable auto update. (Optional) |
| spotinst.disableAutomaticRightSizing | bool | `false` | Disable automatic RightSizing. (Optional) |
| spotinst.enableCsrApproval | bool | `false` | Enable CSR approval. (Optional) |
| spotinst.proxyUrl | string | `""` | Proxy URL. (Optional) |
| spotinst.token | string | `""` | Spot Token. (Required) Ref: https://docs.spot.io/administration/api/create-api-token |
Expand Down
15 changes: 15 additions & 0 deletions charts/ocean-kubernetes-controller/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ rules:
- apiGroups: [ "autoscaling" ]
resources: [ "horizontalpodautoscalers" ]
verbs: [ "get", "list", "watch" ]
- apiGroups: [ "autoscaling.k8s.io" ]
resources: [ "verticalpodautoscalers" ]
verbs: [ "get", "list", "watch" ]
- apiGroups: [ "apiextensions.k8s.io" ]
resources: [ "customresourcedefinitions" ]
verbs: [ "get", "list", "watch" ]
Expand All @@ -55,6 +58,7 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["delete"]
{{- if .Values.spotinst.enableCsrApproval }}
# ---------------------------------------------------------------------------
# feature: ocean/csr-approval
# ---------------------------------------------------------------------------
Expand All @@ -68,6 +72,8 @@ rules:
resources: ["signers"]
resourceNames: ["kubernetes.io/kubelet-serving", "kubernetes.io/kube-apiserver-client-kubelet"]
verbs: ["approve"]
{{- end }}
{{- if not .Values.spotinst.disableAutoUpdate }}
# ---------------------------------------------------------------------------
# feature: ocean/auto-update
# ---------------------------------------------------------------------------
Expand All @@ -79,6 +85,7 @@ rules:
resources: ["deployments"]
resourceNames: ["spotinst-kubernetes-cluster-controller"]
verbs: ["patch", "update"]
{{- end }}
# ---------------------------------------------------------------------------
# feature: ocean/apply
# ---------------------------------------------------------------------------
Expand All @@ -103,6 +110,14 @@ rules:
- apiGroups: ["bigdata.spot.io"]
resources: ["bigdataenvironments"]
verbs: ["get", "list", "watch", "patch", "update", "create", "delete"]
{{- if not .Values.spotinst.disableAutomaticRightSizing }}
# ---------------------------------------------------------------------------
# feature: automatic right-sizing
# ---------------------------------------------------------------------------
- apiGroups: ["autoscaling.k8s.io"]
resources: ["verticalpodautoscalers", "verticalpodautoscalers/status"]
verbs: ["get", "list", "watch", "patch", "update", "create", "delete"]
{{- end }}
# ---------------------------------------------------------------------------
# feature: controller/leader-election (high-availability)
# ---------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions charts/ocean-kubernetes-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ spotinst:
disableAutoUpdate: false
# -- Enable CSR approval. (Optional)
enableCsrApproval: false
# -- Disable automatic RightSizing. (Optional)
disableAutomaticRightSizing: false

# -- Configure the amount of replicas for the controller (Optional)
replicas: 2
Expand Down

0 comments on commit 3ccbb65

Please sign in to comment.