Warning
You are currently viewing v"1.5" of the documentation and it is not the latest. For the most recent documentation, kindly click here.
What is KEDA and why is it useful?
What are the prerequisites for using KEDA?
Does KEDA depend on any Azure service?
Does KEDA only work with Azure Functions?
Why should we use KEDA if we are already using Azure Functions in Azure?
There are a few reasons for this:
Can I scale my HTTP container or function with KEDA and Kubernetes?
KEDA will scale a container using metrics from a scaler, but unfortunately there is no scaler today for HTTP workloads.
We recommend using the Prometheus scaler to create scale rule based on metrics around HTTP events for now. Read Anirudh Garg’s blog post to learn more.
Where can I get to the code for the Scalers?
Is short polling intervals a problem?
How can I get involved?
There are several ways to get involved.
Can KEDA be used in production?
What does it cost?
How do I access KEDA resources using client-go
?
KEDA resources can be accessed using the dynamic
client from the client-go
package. The dynamic client’s Resource()
method accepts a
GroupVersionResource
describing the type of resource to be accessed and returns a
NamespaceableResourceInterface
which contains methods to retrieve, create, or manipulate that resource. Here’s a code sample
containing a function that retrieves a KEDA ScaledObject
resource by name.
package main
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/client-go/tools/clientcmd"
"os"
)
var (
kedaGVR = schema.GroupVersionResource{
Group: "keda.k8s.io",
Version: "v1alpha1",
Resource: "scaledobjects",
}
)
func GetScaledObjectByName(name string) {
config, err := clientcmd.BuildConfigFromFlags("", os.Getenv("HOME")+"/.kube/config")
dynClient, err := dynamic.NewForConfig(config)
if err != nil {
panic(err)
}
scaledObjectClient := dynClient.Resource(kedaGVR)
scaledObject, err := scaledObjectClient.Namespace("default").Get(name, metav1.GetOptions{})
if err != nil {
fmt.Printf("Error retrieving scaledobjects: %s
", err)
} else {
fmt.Printf("Got ScaledObject:
%v", scaledObject)
}
}