Define the Application using Helm
Installing the Smart Scaler Agent installs the Inference Agent and the Event Agent, and generates ConfigMap. This topic describes how to remove the default ConfigMap and define the applications if you want more flexibility.
Starting with Smart Scaler version 2.13.0, we have introduced a new default application definition
to simplify the process of onboarding applications to Smart Scaler. You only need to
identify the namespaces that contain the applications you want Smart Scaler to manage. To
do this, open the ss-agent-values.yaml
file downloaded from the management console's Agents page, and
add the list of namespaces to the namespaceAnnotationKey
label.
After the namespaces are defined, the Inference Agent assumes that all deployments in each specified namespace should be managed as a unit by Smart Scaler.
If this setup matches your deployment pattern, this is all you need to do to onboard your applications.
If this pattern does not match your cluster and you want to specifically identify the deployments that you would want Smart Scaler to manage, then you can define your applications as follows.
Overview
The Inference agent collects data from the data sources. For example, eBPF, Prometheus, Datadog. These metrics are send to the SaaS for recommendation and the recommendation is returned to the cluster. The recommendation is placed where HPA can observe the change and react by raising/lowering pod counts within HPA's minimum/maximum pod limits. The Event Agent adjusts the minimum pod limit based on calendar scheduling.
Delete the Default ConfigMap
Installing a Smart Scaler Agent defines the ConfigMap. To gain more flexibility, you can remove the default ConfigMap and create a new ConfigMap.
Use this command to remove the default ConfigMap that comes with the Smart Scaler Agent installation:
kubectl delete configmap <configmap-name> -n <namespace>
Example
kubectl delete configmap smart-scaler-config -n smart-scaler
Configure the Helm Properties
To configure the helm properties:
-
Create an
ss-appconfig-values.yaml
file.The following is the example
ss-appconfig-values.yaml
file.infoeBPF is the default monitoring tool used to configure the Interference Agent, and the In-Cluster approach is the default for event scaling. To use the GitOps approach for event scaling, contact support@avesha.com.
agentConfiguration:
# This will be pre populated by SmartScaler
clientID: <tenant-id> # This is preconfigured in your ss-appconfig-values.yaml file.
namedDataSources:
- name: "<ebpf / appdynamics / datadog / prometheus / >" # This is the same name that you used in the agent configuration
datasourceType: "<ebpf/datadog/prometheus>" # This is the type of the datasource
configGenerator:
apps:
- app: "<application name>" # name of the application. e.g. awesome-app
app_version: "<application version>" # version of the application. e.g. 1.0
namedDatasource: "<ebpf / appdynamics / datadog / prometheus / >" # reference to the namedDataSources. e.g. datadog
default_fallback: 3 # Default fallback value
use_collector_queries: false # Use only datasource collector queries
clusters:
- name: "<cluster>" # name of the cluster where the application is deployed. This should be same as your datadog metrics label. e.g. my-awesome-cluster
namespaces:
- name: "<namespace>" # name of the namespace. e.g. acmefitness
metricsType: "istio" # type of the metrics. e.g. istio
deployments: # list of k8s deployments
- name: <deployment name>
fallback: # Default fallback value
eventConfig: # Configuration for event scaling
ScaledObject: # Configuration for the scaled object
kind: # Default it the HorizontalPodAutoScaler. Possible values are HorizontalPodAutoScaler, ScaledOject.
name: # Name of the HPA, Default is the name of the deployment.
namespace: Namespace of the HPA. Default is the namespace of the deployment. -
Update the
ss-appconfig-values.yaml
as per your environment. -
Deploy the configuration by running the following command:
helm install smartscaler-configs smart-scaler/smartscaler-configurations -f ss-appconfig-values.yaml -n smart-scaler
The helm template will generate the necessary
Queries and ApplicationConfig
configurations based on your input and create the desired ConfigMap for the Inference Agent and ApplicationConfig CR for the event autoscaler.
Verify the Configuration
-
Use the following command to verify the configuration:
kubectl get applicationconfigs.agent.smart-scaler.io -n smart-scaler
Expected Output
NAME AGE
awesome-app 10s -
Use the following command to verify the
ConfigMap
:kubectl get configmap -n smart-scaler
Expected Output
NAME DATA AGE
agent-controller-autoscaler-config 2 1m
agent-controller-manager-config 1 1m
config-helper-ui-nginx 1 1m
kube-root-ca.crt 1 1m
smart-scaler-config 1 1mYou have successfully configured the Smart Scaler agents. You can now start using the Smart Scaler to autoscale your applications.