Bug 1664600 - [cloud-CA] Shouldn't be allowed to create more than one clusterautoscaler resource
Summary: [cloud-CA] Shouldn't be allowed to create more than one clusterautoscaler res...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.2.0
Assignee: Brad Ison
QA Contact: sunzhaohua
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-09 09:26 UTC by sunzhaohua
Modified: 2019-10-16 06:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:27:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:27:56 UTC

Description sunzhaohua 2019-01-09 09:26:30 UTC
Description of problem:
ClusterAutoscaler is a singleton resource, only one should be allowed to create. If the resource name is not "default",there should be a prompt.

Version-Release number of selected component (if applicable):
$ oc get clusterversion
NAME      VERSION                           AVAILABLE   PROGRESSING   SINCE     STATUS
version   4.0.0-0.alpha-2019-01-09-005354   True        False         3h        Cluster version is 4.0.0-0.alpha-2019-01-09-005354

How reproducible:
Always

Steps to Reproduce:
1. Create a clusterautoscaler named "default"
$ oc get clusterautoscaler default -o yaml
apiVersion: "autoscaling.openshift.io/v1alpha1"
kind: "ClusterAutoscaler"
metadata:
  name: "default"
spec:
  scaleDown:
    enabled: true
    delayAfterAdd: 10s
    delayAfterDelete: 10s
    delayAfterFailure: 10s
    
2. Create a clusterautoscaler named "default1"
$ oc get clusterautoscaler default1 -o yaml
apiVersion: "autoscaling.openshift.io/v1alpha1"
kind: "ClusterAutoscaler"
metadata:
  name: "default1"
spec:
  scaleDown:
    enabled: true
    delayAfterAdd: 10s
    delayAfterDelete: 10s
    delayAfterFailure: 10s
3. $ oc logs -f cluster-autoscaler-operator-58d4c9cfc4-lzfzd
I0109 05:32:21.329716       1 clusterautoscaler_controller.go:114] Reconciling ClusterAutoscaler default
W0109 05:32:43.431104       1 clusterautoscaler_controller.go:167] Not processing ClusterAutoscaler default1

Actual results:
Two clusterautoscalers were created, the resource named "default" triggered the deployment of autoscaler.

Expected results:
Only the clusterautoscaler resource named "default" could be created.

Additional info:

Comment 1 Brad Ison 2019-01-10 15:24:35 UTC
This will require an admission webhook, which definitely isn't going to make it in before the 4.0 feature freeze. The operator will only actually deploy the autoscaler for the resource named "default" -- but yes, you can create additional ClusterAutoscaler resources at the moment unfortunately, they just have no effect.

Not sure what the appropriate status for this bug is.

Comment 3 sunzhaohua 2019-07-26 03:32:40 UTC
Verified 
clusterversion: 4.2.0-0.nightly-2019-07-25-053632

$ oc create -f clusterautoscaler.yml 
Error from server (Name "default1" is invalid, only "default" is allowed): error when creating "clusterautoscaler.yml": admission webhook "clusterautoscalers.autoscaling.openshift.io" denied the request: Name "default1" is invalid, only "default" is allowed

Comment 5 errata-xmlrpc 2019-10-16 06:27:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2922


Note You need to log in before you can comment on or make changes to this bug.