Skip to content

The AdoptedResource CRD does not work for ApplicationAutoscaling Service Controller #766

@mbaijal

Description

@mbaijal

Describe the bug
The AdoptedResource CRD does not work for ApplicationAutoscaling Service Controller since the ScalingPolicy and ScalableTarget Describe APIs require more than one field to work.

Steps to reproduce

  1. Create an endpoint in SageMaker and enable applicationAutoscaling using the AWS Console.
  2. Check using awscli to ensure that the ScalingPolicy resource exists aws application-autoscaling describe-scaling-policies --service-namespace SageMaker --region us-west-2.
  3. Update ApplicationAutoscaling to v0.1.1 runtime and latest code-gen. Verify that you have the AdoptedResource CRD.
  4. Now try to adopt the resource into Kubernetes using a spec file as follows -
apiVersion: services.k8s.aws/v1alpha1
kind: AdoptedResource
metadata:
  name: adoptedscalingpolicy
spec:
  aws:
    nameOrID: "endpoint/ep-name/variant/AllTraffic"
  kubernetes:
    group: applicationautoscaling.services.k8s.aws
    kind: ScalingPolicy
    metadata:
      name: adopted_scaling_policy
  1. check that the resource was adopted using kubectl get scalingpolicies.applicationautoscaling.services.k8s.aws

Expected outcome
Resource should have been adopted into k8s

Actual Outcome
The following error in the pod logs -

2021-05-11T10:24:55.574Z	ERROR	controller-runtime.controller	Reconciler error	{"controller": "adoptedresource", "request": "default/adoptedscalingpolicy", "error": "InvalidParameter: 1 validation error(s) found.\n- missing required field, DescribeScalingPoliciesInput.ServiceNamespace.\n"}

Environment
Tested using a Kind Cluster

  • Kubernetes version: 16.*
  • Using EKS (yes/no), if so version?: no
  • AWS service targeted (S3, RDS, etc.): ApplicationAutoscaling

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions