Skip to content

Commit

Permalink
feat: adding metrics-server and vpa as dependencies of the main chart (
Browse files Browse the repository at this point in the history
  • Loading branch information
jfavellar90 committed Apr 18, 2023
1 parent 5df8d52 commit ac53842
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ infra-*/.terraform*
infra-*/secrets.auto.tfvars
my-notes
values.yaml
tutor-multi-chart/charts/*.tgz
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,39 @@ This helm chart uses [ingress-nginx](https://kubernetes.github.io/ingress-nginx/

In addition, [the cert-manager Helm charts do not install the required CRDs used by cert-manager](https://cert-manager.io/docs/installation/upgrading/#crds-managed-separately), so you will need to manually install and upgrade them to the correct version as described in the instructions below. This is due to the some limitations in the management of CRDs by Helm.

### How the autoscaling capabilities are implemented in this project?

Tutor does not offer an autoscaling mechanism by default. This is a critical feature when your application starts to
receive more and more traffic. Kubernetes offers two main autoscaling methods:

- **Pod-based scaling**: This mechanism consists of the creation and adjustment of new pods to cover growing workloads.
Here we can mention tools like
[**Horizontal Pod autoscaler (HPA)**](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/)
and [**Vertical pod autoscaler (VPA)**](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler).
The first consist of automatically increasing or decreasing the number of pods in response to a workload's metric
consumption (generally CPU and memory), and the second one aims to stabilize the consumption and resources of every pod
by providing suggestions on the best configuration for a workload based on historical resource usage measurements. Both
of them are meant to be applied over Kubernetes Deployment instances.

- **Node-based scaling:** This mechanism allows the addition of new NODES to the Kubernetes cluster so compute resources
are guaranteed to schedule new incoming workloads. Tools worth mentioning in this category are
[**cluster-autoscaler (CA)**](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) and
[Karpenter](https://karpenter.sh/).

For the scope of this project, the focus will be in the **pod-based scaling** mechanisms since Node-based scaling tools
require configuration which is external to the cluster, which is out of the scope for this Helm chart for now.

The approach will be to use pod autoscaling on each environment separately (assuming there are installations on different
namespaces) following the steps below:

1. **Install the global dependencies**: this Helm chart offers the option of installing the dependencies required to
get HPA and VPA working (they are included as subcharts). These are the Helm charts for **metrics-server** and **VPA**.
By default these dependencies are not installed, however you can enable them via the Helm chart values if they aren't
still present in your cluster.
2. **Enable the pod-autoscaling plugin per environment**: the
[pod-autoscaling plugin](https://github.com/eduNEXT/tutor-contrib-pod-autoscaling) enables the implementation of HPA and
VPA to start scaling an installation workloads. Variables for the plugin configuration are documented there.



<br><br><br>
Expand Down
10 changes: 8 additions & 2 deletions harmony-chart/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ dependencies:
- name: elasticsearch
repository: https://helm.elastic.co
version: 7.17.3
digest: sha256:833041ca860a77cc220bdc97f7b6af8ff8b6da0c0a021615dc2858138a29bbbd
generated: "2023-02-26T12:17:23.507774503+02:00"
- name: metrics-server
repository: https://kubernetes-sigs.github.io/metrics-server/
version: 3.8.4
- name: vertical-pod-autoscaler
repository: https://cowboysysop.github.io/charts/
version: 6.0.3
digest: sha256:4915c21724a8c4693f749aab2c311336990b48e16e90884d7b9ceca42eef69f8
generated: "2023-04-13T23:07:43.616994532-05:00"
12 changes: 12 additions & 0 deletions harmony-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ dependencies:
version: "7.17.3"
condition: elasticsearch.enabled
repository: https://helm.elastic.co

- name: metrics-server
version: "~3.8.3"
repository: https://kubernetes-sigs.github.io/metrics-server/
alias: metricsserver
condition: metricsserver.enabled

- name: vertical-pod-autoscaler
version: "~6.0.3"
repository: https://cowboysysop.github.io/charts/
alias: vpa
condition: vpa.enabled
Binary file added harmony-chart/charts/elasticsearch-7.17.3.tgz
Binary file not shown.
Binary file added harmony-chart/charts/metrics-server-3.8.4.tgz
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions harmony-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,19 @@ elasticsearch:
xpack.security.transport.ssl.certificate: /usr/share/elasticsearch/config/certs/tls.crt
xpack.security.transport.ssl.certificate_authorities: /usr/share/elasticsearch/config/certs/ca.crt
xpack.security.transport.ssl.verification_mode: certificate
# Configuration for the metrics server chart
metricsserver:
# Control the chart inclusion
enabled: false
# See https://github.com/kubernetes-sigs/metrics-server/blob/master/charts/metrics-server/values.yaml
# for all available options
replicas: 1
# Configuration for the Vertical Pod Autoscaler chart
vpa:
# Control the chart inclusion
enabled: false
# See https://github.com/cowboysysop/charts/blob/master/charts/vertical-pod-autoscaler/values.yaml
# for all available options
admissionController:
replicaCount: 1
5 changes: 5 additions & 0 deletions values-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ cert-manager:

elasticsearch:
enabled: false

metricsserver:
enabled: false
vpa:
enabled: false

0 comments on commit ac53842

Please sign in to comment.