...

Source file src/k8s.io/client-go/scale/scheme/types.go

Documentation: k8s.io/client-go/scale/scheme

     1  /*
     2  Copyright 2017 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package scheme
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  )
    22  
    23  // This file contains our own "internal" version of scale that we use for conversions,
    24  // since we can't use the main Kubernetes internal versions.
    25  
    26  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    27  
    28  // Scale represents a scaling request for a resource.
    29  type Scale struct {
    30  	metav1.TypeMeta
    31  	// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
    32  	// +optional
    33  	metav1.ObjectMeta
    34  
    35  	// defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
    36  	// +optional
    37  	Spec ScaleSpec
    38  
    39  	// current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.
    40  	// +optional
    41  	Status ScaleStatus
    42  }
    43  
    44  // ScaleSpec describes the attributes of a scale subresource.
    45  type ScaleSpec struct {
    46  	// desired number of instances for the scaled object.
    47  	// +optional
    48  	Replicas int32
    49  }
    50  
    51  // ScaleStatus represents the current status of a scale subresource.
    52  type ScaleStatus struct {
    53  	// actual number of observed instances of the scaled object.
    54  	Replicas int32
    55  
    56  	// label query over pods that should match the replicas count.
    57  	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
    58  	// +optional
    59  	Selector *metav1.LabelSelector
    60  }
    61  

View as plain text