Installing KEDA

TOC

Prerequisites

KEDA is a tool that helps Kubernetes scale applications based on real-world events. With KEDA, you can adjust the size of your containers automatically, depending on the workload—like the number of messages in a queue or incoming requests.

  1. Download the KEDA installation package from Alauda Cloud.
  2. Upload the installation package using the Upload Packages mechanism.
INFO

Upload Packages: Administrator > Marketplace > Upload Packages page. Click Help Document on the right to get instructions on how to publish the operator to cluster. For more details, please refer to CLI.

Installing via Command Line

Installing KEDA Operator

Create namespace for KEDA operator if it does not exist:

kubectl apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
  name: "keda"
EOF

Run the following command to install KEDA Operator in your target cluster:

kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    cpaas.io/target-namespaces: ""
  labels:
    catalog: platform
  name: keda
  namespace: keda
spec:
  channel: stable
  installPlanApproval: Automatic
  name: keda
  source: custom
  sourceNamespace: cpaas-system
  startingCSV: keda.v2.17.2
EOF

Configuration Parameters:

ParameterRecommended Configuration
metadata.namekeda: The Subscription name is set to keda.
metadata.namespacekeda: The Subscription namespace is set to keda.
spec.channelstable: The default Channel is set to stable.
spec.installPlanApprovalAutomatic: The Upgrade action will be executed automatically.
spec.namekeda: The operator package name, must be keda.
spec.sourcecustom: The catalog source of keda operator, must be custom.
spec.sourceNamespacecpaas-system: The namespace of catalog source, must be cpaas-system.
spec.startingCSVkeda.v2.17.2: The starting CSV name of keda operator.

Creating the KedaController instance

Create KedaController resource named keda in namespace keda:

kubectl apply -f - <<EOF
apiVersion: keda.sh/v1alpha1
kind: KedaController
metadata:
  name: keda
  namespace: keda
spec:
  admissionWebhooks:
    logEncoder: console
    logLevel: info
  metricsServer:
    logLevel: "0"
  operator:
    logEncoder: console
    logLevel: info
  serviceAccount: null
  watchNamespace: ""
EOF

Installing via Web Console

Installing KEDA Operator

  1. Log in, and navigate to the Administrator page.
  2. Click Marketplace > OperatorHub.
  3. Find the KEDA operator, click Install, and enter the Install page.

Configuration Parameters:

ParameterRecommended Configuration
Channelstable: The default Channel is set to stable.
VersionPlease select the latest version.
Installation ModeCluster: A single Operator is shared across all namespaces in the cluster for instance creation and management, resulting in lower resource usage.
Installation LocationRecommended: It will be created automatically if it does not exist.
Upgrade StrategyPlease select the Auto.
  • the Upgrade action will be executed automatically.
  1. On the Install page, select default configuration, click Install, and complete the installation of the KEDA Operator.

Creating the KedaController instance

  1. Click on Marketplace > OperatorHub.

  2. Find the installed KEDA operator, navigate to All Instances.

  3. Click Create Instance button, and click KedaController card in the resource area.

  4. On the parameter configuration page for the instance, you may use the default configuration unless there are specific requirements.

  5. Click Create.

Verification

After the instance is successfully created, wait approximately 20 minutes, then checking if the KEDA components is already running with the command:

kubectl get pods -n keda

Additional Scenarios

Integrating ACP Log Collector

  • Ensure ACP Log Collector Plugin is installed in target cluster. Refer to Install Alauda Container Platform Log Collector Plugin。.
  • Enable the Platform logging switch when installing the ACP Log Collector Plugin.
  • Use the following command to add label to the keda namespace:
    kubectl label namespace keda cpaas.io/product=Container-Platform --overwrite

Uninstalling KEDA Operator

Removing the KedaController instance

kubectl delete kedacontroller keda -n keda

Uninstalling KEDA Operator via CLI

kubectl delete subscription keda -n keda

Uninstalling KEDA Operator via Web Console

To uninstall KEDA Operator, click on Marketplace > OperatorHub, select installed operator KEDA, and click Uninstall.