sample-go-rabbitmq icon indicating copy to clipboard operation
sample-go-rabbitmq copied to clipboard

The sample is not compatible with the latest `ScaledObject` CRD

Open ivanRylach opened this issue 4 years ago • 2 comments

When following the README, rabbitmq-consumer does not scale to 0. keda-operator prints following errors:

ScaledObject.keda.k8s.io "rabbitmq-consumer" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"keda.k8s.io/v1alpha1", "kind":"ScaledObject", "metadata":map[string]interface {}{"annotations":map[string]interface {}{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"keda.k8s.io/v1alpha1\",\"kind\":\"ScaledObject\",\"metadata\":{\"annotations\":{},\"labels\":{\"deploymentName\":\"rabbitmq-consumer\"},\"name\":\"rabbitmq-consumer\",\"namespace\":\"default\"},\"spec\":{\"cooldownPeriod\":10,\"maxReplicaCount\":30,\"pollingInterval\":5,\"scaleTargetRef\":{\"deploymentName\":\"rabbitmq-consumer\"},\"triggers\":[{\"metadata\":{\"host\":\"RabbitMqHost\",\"queueLength\":\"5\",\"queueName\":\"hello\"},\"type\":\"rabbitmq\"}]}}\n"}, "creationTimestamp":"2019-11-26T03:18:36Z", "finalizers":[]interface {}{"finalizer.keda.k8s.io"}, "generation":1, "labels":map[string]interface {}{"deploymentName":"rabbitmq-consumer"}, "name":"rabbitmq-consumer", "namespace":"default", "resourceVersion":"35693", "uid":"6eed936f-0ffb-11ea-80f3-025000000001"}, "spec":map[string]interface {}{"cooldownPeriod":10, "maxReplicaCount":30, "pollingInterval":5, "scaleTargetRef":map[string]interface {}{"deploymentName":"rabbitmq-consumer"}, "triggers":[]interface {}{map[string]interface {}{"metadata":map[string]interface {}{"host":"RabbitMqHost", "queueLength":"5", "queueName":"hello"}, "type":"rabbitmq"}}}, "status":map[string]interface {}{"externalMetricNames":[]interface {}{"queueLength"}}}: validation failure list:
status.currentReplicas in body is required
status.desiredReplicas in body is required

The latest ScaledObject CRD has the following ScaledObjectStatus definition

"status": {
	"description": "ScaledObjectStatus is the status for a ScaledObject resource",
	"properties": { ... },
	"required": [
		"currentReplicas",
		"desiredReplicas"
	],
	"type": "object"
}

ivanRylach avatar Nov 26 '19 04:11 ivanRylach