Define the Application using Helm
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 min/max pod limits. The Event Agent adjusts the minimum pod limit based on calendar scheduling.
This topic describes how to configure the Smart Scaler agents and define the applications by creating a ConfigMap.
Delete the Default ConfigMap
Installing a Smart Scaler Agent defines the ConfigMap. To get 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-apollo
namedDataSources:
- name: "" # This is the same name that you used in the agent configuration
datasourceType: "" # This is the type of the datasource
url: "" # URL of the datasource
namedGitSecrets:
# This is the secret that will be used to access the git repository for Event Auto-scaling. Use as many secrets as you might need for different repositories.
- name: "" # This is the name of the secret. This will be used in the ApplicationConfig to refer the secret.
gitUsername: "" # Github Username (plaintext)
gitPassword: "" # PAT token (plaintext)
url: "" # URL of the git repository
configGenerator:
apps:
- app: "" # name of the application. e.g. awesome-app
app_version: "" # version of the application. e.g. 1.0
namedDatasource: "" # reference to the namedDataSources. e.g. datadog
default_fallback: 3 # Default fallback value
use_collector_queries: false # Use only datasource collector queries
gitConfig: # These are global configurations for the git repository. It will be a fallback if the deployment specific configurations are not provided. You can skip this if you don't want to use the global configurations.:
branch: "" # branch of the git repo. e.g. main
repository: "" # url of the git repo where deployment charts are stored. e.g. https://github.com/smart-scaler/smartscaler-tutorials
secretRef: "" # reference to the namedGitSecrets.
clusters:
- name: "" # 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 : "" # name of the namespace. e.g. acmefitness
metricsType : "" # type of the metrics. e.g. istio
deployments: # list of k8s deployments:
- name: "" # name of your k8s application deployment. e.g. cart
fallback: 3 # Fallback value
eventConfig: # configurations for event auto-scaling:
gitPath: "" # path to the values.yaml file in the git repo. This is the location of the values file where you made the changes to enable SmartScaler. e.g. custom-values.yaml
gitConfig: # These are the configurations for the git repository. It will override the global configurations.:
branch: "" # branch of the git repo for the deployment. e.g. main
repository: "" # url of the git repo where deployment charts are stored. e.g. https://github.com/smart-scaler/smartscaler-tutorials
secretRef: "" # reference to the namedGitSecrets -
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 1minfoYou have successfully configured the Smart Scaler agents. You can now start using the Smart Scaler to autoscale your applications.