Kedify Agent
The Kedify Agent is responsible for establishing a secure connection between your Kubernetes cluster and the Kedify platform. It handles the installation and lifecycle management of KEDA and the HTTP Scaler on your clusters, providing robust scaling capabilities and telemetry insights. The Kedify Agent can manage a large number of installations across multiple clusters using secure gRPC connections to communicate with the Kedify Dashboard, ensuring the seamless collection and display of telemetry data.
Key functionalities of the Kedify Agent include:
-
Installation Management: The agent manages the installation and versioning of KEDA and the HTTP Scaler using the Helm package manager. It ensures that the correct versions of these components are deployed and maintained across your clusters.
-
Telemetry Collection: The agent includes a telemetry collector that scrapes metrics from KEDA, the HTTP Scaler, and opted-in Kubernetes workloads. This telemetry data provides users with valuable insights into their configurations, scaling behaviors, and container resource recommendations, which are displayed in the Kedify Dashboard under Insights section.
-
Secure Communication: The Kedify Agent establishes a secure, outbound gRPC connection to the Kedify Service, ensuring that all data transmitted between your clusters and the Kedify platform is secure.
-
Custom Resource Management: The agent manages Kedify custom resources, providing autowiring and comprehensive management of the HTTP Scaler. For more information on custom resources, refer to the Kedify Custom Resource Definitions.
The Kedify Agent can be installed through helm chart or using a single, unique kubectl apply command generated and provided by Kedify via the dashboard. This command sets up the agent with all necessary configurations to connect to the Kedify platform and manage your KEDA and HTTP Scaler installations efficiently.
The Kedify Agent relies on the Helm package manager to manage and install versioned KEDA images.
Configuration
Section titled “Configuration”Full set of configuration options is available in Kedify Agent chart values. Here are some notable options:
-
agent.features.podResourceProfilesEnabled: Enables the controller forPodResourceProfileto be started by Kedify Agent. The feature is further described on its own docs. By default, it istrue. Env var equivalent:PRP_ENABLED. -
agent.features.prpRequiresAnnotatedPods: If enabled, the controller forPodResourceProfilerequires the target pods (where container resources should be modified) to have annotationprp.kedify.io/reconcile=enabledon them. This is a performance optimization so that more pod events can be ignored by the controller. Default:true. Env var equivalent:PRP_REQUIRES_ANNOTATED_PODS. -
agent.features.podResourceAutoscalersEnabled: Enables the controller for Pod Resource Autoscaler. Default isfalse; set it totrueto enable PRA. Env var equivalent:PRA_ENABLED. -
agent.features.distributedScaledObjectsEnabled: Enables the controller forDistributedScaledObjectused by Multi-Cluster Scaling. Starting with Kedify Agentv0.5.0, default isfalseand you need to set it totrueto activate the feature. Env var equivalent:DSO_ENABLED. -
agent.features.distributedScaledJobsEnabled: Enables the controller forDistributedScaledJobused by Multi-Cluster Scaling. Starting with Kedify Agentv0.5.0, default isfalseand you need to set it totrueto activate the feature. Env var equivalent:DSJ_ENABLED. -
agent.features.scalingPoliciesEnabled: Enables the controller for Scaling Policy. Default istrue; set it tofalseto disable the controller. Env var equivalent:SCALING_POLICY_ENABLED. -
agent.features.recommendationsForLabeledNamespaces: Limits Kubernetes container utilization scraping to opted-in namespaces. Default:true. Env var equivalent:METRICS_FOR_LABELED_NAMESPACES_ENABLED. -
agent.metricsWatchNamespace: Comma-separated list of namespaces where Kubernetes container utilization metrics should be collected. Whenagent.features.recommendationsForLabeledNamespaces=true, explicit namespaces in this list are added to the labeled namespaces. When label-gated collection is disabled, an unset or empty value means all namespaces. Env var equivalent:METRICS_WATCH_NAMESPACE. -
agent.kedifyProxy.clusterWide: Enables the cluster-wide deployment ofkedify-proxy, shared across all namespaces in the cluster. This variable should be set totrueto configure a single instance ofkedify-proxyin the KEDA installation namespace for centralized scaling. The cluster-wide setup is supported only for configurations using Istio’s VirtualService. For more details, see Kedify Proxy. -
agent.kedifyProxy.globalValues: Set of options to configurekedify-proxydeployments. See Kedify Proxy helm chart for more details. This can also be fine-tuned per namespace throughagent.kedifyProxy.namespacedValues.${NAMESPACE}.
Container Metrics for Resource Recommendations
Section titled “Container Metrics for Resource Recommendations”Kedify Agent can collect container CPU and memory utilization from the Kubernetes Metrics API and send it to Kedify for resource recommendations. To keep collection explicit, namespace label filtering is enabled by default.
Opt in a namespace by adding the insights.kedify.io/scrape label with any value except false, disabled, or paused:
kubectl label namespace production insights.kedify.io/scrape=enabledPause or disable collection for a namespace by changing the label value:
kubectl label namespace production insights.kedify.io/scrape=paused --overwriteYou can also remove the label to opt the namespace out:
kubectl label namespace production insights.kedify.io/scrape-If you manage the namespace list centrally using GitOps, set agent.metricsWatchNamespace on the Kedify Agent Helm chart. Explicit namespaces from this value are still collected when label-gated collection is enabled. To return to the older cluster-wide behavior, set agent.features.recommendationsForLabeledNamespaces=false; with that setting, agent.metricsWatchNamespace controls the scrape scope and an unset or empty namespace list means all namespaces.
Container utilization metrics require the Kubernetes Metrics API, usually provided by metrics-server or a compatible adapter. The Kedify Agent Helm chart includes the required RBAC for namespace discovery and workload metric collection.
API Key
Section titled “API Key”The Kedify Agent uses an API key to authenticate with the Kedify platform. This key is generated by the Kedify platform and provided to the agent during installation. There could be multiple valid API keys defined per Organization.
The API key can be rotated in the Kedify Dashboard in the Organization -> API Keys section. When rotated, it is the responsibility of the user to update the API key in the Kedify Agent configuration. The key is stored in a Kubernetes Secret as a base64 encoded string.
First, run the new API key through the base64 function:
key="kfy_971fac53610186bc26891e08b73076c297552073f57c4c6fa6c563c6821d4384"echo -n "$key" | base64 -w 0 ; echo ""a2Z5Xzk3MWZhYzUzNjEwMTg2YmMyNjg5MWUwOGI3MzA3NmMyOTc1NTIwNzNmNTdjNGM2ZmE2YzU2M2M2ODIxZDQzODQ=Then, update the API key in the Secret. Either in your gitops repository or directly in the cluster:
kubectl edit secret kedify-agent -n kedaapiVersion: v1kind: Secrettype: Opaquemetadata: name: kedify-agent namespace: kedadata: apikey: a2Z5Xzk3MWZhYzUzNjEwMTg2YmMyNjg5MWUwOGI3MzA3NmMyOTc1NTIwNzNmNTdjNGM2ZmE2YzU2M2M2ODIxZDQzODQ=