[[qna]]
q = "What is KEDA and why is it useful?"
a = "KEDA stands for Kubernetes Event-driven Autoscaler. It is built to be able to activate a Kubernetes deployment (i.e. no pods to a single pod) and subsequently to more pods based on events from various event sources."

[[qna]]
q = "What are the prerequisites for using KEDA?"
a = """
KEDA is community-supported. For all support options, see the [Support](/support/) page.

KEDA releases are tested against specific Kubernetes versions. Refer to the documentation for the tested versions for your KEDA release.

KEDA uses a CRD (custom resource definition) and the Kubernetes metric server, so you will need a Kubernetes version that supports these components.
"""

[[qna]]
q = "Does KEDA depend on any Azure service?"
a = "No, KEDA only takes a dependency on standard Kubernetes constructs and can run on any Kubernetes cluster whether in OpenShift, AKS, GKE, EKS or your own infrastructure."

[[qna]]
q = "Does KEDA only work with Azure Functions?"
a = "No, KEDA can scale up/down any container that you specify in your deployment. There has been work done in the Azure Functions tooling to make it easy to scale an Azure Function container."

[[qna]]
q = "Why should we use KEDA if we are already using Azure Functions in Azure?"
a = """
There are a few reasons for this:

* Run functions on-premises (potentially in something like an 'intelligent edge' architecture)
* Run functions alongside other Kubernetes apps (maybe in a restricted network, app mesh, custom environment, etc.)
* Run functions outside of Azure (no vendor lock-in)
* Specific need for more control (GPU enabled compute clusters, policies, etc.)
"""

[[qna]]
q = "Can I scale my HTTP container or function with KEDA and Kubernetes?"
a = """
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](/scalers/prometheus/) to create scale rule based on metrics around HTTP events for now. Read [Anirudh Garg's blog post](https://dev.to/anirudhgarg_99/scale-up-and-down-a-http-triggered-function-app-in-kubernetes-using-keda-4m42) to learn more.
"""

[[qna]]
q = "Where can I get to the code for the Scalers?"
a = "All scalers have their code [here](https://github.com/kedacore/keda/tree/main/pkg/scalers)."

[[qna]]
q = "Is short polling intervals a problem?"
a = "Polling interval really only impacts the time-to-activation (scaling from 0 to 1) but once scaled to one it's really up to the HPA (horizontal pod autoscaler) which polls KEDA."

[[qna]]
q = "How can I get involved?"
a = """
There are several ways to get involved.

* Pick up an issue to work on. A good place to start might be issues which are marked as [Good First Issue](https://github.com/kedacore/keda/labels/good%20first%20issue) or [Help Wanted](https://github.com/kedacore/keda/labels/help%20wanted)
* We are always looking to add more scalers.
* We are always looking for more samples, documentation, etc.
* Please join us in our [weekly standup](https://github.com/kedacore/keda#community).
"""

[[qna]]
q = "Can KEDA be used in production?"
a = "Yes! KEDA is now 1.0 and suited for production workloads."

[[qna]]
q = "What does it cost?"
a = "There is no charge for using KEDA itself."


[[qna]]
q = "How do I access KEDA resources using `client-go`?"
a = """
KEDA resources can be accessed using the [dynamic
client](https://godoc.org/k8s.io/client-go/dynamic) from the `client-go` package.  The dynamic client's `Resource()` method accepts a
[GroupVersionResource](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupVersionResource)
describing the type of resource to be accessed and returns a
[NamespaceableResourceInterface](https://godoc.org/k8s.io/client-go/dynamic#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.

```go
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\n", err)
	} else {
		fmt.Printf("Got ScaledObject:\n %v", scaledObject)
	}
}
```
"""
