move config local to every controllers in kube-controller-manager
This commit is contained in:
@@ -19,16 +19,27 @@ package config
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
componentbaseconfig "k8s.io/component-base/config"
|
||||
csrsigningconfig "k8s.io/kubernetes/pkg/controller/certificates/signer/config"
|
||||
daemonconfig "k8s.io/kubernetes/pkg/controller/daemon/config"
|
||||
deploymentconfig "k8s.io/kubernetes/pkg/controller/deployment/config"
|
||||
endpointconfig "k8s.io/kubernetes/pkg/controller/endpoint/config"
|
||||
garbagecollectorconfig "k8s.io/kubernetes/pkg/controller/garbagecollector/config"
|
||||
jobconfig "k8s.io/kubernetes/pkg/controller/job/config"
|
||||
namespaceconfig "k8s.io/kubernetes/pkg/controller/namespace/config"
|
||||
nodeipamconfig "k8s.io/kubernetes/pkg/controller/nodeipam/config"
|
||||
nodelifecycleconfig "k8s.io/kubernetes/pkg/controller/nodelifecycle/config"
|
||||
poautosclerconfig "k8s.io/kubernetes/pkg/controller/podautoscaler/config"
|
||||
podgcconfig "k8s.io/kubernetes/pkg/controller/podgc/config"
|
||||
replicasetconfig "k8s.io/kubernetes/pkg/controller/replicaset/config"
|
||||
replicationconfig "k8s.io/kubernetes/pkg/controller/replication/config"
|
||||
resourcequotaconfig "k8s.io/kubernetes/pkg/controller/resourcequota/config"
|
||||
serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
|
||||
serviceaccountconfig "k8s.io/kubernetes/pkg/controller/serviceaccount/config"
|
||||
ttlafterfinishedconfig "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config"
|
||||
attachdetachconfig "k8s.io/kubernetes/pkg/controller/volume/attachdetach/config"
|
||||
persistentvolumeconfig "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/config"
|
||||
)
|
||||
|
||||
// GroupResource describes an group resource.
|
||||
type GroupResource struct {
|
||||
// group is the group portion of the GroupResource.
|
||||
Group string
|
||||
// resource is the resource portion of the GroupResource.
|
||||
Resource string
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// KubeControllerManagerConfiguration contains elements describing kube-controller manager.
|
||||
@@ -43,61 +54,61 @@ type KubeControllerManagerConfiguration struct {
|
||||
|
||||
// AttachDetachControllerConfiguration holds configuration for
|
||||
// AttachDetachController related features.
|
||||
AttachDetachController AttachDetachControllerConfiguration
|
||||
AttachDetachController attachdetachconfig.AttachDetachControllerConfiguration
|
||||
// CSRSigningControllerConfiguration holds configuration for
|
||||
// CSRSigningController related features.
|
||||
CSRSigningController CSRSigningControllerConfiguration
|
||||
CSRSigningController csrsigningconfig.CSRSigningControllerConfiguration
|
||||
// DaemonSetControllerConfiguration holds configuration for DaemonSetController
|
||||
// related features.
|
||||
DaemonSetController DaemonSetControllerConfiguration
|
||||
DaemonSetController daemonconfig.DaemonSetControllerConfiguration
|
||||
// DeploymentControllerConfiguration holds configuration for
|
||||
// DeploymentController related features.
|
||||
DeploymentController DeploymentControllerConfiguration
|
||||
DeploymentController deploymentconfig.DeploymentControllerConfiguration
|
||||
// DeprecatedControllerConfiguration holds configuration for some deprecated
|
||||
// features.
|
||||
DeprecatedController DeprecatedControllerConfiguration
|
||||
// EndpointControllerConfiguration holds configuration for EndpointController
|
||||
// related features.
|
||||
EndpointController EndpointControllerConfiguration
|
||||
EndpointController endpointconfig.EndpointControllerConfiguration
|
||||
// GarbageCollectorControllerConfiguration holds configuration for
|
||||
// GarbageCollectorController related features.
|
||||
GarbageCollectorController GarbageCollectorControllerConfiguration
|
||||
GarbageCollectorController garbagecollectorconfig.GarbageCollectorControllerConfiguration
|
||||
// HPAControllerConfiguration holds configuration for HPAController related features.
|
||||
HPAController HPAControllerConfiguration
|
||||
HPAController poautosclerconfig.HPAControllerConfiguration
|
||||
// JobControllerConfiguration holds configuration for JobController related features.
|
||||
JobController JobControllerConfiguration
|
||||
JobController jobconfig.JobControllerConfiguration
|
||||
// NamespaceControllerConfiguration holds configuration for NamespaceController
|
||||
// related features.
|
||||
NamespaceController NamespaceControllerConfiguration
|
||||
NamespaceController namespaceconfig.NamespaceControllerConfiguration
|
||||
// NodeIPAMControllerConfiguration holds configuration for NodeIPAMController
|
||||
// related features.
|
||||
NodeIPAMController NodeIPAMControllerConfiguration
|
||||
NodeIPAMController nodeipamconfig.NodeIPAMControllerConfiguration
|
||||
// NodeLifecycleControllerConfiguration holds configuration for
|
||||
// NodeLifecycleController related features.
|
||||
NodeLifecycleController NodeLifecycleControllerConfiguration
|
||||
NodeLifecycleController nodelifecycleconfig.NodeLifecycleControllerConfiguration
|
||||
// PersistentVolumeBinderControllerConfiguration holds configuration for
|
||||
// PersistentVolumeBinderController related features.
|
||||
PersistentVolumeBinderController PersistentVolumeBinderControllerConfiguration
|
||||
PersistentVolumeBinderController persistentvolumeconfig.PersistentVolumeBinderControllerConfiguration
|
||||
// PodGCControllerConfiguration holds configuration for PodGCController
|
||||
// related features.
|
||||
PodGCController PodGCControllerConfiguration
|
||||
PodGCController podgcconfig.PodGCControllerConfiguration
|
||||
// ReplicaSetControllerConfiguration holds configuration for ReplicaSet related features.
|
||||
ReplicaSetController ReplicaSetControllerConfiguration
|
||||
ReplicaSetController replicasetconfig.ReplicaSetControllerConfiguration
|
||||
// ReplicationControllerConfiguration holds configuration for
|
||||
// ReplicationController related features.
|
||||
ReplicationController ReplicationControllerConfiguration
|
||||
ReplicationController replicationconfig.ReplicationControllerConfiguration
|
||||
// ResourceQuotaControllerConfiguration holds configuration for
|
||||
// ResourceQuotaController related features.
|
||||
ResourceQuotaController ResourceQuotaControllerConfiguration
|
||||
ResourceQuotaController resourcequotaconfig.ResourceQuotaControllerConfiguration
|
||||
// SAControllerConfiguration holds configuration for ServiceAccountController
|
||||
// related features.
|
||||
SAController SAControllerConfiguration
|
||||
SAController serviceaccountconfig.SAControllerConfiguration
|
||||
// ServiceControllerConfiguration holds configuration for ServiceController
|
||||
// related features.
|
||||
ServiceController ServiceControllerConfiguration
|
||||
ServiceController serviceconfig.ServiceControllerConfiguration
|
||||
// TTLAfterFinishedControllerConfiguration holds configuration for
|
||||
// TTLAfterFinishedController related features.
|
||||
TTLAfterFinishedController TTLAfterFinishedControllerConfiguration
|
||||
TTLAfterFinishedController ttlafterfinishedconfig.TTLAfterFinishedControllerConfiguration
|
||||
}
|
||||
|
||||
// GenericControllerManagerConfiguration holds configuration for a generic controller-manager
|
||||
@@ -161,17 +172,6 @@ type KubeCloudSharedConfiguration struct {
|
||||
NodeSyncPeriod metav1.Duration
|
||||
}
|
||||
|
||||
// AttachDetachControllerConfiguration contains elements describing AttachDetachController.
|
||||
type AttachDetachControllerConfiguration struct {
|
||||
// Reconciler runs a periodic loop to reconcile the desired state of the with
|
||||
// the actual state of the world by triggering attach detach operations.
|
||||
// This flag enables or disables reconcile. Is false by default, and thus enabled.
|
||||
DisableAttachDetachReconcilerSync bool
|
||||
// ReconcilerSyncLoopPeriod is the amount of time the reconciler sync states loop
|
||||
// wait between successive executions. Is set to 5 sec by default.
|
||||
ReconcilerSyncLoopPeriod metav1.Duration
|
||||
}
|
||||
|
||||
// CloudProviderConfiguration contains basically elements about cloud provider.
|
||||
type CloudProviderConfiguration struct {
|
||||
// Name is the provider for cloud services.
|
||||
@@ -180,37 +180,6 @@ type CloudProviderConfiguration struct {
|
||||
CloudConfigFile string
|
||||
}
|
||||
|
||||
// CSRSigningControllerConfiguration contains elements describing CSRSigningController.
|
||||
type CSRSigningControllerConfiguration struct {
|
||||
// clusterSigningCertFile is the filename containing a PEM-encoded
|
||||
// X509 CA certificate used to issue cluster-scoped certificates
|
||||
ClusterSigningCertFile string
|
||||
// clusterSigningCertFile is the filename containing a PEM-encoded
|
||||
// RSA or ECDSA private key used to issue cluster-scoped certificates
|
||||
ClusterSigningKeyFile string
|
||||
// clusterSigningDuration is the length of duration signed certificates
|
||||
// will be given.
|
||||
ClusterSigningDuration metav1.Duration
|
||||
}
|
||||
|
||||
// DaemonSetControllerConfiguration contains elements describing DaemonSetController.
|
||||
type DaemonSetControllerConfiguration struct {
|
||||
// concurrentDaemonSetSyncs is the number of daemonset objects that are
|
||||
// allowed to sync concurrently. Larger number = more responsive daemonset,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentDaemonSetSyncs int32
|
||||
}
|
||||
|
||||
// DeploymentControllerConfiguration contains elements describing DeploymentController.
|
||||
type DeploymentControllerConfiguration struct {
|
||||
// concurrentDeploymentSyncs is the number of deployment objects that are
|
||||
// allowed to sync concurrently. Larger number = more responsive deployments,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentDeploymentSyncs int32
|
||||
// deploymentControllerSyncPeriod is the period for syncing the deployments.
|
||||
DeploymentControllerSyncPeriod metav1.Duration
|
||||
}
|
||||
|
||||
// DeprecatedControllerConfiguration contains elements be deprecated.
|
||||
type DeprecatedControllerConfiguration struct {
|
||||
// DEPRECATED: deletingPodsQps is the number of nodes per second on which pods are deleted in
|
||||
@@ -223,227 +192,3 @@ type DeprecatedControllerConfiguration struct {
|
||||
// Retry interval equals node-sync-period.
|
||||
RegisterRetryCount int32
|
||||
}
|
||||
|
||||
// EndpointControllerConfiguration contains elements describing EndpointController.
|
||||
type EndpointControllerConfiguration struct {
|
||||
// concurrentEndpointSyncs is the number of endpoint syncing operations
|
||||
// that will be done concurrently. Larger number = faster endpoint updating,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentEndpointSyncs int32
|
||||
}
|
||||
|
||||
// GarbageCollectorControllerConfiguration contains elements describing GarbageCollectorController.
|
||||
type GarbageCollectorControllerConfiguration struct {
|
||||
// enables the generic garbage collector. MUST be synced with the
|
||||
// corresponding flag of the kube-apiserver. WARNING: the generic garbage
|
||||
// collector is an alpha feature.
|
||||
EnableGarbageCollector bool
|
||||
// concurrentGCSyncs is the number of garbage collector workers that are
|
||||
// allowed to sync concurrently.
|
||||
ConcurrentGCSyncs int32
|
||||
// gcIgnoredResources is the list of GroupResources that garbage collection should ignore.
|
||||
GCIgnoredResources []GroupResource
|
||||
}
|
||||
|
||||
// HPAControllerConfiguration contains elements describing HPAController.
|
||||
type HPAControllerConfiguration struct {
|
||||
// horizontalPodAutoscalerSyncPeriod is the period for syncing the number of
|
||||
// pods in horizontal pod autoscaler.
|
||||
HorizontalPodAutoscalerSyncPeriod metav1.Duration
|
||||
// horizontalPodAutoscalerUpscaleForbiddenWindow is a period after which next upscale allowed.
|
||||
HorizontalPodAutoscalerUpscaleForbiddenWindow metav1.Duration
|
||||
// horizontalPodAutoscalerDownscaleForbiddenWindow is a period after which next downscale allowed.
|
||||
HorizontalPodAutoscalerDownscaleForbiddenWindow metav1.Duration
|
||||
// HorizontalPodAutoscalerDowncaleStabilizationWindow is a period for which autoscaler will look
|
||||
// backwards and not scale down below any recommendation it made during that period.
|
||||
HorizontalPodAutoscalerDownscaleStabilizationWindow metav1.Duration
|
||||
// horizontalPodAutoscalerTolerance is the tolerance for when
|
||||
// resource usage suggests upscaling/downscaling
|
||||
HorizontalPodAutoscalerTolerance float64
|
||||
// HorizontalPodAutoscalerUseRESTClients causes the HPA controller to use REST clients
|
||||
// through the kube-aggregator when enabled, instead of using the legacy metrics client
|
||||
// through the API server proxy.
|
||||
HorizontalPodAutoscalerUseRESTClients bool
|
||||
// HorizontalPodAutoscalerCPUInitializationPeriod is the period after pod start when CPU samples
|
||||
// might be skipped.
|
||||
HorizontalPodAutoscalerCPUInitializationPeriod metav1.Duration
|
||||
// HorizontalPodAutoscalerInitialReadinessDelay is period after pod start during which readiness
|
||||
// changes are treated as readiness being set for the first time. The only effect of this is that
|
||||
// HPA will disregard CPU samples from unready pods that had last readiness change during that
|
||||
// period.
|
||||
HorizontalPodAutoscalerInitialReadinessDelay metav1.Duration
|
||||
}
|
||||
|
||||
// JobControllerConfiguration contains elements describing JobController.
|
||||
type JobControllerConfiguration struct {
|
||||
// concurrentJobSyncs is the number of job objects that are
|
||||
// allowed to sync concurrently. Larger number = more responsive jobs,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentJobSyncs int32
|
||||
}
|
||||
|
||||
// NamespaceControllerConfiguration contains elements describing NamespaceController.
|
||||
type NamespaceControllerConfiguration struct {
|
||||
// namespaceSyncPeriod is the period for syncing namespace life-cycle
|
||||
// updates.
|
||||
NamespaceSyncPeriod metav1.Duration
|
||||
// concurrentNamespaceSyncs is the number of namespace objects that are
|
||||
// allowed to sync concurrently.
|
||||
ConcurrentNamespaceSyncs int32
|
||||
}
|
||||
|
||||
// NodeIPAMControllerConfiguration contains elements describing NodeIPAMController.
|
||||
type NodeIPAMControllerConfiguration struct {
|
||||
// serviceCIDR is CIDR Range for Services in cluster.
|
||||
ServiceCIDR string
|
||||
// NodeCIDRMaskSize is the mask size for node cidr in cluster.
|
||||
NodeCIDRMaskSize int32
|
||||
}
|
||||
|
||||
// NodeLifecycleControllerConfiguration contains elements describing NodeLifecycleController.
|
||||
type NodeLifecycleControllerConfiguration struct {
|
||||
// If set to true enables NoExecute Taints and will evict all not-tolerating
|
||||
// Pod running on Nodes tainted with this kind of Taints.
|
||||
EnableTaintManager bool
|
||||
// nodeEvictionRate is the number of nodes per second on which pods are deleted in case of node failure when a zone is healthy
|
||||
NodeEvictionRate float32
|
||||
// secondaryNodeEvictionRate is the number of nodes per second on which pods are deleted in case of node failure when a zone is unhealthy
|
||||
SecondaryNodeEvictionRate float32
|
||||
// nodeStartupGracePeriod is the amount of time which we allow starting a node to
|
||||
// be unresponsive before marking it unhealthy.
|
||||
NodeStartupGracePeriod metav1.Duration
|
||||
// nodeMontiorGracePeriod is the amount of time which we allow a running node to be
|
||||
// unresponsive before marking it unhealthy. Must be N times more than kubelet's
|
||||
// nodeStatusUpdateFrequency, where N means number of retries allowed for kubelet
|
||||
// to post node status.
|
||||
NodeMonitorGracePeriod metav1.Duration
|
||||
// podEvictionTimeout is the grace period for deleting pods on failed nodes.
|
||||
PodEvictionTimeout metav1.Duration
|
||||
// secondaryNodeEvictionRate is implicitly overridden to 0 for clusters smaller than or equal to largeClusterSizeThreshold
|
||||
LargeClusterSizeThreshold int32
|
||||
// Zone is treated as unhealthy in nodeEvictionRate and secondaryNodeEvictionRate when at least
|
||||
// unhealthyZoneThreshold (no less than 3) of Nodes in the zone are NotReady
|
||||
UnhealthyZoneThreshold float32
|
||||
}
|
||||
|
||||
// PersistentVolumeBinderControllerConfiguration contains elements describing
|
||||
// PersistentVolumeBinderController.
|
||||
type PersistentVolumeBinderControllerConfiguration struct {
|
||||
// pvClaimBinderSyncPeriod is the period for syncing persistent volumes
|
||||
// and persistent volume claims.
|
||||
PVClaimBinderSyncPeriod metav1.Duration
|
||||
// volumeConfiguration holds configuration for volume related features.
|
||||
VolumeConfiguration VolumeConfiguration
|
||||
}
|
||||
|
||||
// PodGCControllerConfiguration contains elements describing PodGCController.
|
||||
type PodGCControllerConfiguration struct {
|
||||
// terminatedPodGCThreshold is the number of terminated pods that can exist
|
||||
// before the terminated pod garbage collector starts deleting terminated pods.
|
||||
// If <= 0, the terminated pod garbage collector is disabled.
|
||||
TerminatedPodGCThreshold int32
|
||||
}
|
||||
|
||||
// ReplicaSetControllerConfiguration contains elements describing ReplicaSetController.
|
||||
type ReplicaSetControllerConfiguration struct {
|
||||
// concurrentRSSyncs is the number of replica sets that are allowed to sync
|
||||
// concurrently. Larger number = more responsive replica management, but more
|
||||
// CPU (and network) load.
|
||||
ConcurrentRSSyncs int32
|
||||
}
|
||||
|
||||
// ReplicationControllerConfiguration contains elements describing ReplicationController.
|
||||
type ReplicationControllerConfiguration struct {
|
||||
// concurrentRCSyncs is the number of replication controllers that are
|
||||
// allowed to sync concurrently. Larger number = more responsive replica
|
||||
// management, but more CPU (and network) load.
|
||||
ConcurrentRCSyncs int32
|
||||
}
|
||||
|
||||
// ResourceQuotaControllerConfiguration contains elements describing ResourceQuotaController.
|
||||
type ResourceQuotaControllerConfiguration struct {
|
||||
// resourceQuotaSyncPeriod is the period for syncing quota usage status
|
||||
// in the system.
|
||||
ResourceQuotaSyncPeriod metav1.Duration
|
||||
// concurrentResourceQuotaSyncs is the number of resource quotas that are
|
||||
// allowed to sync concurrently. Larger number = more responsive quota
|
||||
// management, but more CPU (and network) load.
|
||||
ConcurrentResourceQuotaSyncs int32
|
||||
}
|
||||
|
||||
// SAControllerConfiguration contains elements describing ServiceAccountController.
|
||||
type SAControllerConfiguration struct {
|
||||
// serviceAccountKeyFile is the filename containing a PEM-encoded private RSA key
|
||||
// used to sign service account tokens.
|
||||
ServiceAccountKeyFile string
|
||||
// concurrentSATokenSyncs is the number of service account token syncing operations
|
||||
// that will be done concurrently.
|
||||
ConcurrentSATokenSyncs int32
|
||||
// rootCAFile is the root certificate authority will be included in service
|
||||
// account's token secret. This must be a valid PEM-encoded CA bundle.
|
||||
RootCAFile string
|
||||
}
|
||||
|
||||
// ServiceControllerConfiguration contains elements describing ServiceController.
|
||||
type ServiceControllerConfiguration struct {
|
||||
// concurrentServiceSyncs is the number of services that are
|
||||
// allowed to sync concurrently. Larger number = more responsive service
|
||||
// management, but more CPU (and network) load.
|
||||
ConcurrentServiceSyncs int32
|
||||
}
|
||||
|
||||
// VolumeConfiguration contains *all* enumerated flags meant to configure all volume
|
||||
// plugins. From this config, the controller-manager binary will create many instances of
|
||||
// volume.VolumeConfig, each containing only the configuration needed for that plugin which
|
||||
// are then passed to the appropriate plugin. The ControllerManager binary is the only part
|
||||
// of the code which knows what plugins are supported and which flags correspond to each plugin.
|
||||
type VolumeConfiguration struct {
|
||||
// enableHostPathProvisioning enables HostPath PV provisioning when running without a
|
||||
// cloud provider. This allows testing and development of provisioning features. HostPath
|
||||
// provisioning is not supported in any way, won't work in a multi-node cluster, and
|
||||
// should not be used for anything other than testing or development.
|
||||
EnableHostPathProvisioning bool
|
||||
// enableDynamicProvisioning enables the provisioning of volumes when running within an environment
|
||||
// that supports dynamic provisioning. Defaults to true.
|
||||
EnableDynamicProvisioning bool
|
||||
// persistentVolumeRecyclerConfiguration holds configuration for persistent volume plugins.
|
||||
PersistentVolumeRecyclerConfiguration PersistentVolumeRecyclerConfiguration
|
||||
// volumePluginDir is the full path of the directory in which the flex
|
||||
// volume plugin should search for additional third party volume plugins
|
||||
FlexVolumePluginDir string
|
||||
}
|
||||
|
||||
// PersistentVolumeRecyclerConfiguration contains elements describing persistent volume plugins.
|
||||
type PersistentVolumeRecyclerConfiguration struct {
|
||||
// maximumRetry is number of retries the PV recycler will execute on failure to recycle
|
||||
// PV.
|
||||
MaximumRetry int32
|
||||
// minimumTimeoutNFS is the minimum ActiveDeadlineSeconds to use for an NFS Recycler
|
||||
// pod.
|
||||
MinimumTimeoutNFS int32
|
||||
// podTemplateFilePathNFS is the file path to a pod definition used as a template for
|
||||
// NFS persistent volume recycling
|
||||
PodTemplateFilePathNFS string
|
||||
// incrementTimeoutNFS is the increment of time added per Gi to ActiveDeadlineSeconds
|
||||
// for an NFS scrubber pod.
|
||||
IncrementTimeoutNFS int32
|
||||
// podTemplateFilePathHostPath is the file path to a pod definition used as a template for
|
||||
// HostPath persistent volume recycling. This is for development and testing only and
|
||||
// will not work in a multi-node cluster.
|
||||
PodTemplateFilePathHostPath string
|
||||
// minimumTimeoutHostPath is the minimum ActiveDeadlineSeconds to use for a HostPath
|
||||
// Recycler pod. This is for development and testing only and will not work in a multi-node
|
||||
// cluster.
|
||||
MinimumTimeoutHostPath int32
|
||||
// incrementTimeoutHostPath is the increment of time added per Gi to ActiveDeadlineSeconds
|
||||
// for a HostPath scrubber pod. This is for development and testing only and will not work
|
||||
// in a multi-node cluster.
|
||||
IncrementTimeoutHostPath int32
|
||||
}
|
||||
|
||||
// TTLAfterFinishedControllerConfiguration contains elements describing TTLAfterFinishedController.
|
||||
type TTLAfterFinishedControllerConfiguration struct {
|
||||
// concurrentTTLSyncs is the number of TTL-after-finished collector workers that are
|
||||
// allowed to sync concurrently.
|
||||
ConcurrentTTLSyncs int32
|
||||
}
|
||||
|
@@ -23,6 +23,25 @@ import (
|
||||
kruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
csrsigningconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/certificates/signer/config/v1alpha1"
|
||||
daemonconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/daemon/config/v1alpha1"
|
||||
deploymentconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/deployment/config/v1alpha1"
|
||||
endpointconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/endpoint/config/v1alpha1"
|
||||
garbagecollectorconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/garbagecollector/config/v1alpha1"
|
||||
jobconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/job/config/v1alpha1"
|
||||
namespaceconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/namespace/config/v1alpha1"
|
||||
nodeipamconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/nodeipam/config/v1alpha1"
|
||||
nodelifecycleconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/nodelifecycle/config/v1alpha1"
|
||||
poautosclerconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/podautoscaler/config/v1alpha1"
|
||||
podgcconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/podgc/config/v1alpha1"
|
||||
replicasetconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/replicaset/config/v1alpha1"
|
||||
replicationconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/replication/config/v1alpha1"
|
||||
resourcequotaconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/resourcequota/config/v1alpha1"
|
||||
serviceconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/service/config/v1alpha1"
|
||||
serviceaccountconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/serviceaccount/config/v1alpha1"
|
||||
ttlafterfinishedconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config/v1alpha1"
|
||||
attachdetachconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/volume/attachdetach/config/v1alpha1"
|
||||
persistentvolumeconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/config/v1alpha1"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
@@ -31,25 +50,9 @@ func addDefaultingFuncs(scheme *kruntime.Scheme) error {
|
||||
}
|
||||
|
||||
func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alpha1.KubeControllerManagerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.AttachDetachController.ReconcilerSyncLoopPeriod == zero {
|
||||
obj.AttachDetachController.ReconcilerSyncLoopPeriod = metav1.Duration{Duration: 60 * time.Second}
|
||||
}
|
||||
if obj.DeprecatedController.RegisterRetryCount == 0 {
|
||||
obj.DeprecatedController.RegisterRetryCount = 10
|
||||
}
|
||||
if obj.NodeIPAMController.NodeCIDRMaskSize == 0 {
|
||||
obj.NodeIPAMController.NodeCIDRMaskSize = 24
|
||||
}
|
||||
if obj.PersistentVolumeBinderController.PVClaimBinderSyncPeriod == zero {
|
||||
obj.PersistentVolumeBinderController.PVClaimBinderSyncPeriod = metav1.Duration{Duration: 15 * time.Second}
|
||||
}
|
||||
if obj.SAController.ConcurrentSATokenSyncs == 0 {
|
||||
obj.SAController.ConcurrentSATokenSyncs = 5
|
||||
}
|
||||
if obj.TTLAfterFinishedController.ConcurrentTTLSyncs <= 0 {
|
||||
obj.TTLAfterFinishedController.ConcurrentTTLSyncs = 5
|
||||
}
|
||||
|
||||
// These defaults override the recommended defaults from the componentbaseconfigv1alpha1 package that are applied automatically
|
||||
// These client-connection defaults are specific to the kube-controller-manager
|
||||
@@ -62,6 +65,44 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alph
|
||||
|
||||
// Use the default RecommendedDefaultGenericControllerManagerConfiguration options
|
||||
RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic)
|
||||
// Use the default RecommendedDefaultHPAControllerConfiguration options
|
||||
attachdetachconfigv1alpha1.RecommendedDefaultAttachDetachControllerConfiguration(&obj.AttachDetachController)
|
||||
// Use the default RecommendedDefaultCSRSigningControllerConfiguration options
|
||||
csrsigningconfigv1alpha1.RecommendedDefaultCSRSigningControllerConfiguration(&obj.CSRSigningController)
|
||||
// Use the default RecommendedDefaultDaemonSetControllerConfiguration options
|
||||
daemonconfigv1alpha1.RecommendedDefaultDaemonSetControllerConfiguration(&obj.DaemonSetController)
|
||||
// Use the default RecommendedDefaultDeploymentControllerConfiguration options
|
||||
deploymentconfigv1alpha1.RecommendedDefaultDeploymentControllerConfiguration(&obj.DeploymentController)
|
||||
// Use the default RecommendedDefaultEndpointControllerConfiguration options
|
||||
endpointconfigv1alpha1.RecommendedDefaultEndpointControllerConfiguration(&obj.EndpointController)
|
||||
// Use the default RecommendedDefaultGenericControllerManagerConfiguration options
|
||||
garbagecollectorconfigv1alpha1.RecommendedDefaultGarbageCollectorControllerConfiguration(&obj.GarbageCollectorController)
|
||||
// Use the default RecommendedDefaultJobControllerConfiguration options
|
||||
jobconfigv1alpha1.RecommendedDefaultJobControllerConfiguration(&obj.JobController)
|
||||
// Use the default RecommendedDefaultNamespaceControllerConfiguration options
|
||||
namespaceconfigv1alpha1.RecommendedDefaultNamespaceControllerConfiguration(&obj.NamespaceController)
|
||||
// Use the default RecommendedDefaultNodeIPAMControllerConfiguration options
|
||||
nodeipamconfigv1alpha1.RecommendedDefaultNodeIPAMControllerConfiguration(&obj.NodeIPAMController)
|
||||
// Use the default RecommendedDefaultHPAControllerConfiguration options
|
||||
poautosclerconfigv1alpha1.RecommendedDefaultHPAControllerConfiguration(&obj.HPAController)
|
||||
// Use the default RecommendedDefaultNodeLifecycleControllerConfiguration options
|
||||
nodelifecycleconfigv1alpha1.RecommendedDefaultNodeLifecycleControllerConfiguration(&obj.NodeLifecycleController)
|
||||
// Use the default RecommendedDefaultPodGCControllerConfiguration options
|
||||
podgcconfigv1alpha1.RecommendedDefaultPodGCControllerConfiguration(&obj.PodGCController)
|
||||
// Use the default RecommendedDefaultReplicaSetControllerConfiguration options
|
||||
replicasetconfigv1alpha1.RecommendedDefaultReplicaSetControllerConfiguration(&obj.ReplicaSetController)
|
||||
// Use the default RecommendedDefaultReplicationControllerConfiguration options
|
||||
replicationconfigv1alpha1.RecommendedDefaultReplicationControllerConfiguration(&obj.ReplicationController)
|
||||
// Use the default RecommendedDefaultResourceQuotaControllerConfiguration options
|
||||
resourcequotaconfigv1alpha1.RecommendedDefaultResourceQuotaControllerConfiguration(&obj.ResourceQuotaController)
|
||||
// Use the default RecommendedDefaultGenericControllerManagerConfiguration options
|
||||
serviceconfigv1alpha1.RecommendedDefaultServiceControllerConfiguration(&obj.ServiceController)
|
||||
// Use the default RecommendedDefaultSAControllerConfiguration options
|
||||
serviceaccountconfigv1alpha1.RecommendedDefaultSAControllerConfiguration(&obj.SAController)
|
||||
// Use the default RecommendedDefaultTTLAfterFinishedControllerConfiguration options
|
||||
ttlafterfinishedconfigv1alpha1.RecommendedDefaultTTLAfterFinishedControllerConfiguration(&obj.TTLAfterFinishedController)
|
||||
// Use the default RecommendedDefaultPersistentVolumeBinderControllerConfiguration options
|
||||
persistentvolumeconfigv1alpha1.RecommendedDefaultPersistentVolumeBinderControllerConfiguration(&obj.PersistentVolumeBinderController)
|
||||
}
|
||||
|
||||
func RecommendedDefaultGenericControllerManagerConfiguration(obj *kubectrlmgrconfigv1alpha1.GenericControllerManagerConfiguration) {
|
||||
@@ -99,171 +140,3 @@ func SetDefaults_KubeCloudSharedConfiguration(obj *kubectrlmgrconfigv1alpha1.Kub
|
||||
obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ServiceControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ServiceControllerConfiguration) {
|
||||
if obj.ConcurrentServiceSyncs == 0 {
|
||||
obj.ConcurrentServiceSyncs = 1
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_CSRSigningControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.CSRSigningControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ClusterSigningCertFile == "" {
|
||||
obj.ClusterSigningCertFile = "/etc/kubernetes/ca/ca.pem"
|
||||
}
|
||||
if obj.ClusterSigningKeyFile == "" {
|
||||
obj.ClusterSigningKeyFile = "/etc/kubernetes/ca/ca.key"
|
||||
}
|
||||
if obj.ClusterSigningDuration == zero {
|
||||
obj.ClusterSigningDuration = metav1.Duration{Duration: 365 * 24 * time.Hour}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_DeploymentControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.DeploymentControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentDeploymentSyncs == 0 {
|
||||
obj.ConcurrentDeploymentSyncs = 5
|
||||
}
|
||||
if obj.DeploymentControllerSyncPeriod == zero {
|
||||
obj.DeploymentControllerSyncPeriod = metav1.Duration{Duration: 30 * time.Second}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_DaemonSetControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.DaemonSetControllerConfiguration) {
|
||||
if obj.ConcurrentDaemonSetSyncs == 0 {
|
||||
obj.ConcurrentDaemonSetSyncs = 2
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_EndpointControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.EndpointControllerConfiguration) {
|
||||
if obj.ConcurrentEndpointSyncs == 0 {
|
||||
obj.ConcurrentEndpointSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_GarbageCollectorControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.GarbageCollectorControllerConfiguration) {
|
||||
if obj.EnableGarbageCollector == nil {
|
||||
obj.EnableGarbageCollector = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.ConcurrentGCSyncs == 0 {
|
||||
obj.ConcurrentGCSyncs = 20
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_HPAControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.HPAControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.HorizontalPodAutoscalerUseRESTClients == nil {
|
||||
obj.HorizontalPodAutoscalerUseRESTClients = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerSyncPeriod == zero {
|
||||
obj.HorizontalPodAutoscalerSyncPeriod = metav1.Duration{Duration: 15 * time.Second}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerUpscaleForbiddenWindow == zero {
|
||||
obj.HorizontalPodAutoscalerUpscaleForbiddenWindow = metav1.Duration{Duration: 3 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerDownscaleStabilizationWindow == zero {
|
||||
obj.HorizontalPodAutoscalerDownscaleStabilizationWindow = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerCPUInitializationPeriod == zero {
|
||||
obj.HorizontalPodAutoscalerCPUInitializationPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerInitialReadinessDelay == zero {
|
||||
obj.HorizontalPodAutoscalerInitialReadinessDelay = metav1.Duration{Duration: 30 * time.Second}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerDownscaleForbiddenWindow == zero {
|
||||
obj.HorizontalPodAutoscalerDownscaleForbiddenWindow = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerTolerance == 0 {
|
||||
obj.HorizontalPodAutoscalerTolerance = 0.1
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_JobControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.JobControllerConfiguration) {
|
||||
if obj.ConcurrentJobSyncs == 0 {
|
||||
obj.ConcurrentJobSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_NamespaceControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.NamespaceControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentNamespaceSyncs == 0 {
|
||||
obj.ConcurrentNamespaceSyncs = 10
|
||||
}
|
||||
if obj.NamespaceSyncPeriod == zero {
|
||||
obj.NamespaceSyncPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_NodeLifecycleControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.NodeLifecycleControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.PodEvictionTimeout == zero {
|
||||
obj.PodEvictionTimeout = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.NodeMonitorGracePeriod == zero {
|
||||
obj.NodeMonitorGracePeriod = metav1.Duration{Duration: 40 * time.Second}
|
||||
}
|
||||
if obj.NodeStartupGracePeriod == zero {
|
||||
obj.NodeStartupGracePeriod = metav1.Duration{Duration: 60 * time.Second}
|
||||
}
|
||||
if obj.EnableTaintManager == nil {
|
||||
obj.EnableTaintManager = utilpointer.BoolPtr(true)
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_PodGCControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.PodGCControllerConfiguration) {
|
||||
if obj.TerminatedPodGCThreshold == 0 {
|
||||
obj.TerminatedPodGCThreshold = 12500
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ReplicaSetControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ReplicaSetControllerConfiguration) {
|
||||
if obj.ConcurrentRSSyncs == 0 {
|
||||
obj.ConcurrentRSSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ReplicationControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ReplicationControllerConfiguration) {
|
||||
if obj.ConcurrentRCSyncs == 0 {
|
||||
obj.ConcurrentRCSyncs = 5
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_ResourceQuotaControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ResourceQuotaControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentResourceQuotaSyncs == 0 {
|
||||
obj.ConcurrentResourceQuotaSyncs = 5
|
||||
}
|
||||
if obj.ResourceQuotaSyncPeriod == zero {
|
||||
obj.ResourceQuotaSyncPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_PersistentVolumeRecyclerConfiguration(obj *kubectrlmgrconfigv1alpha1.PersistentVolumeRecyclerConfiguration) {
|
||||
if obj.MaximumRetry == 0 {
|
||||
obj.MaximumRetry = 3
|
||||
}
|
||||
if obj.MinimumTimeoutNFS == 0 {
|
||||
obj.MinimumTimeoutNFS = 300
|
||||
}
|
||||
if obj.IncrementTimeoutNFS == 0 {
|
||||
obj.IncrementTimeoutNFS = 30
|
||||
}
|
||||
if obj.MinimumTimeoutHostPath == 0 {
|
||||
obj.MinimumTimeoutHostPath = 60
|
||||
}
|
||||
if obj.IncrementTimeoutHostPath == 0 {
|
||||
obj.IncrementTimeoutHostPath = 30
|
||||
}
|
||||
}
|
||||
|
||||
func SetDefaults_VolumeConfiguration(obj *kubectrlmgrconfigv1alpha1.VolumeConfiguration) {
|
||||
if obj.EnableHostPathProvisioning == nil {
|
||||
obj.EnableHostPathProvisioning = utilpointer.BoolPtr(false)
|
||||
}
|
||||
if obj.EnableDynamicProvisioning == nil {
|
||||
obj.EnableDynamicProvisioning = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.FlexVolumePluginDir == "" {
|
||||
obj.FlexVolumePluginDir = "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/"
|
||||
}
|
||||
}
|
||||
|
19
pkg/controller/certificates/signer/config/doc.go
Normal file
19
pkg/controller/certificates/signer/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/certificates/signer/config"
|
34
pkg/controller/certificates/signer/config/types.go
Normal file
34
pkg/controller/certificates/signer/config/types.go
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// CSRSigningControllerConfiguration contains elements describing CSRSigningController.
|
||||
type CSRSigningControllerConfiguration struct {
|
||||
// clusterSigningCertFile is the filename containing a PEM-encoded
|
||||
// X509 CA certificate used to issue cluster-scoped certificates
|
||||
ClusterSigningCertFile string
|
||||
// clusterSigningCertFile is the filename containing a PEM-encoded
|
||||
// RSA or ECDSA private key used to issue cluster-scoped certificates
|
||||
ClusterSigningKeyFile string
|
||||
// clusterSigningDuration is the length of duration signed certificates
|
||||
// will be given.
|
||||
ClusterSigningDuration metav1.Duration
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
csrsigningconfig "k8s.io/kubernetes/pkg/controller/certificates/signer/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with CSRSigningControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_CSRSigningControllerConfiguration_To_config_CSRSigningControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_CSRSigningControllerConfiguration_To_config_CSRSigningControllerConfiguration(in *v1alpha1.CSRSigningControllerConfiguration, out *csrsigningconfig.CSRSigningControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_CSRSigningControllerConfiguration_To_config_CSRSigningControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_CSRSigningControllerConfiguration_To_v1alpha1_CSRSigningControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_CSRSigningControllerConfiguration_To_v1alpha1_CSRSigningControllerConfiguration(in *csrsigningconfig.CSRSigningControllerConfiguration, out *v1alpha1.CSRSigningControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_CSRSigningControllerConfiguration_To_v1alpha1_CSRSigningControllerConfiguration(in, out, s)
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultCSRSigningControllerConfiguration defaults a pointer to a
|
||||
// CSRSigningControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultCSRSigningControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.CSRSigningControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ClusterSigningCertFile == "" {
|
||||
obj.ClusterSigningCertFile = "/etc/kubernetes/ca/ca.pem"
|
||||
}
|
||||
if obj.ClusterSigningKeyFile == "" {
|
||||
obj.ClusterSigningKeyFile = "/etc/kubernetes/ca/ca.key"
|
||||
}
|
||||
if obj.ClusterSigningDuration == zero {
|
||||
obj.ClusterSigningDuration = metav1.Duration{Duration: 365 * 24 * time.Hour}
|
||||
}
|
||||
}
|
21
pkg/controller/certificates/signer/config/v1alpha1/doc.go
Normal file
21
pkg/controller/certificates/signer/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/certificates/signer/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/certificates/signer/config/v1alpha1"
|
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/daemon/config/OWNERS
Normal file
14
pkg/controller/daemon/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/daemon/config/doc.go
Normal file
19
pkg/controller/daemon/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/daemon/config"
|
25
pkg/controller/daemon/config/types.go
Normal file
25
pkg/controller/daemon/config/types.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// DaemonSetControllerConfiguration contains elements describing DaemonSetController.
|
||||
type DaemonSetControllerConfiguration struct {
|
||||
// concurrentDaemonSetSyncs is the number of daemonset objects that are
|
||||
// allowed to sync concurrently. Larger number = more responsive daemonset,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentDaemonSetSyncs int32
|
||||
}
|
40
pkg/controller/daemon/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/daemon/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
daemonconfig "k8s.io/kubernetes/pkg/controller/daemon/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this epackage
|
||||
// with DaemonSetControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_DaemonSetControllerConfiguration_To_config_DaemonSetControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_DaemonSetControllerConfiguration_To_config_DaemonSetControllerConfiguration(in *v1alpha1.DaemonSetControllerConfiguration, out *daemonconfig.DaemonSetControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_DaemonSetControllerConfiguration_To_config_DaemonSetControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_DaemonSetControllerConfiguration_To_v1alpha1_DaemonSetControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_DaemonSetControllerConfiguration_To_v1alpha1_DaemonSetControllerConfiguration(in *daemonconfig.DaemonSetControllerConfiguration, out *v1alpha1.DaemonSetControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_DaemonSetControllerConfiguration_To_v1alpha1_DaemonSetControllerConfiguration(in, out, s)
|
||||
}
|
36
pkg/controller/daemon/config/v1alpha1/defaults.go
Normal file
36
pkg/controller/daemon/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultDaemonSetControllerConfiguration defaults a pointer to a
|
||||
// DaemonSetControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultDaemonSetControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.DaemonSetControllerConfiguration) {
|
||||
if obj.ConcurrentDaemonSetSyncs == 0 {
|
||||
obj.ConcurrentDaemonSetSyncs = 2
|
||||
}
|
||||
}
|
21
pkg/controller/daemon/config/v1alpha1/doc.go
Normal file
21
pkg/controller/daemon/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/daemon/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/daemon/config/v1alpha1"
|
31
pkg/controller/daemon/config/v1alpha1/register.go
Normal file
31
pkg/controller/daemon/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/deployment/config/OWNERS
Normal file
14
pkg/controller/deployment/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/deployment/config/doc.go
Normal file
19
pkg/controller/deployment/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/deployment/config"
|
31
pkg/controller/deployment/config/types.go
Normal file
31
pkg/controller/deployment/config/types.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// DeploymentControllerConfiguration contains elements describing DeploymentController.
|
||||
type DeploymentControllerConfiguration struct {
|
||||
// concurrentDeploymentSyncs is the number of deployment objects that are
|
||||
// allowed to sync concurrently. Larger number = more responsive deployments,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentDeploymentSyncs int32
|
||||
// deploymentControllerSyncPeriod is the period for syncing the deployments.
|
||||
DeploymentControllerSyncPeriod metav1.Duration
|
||||
}
|
40
pkg/controller/deployment/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/deployment/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
deploymentconfig "k8s.io/kubernetes/pkg/controller/deployment/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with DeploymentControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_DeploymentControllerConfiguration_To_config_DeploymentControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_DeploymentControllerConfiguration_To_config_DeploymentControllerConfiguration(in *v1alpha1.DeploymentControllerConfiguration, out *deploymentconfig.DeploymentControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_DeploymentControllerConfiguration_To_config_DeploymentControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_DeploymentControllerConfiguration_To_v1alpha1_DeploymentControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_DeploymentControllerConfiguration_To_v1alpha1_DeploymentControllerConfiguration(in *deploymentconfig.DeploymentControllerConfiguration, out *v1alpha1.DeploymentControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_DeploymentControllerConfiguration_To_v1alpha1_DeploymentControllerConfiguration(in, out, s)
|
||||
}
|
43
pkg/controller/deployment/config/v1alpha1/defaults.go
Normal file
43
pkg/controller/deployment/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultDeploymentControllerConfiguration defaults a pointer to a
|
||||
// DeploymentControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultDeploymentControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.DeploymentControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentDeploymentSyncs == 0 {
|
||||
obj.ConcurrentDeploymentSyncs = 5
|
||||
}
|
||||
if obj.DeploymentControllerSyncPeriod == zero {
|
||||
obj.DeploymentControllerSyncPeriod = metav1.Duration{Duration: 30 * time.Second}
|
||||
}
|
||||
}
|
21
pkg/controller/deployment/config/v1alpha1/doc.go
Normal file
21
pkg/controller/deployment/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/deployment/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/deployment/config/v1alpha1"
|
31
pkg/controller/deployment/config/v1alpha1/register.go
Normal file
31
pkg/controller/deployment/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/endpoint/config/OWNERS
Normal file
14
pkg/controller/endpoint/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/endpoint/config/doc.go
Normal file
19
pkg/controller/endpoint/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/endpoint/config"
|
25
pkg/controller/endpoint/config/types.go
Normal file
25
pkg/controller/endpoint/config/types.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// EndpointControllerConfiguration contains elements describing EndpointController.
|
||||
type EndpointControllerConfiguration struct {
|
||||
// concurrentEndpointSyncs is the number of endpoint syncing operations
|
||||
// that will be done concurrently. Larger number = faster endpoint updating,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentEndpointSyncs int32
|
||||
}
|
40
pkg/controller/endpoint/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/endpoint/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
endpointconfig "k8s.io/kubernetes/pkg/controller/endpoint/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with EndpointControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_EndpointControllerConfiguration_To_config_EndpointControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_EndpointControllerConfiguration_To_config_EndpointControllerConfiguration(in *v1alpha1.EndpointControllerConfiguration, out *endpointconfig.EndpointControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_EndpointControllerConfiguration_To_config_EndpointControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(in *endpointconfig.EndpointControllerConfiguration, out *v1alpha1.EndpointControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_EndpointControllerConfiguration_To_v1alpha1_EndpointControllerConfiguration(in, out, s)
|
||||
}
|
36
pkg/controller/endpoint/config/v1alpha1/defaults.go
Normal file
36
pkg/controller/endpoint/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultEndpointControllerConfiguration defaults a pointer to a
|
||||
// EndpointControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultEndpointControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.EndpointControllerConfiguration) {
|
||||
if obj.ConcurrentEndpointSyncs == 0 {
|
||||
obj.ConcurrentEndpointSyncs = 5
|
||||
}
|
||||
}
|
21
pkg/controller/endpoint/config/v1alpha1/doc.go
Normal file
21
pkg/controller/endpoint/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/endpoint/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/endpoint/config/v1alpha1"
|
31
pkg/controller/endpoint/config/v1alpha1/register.go
Normal file
31
pkg/controller/endpoint/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/garbagecollector/config/OWNERS
Normal file
14
pkg/controller/garbagecollector/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/garbagecollector/config/doc.go
Normal file
19
pkg/controller/garbagecollector/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/garbagecollector/config"
|
38
pkg/controller/garbagecollector/config/types.go
Normal file
38
pkg/controller/garbagecollector/config/types.go
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// GroupResource describes an group resource.
|
||||
type GroupResource struct {
|
||||
// group is the group portion of the GroupResource.
|
||||
Group string
|
||||
// resource is the resource portion of the GroupResource.
|
||||
Resource string
|
||||
}
|
||||
|
||||
// GarbageCollectorControllerConfiguration contains elements describing GarbageCollectorController.
|
||||
type GarbageCollectorControllerConfiguration struct {
|
||||
// enables the generic garbage collector. MUST be synced with the
|
||||
// corresponding flag of the kube-apiserver. WARNING: the generic garbage
|
||||
// collector is an alpha feature.
|
||||
EnableGarbageCollector bool
|
||||
// concurrentGCSyncs is the number of garbage collector workers that are
|
||||
// allowed to sync concurrently.
|
||||
ConcurrentGCSyncs int32
|
||||
// gcIgnoredResources is the list of GroupResources that garbage collection should ignore.
|
||||
GCIgnoredResources []GroupResource
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/garbagecollector/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with GarbageCollectorControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_GarbageCollectorControllerConfiguration_To_config_GarbageCollectorControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_GarbageCollectorControllerConfiguration_To_config_GarbageCollectorControllerConfiguration(in *v1alpha1.GarbageCollectorControllerConfiguration, out *config.GarbageCollectorControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_GarbageCollectorControllerConfiguration_To_config_GarbageCollectorControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration(in *config.GarbageCollectorControllerConfiguration, out *v1alpha1.GarbageCollectorControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_GarbageCollectorControllerConfiguration_To_v1alpha1_GarbageCollectorControllerConfiguration(in, out, s)
|
||||
}
|
40
pkg/controller/garbagecollector/config/v1alpha1/defaults.go
Normal file
40
pkg/controller/garbagecollector/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
// RecommendedDefaultGarbageCollectorControllerConfiguration defaults a pointer to a
|
||||
// GarbageCollectorControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultGarbageCollectorControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.GarbageCollectorControllerConfiguration) {
|
||||
if obj.EnableGarbageCollector == nil {
|
||||
obj.EnableGarbageCollector = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.ConcurrentGCSyncs == 0 {
|
||||
obj.ConcurrentGCSyncs = 20
|
||||
}
|
||||
}
|
21
pkg/controller/garbagecollector/config/v1alpha1/doc.go
Normal file
21
pkg/controller/garbagecollector/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/garbagecollector/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/garbagecollector/config/v1alpha1"
|
31
pkg/controller/garbagecollector/config/v1alpha1/register.go
Normal file
31
pkg/controller/garbagecollector/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/job/config/OWNERS
Normal file
14
pkg/controller/job/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/job/config/doc.go
Normal file
19
pkg/controller/job/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/job/config"
|
25
pkg/controller/job/config/types.go
Normal file
25
pkg/controller/job/config/types.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// JobControllerConfiguration contains elements describing JobController.
|
||||
type JobControllerConfiguration struct {
|
||||
// concurrentJobSyncs is the number of job objects that are
|
||||
// allowed to sync concurrently. Larger number = more responsive jobs,
|
||||
// but more CPU (and network) load.
|
||||
ConcurrentJobSyncs int32
|
||||
}
|
40
pkg/controller/job/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/job/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/job/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with JobControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_JobControllerConfiguration_To_config_JobControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_JobControllerConfiguration_To_config_JobControllerConfiguration(in *v1alpha1.JobControllerConfiguration, out *config.JobControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_JobControllerConfiguration_To_config_JobControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_JobControllerConfiguration_To_v1alpha1_JobControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_JobControllerConfiguration_To_v1alpha1_JobControllerConfiguration(in *config.JobControllerConfiguration, out *v1alpha1.JobControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_JobControllerConfiguration_To_v1alpha1_JobControllerConfiguration(in, out, s)
|
||||
}
|
36
pkg/controller/job/config/v1alpha1/defaults.go
Normal file
36
pkg/controller/job/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultJobControllerConfiguration defaults a pointer to a
|
||||
// JobControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultJobControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.JobControllerConfiguration) {
|
||||
if obj.ConcurrentJobSyncs == 0 {
|
||||
obj.ConcurrentJobSyncs = 5
|
||||
}
|
||||
}
|
21
pkg/controller/job/config/v1alpha1/doc.go
Normal file
21
pkg/controller/job/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/job/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/job/config/v1alpha1"
|
31
pkg/controller/job/config/v1alpha1/register.go
Normal file
31
pkg/controller/job/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/namespace/config/OWNERS
Normal file
14
pkg/controller/namespace/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/namespace/config/doc.go
Normal file
19
pkg/controller/namespace/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/namespace/config"
|
31
pkg/controller/namespace/config/types.go
Normal file
31
pkg/controller/namespace/config/types.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NamespaceControllerConfiguration contains elements describing NamespaceController.
|
||||
type NamespaceControllerConfiguration struct {
|
||||
// namespaceSyncPeriod is the period for syncing namespace life-cycle
|
||||
// updates.
|
||||
NamespaceSyncPeriod metav1.Duration
|
||||
// concurrentNamespaceSyncs is the number of namespace objects that are
|
||||
// allowed to sync concurrently.
|
||||
ConcurrentNamespaceSyncs int32
|
||||
}
|
40
pkg/controller/namespace/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/namespace/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/namespace/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with NamespaceControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_NamespaceControllerConfiguration_To_config_NamespaceControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_NamespaceControllerConfiguration_To_config_NamespaceControllerConfiguration(in *v1alpha1.NamespaceControllerConfiguration, out *config.NamespaceControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_NamespaceControllerConfiguration_To_config_NamespaceControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(in *config.NamespaceControllerConfiguration, out *v1alpha1.NamespaceControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_NamespaceControllerConfiguration_To_v1alpha1_NamespaceControllerConfiguration(in, out, s)
|
||||
}
|
43
pkg/controller/namespace/config/v1alpha1/defaults.go
Normal file
43
pkg/controller/namespace/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultNamespaceControllerConfiguration defaults a pointer to a
|
||||
// NamespaceControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultNamespaceControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.NamespaceControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentNamespaceSyncs == 0 {
|
||||
obj.ConcurrentNamespaceSyncs = 10
|
||||
}
|
||||
if obj.NamespaceSyncPeriod == zero {
|
||||
obj.NamespaceSyncPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
}
|
21
pkg/controller/namespace/config/v1alpha1/doc.go
Normal file
21
pkg/controller/namespace/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/namespace/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/namespace/config/v1alpha1"
|
31
pkg/controller/namespace/config/v1alpha1/register.go
Normal file
31
pkg/controller/namespace/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/nodeipam/config/OWNERS
Normal file
14
pkg/controller/nodeipam/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/nodeipam/config/doc.go
Normal file
19
pkg/controller/nodeipam/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/nodeipam/config"
|
25
pkg/controller/nodeipam/config/types.go
Normal file
25
pkg/controller/nodeipam/config/types.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// NodeIPAMControllerConfiguration contains elements describing NodeIPAMController.
|
||||
type NodeIPAMControllerConfiguration struct {
|
||||
// serviceCIDR is CIDR Range for Services in cluster.
|
||||
ServiceCIDR string
|
||||
// NodeCIDRMaskSize is the mask size for node cidr in cluster.
|
||||
NodeCIDRMaskSize int32
|
||||
}
|
40
pkg/controller/nodeipam/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/nodeipam/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/nodeipam/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with NodeIPAMControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration(in *v1alpha1.NodeIPAMControllerConfiguration, out *config.NodeIPAMControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_NodeIPAMControllerConfiguration_To_config_NodeIPAMControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(in *config.NodeIPAMControllerConfiguration, out *v1alpha1.NodeIPAMControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_NodeIPAMControllerConfiguration_To_v1alpha1_NodeIPAMControllerConfiguration(in, out, s)
|
||||
}
|
36
pkg/controller/nodeipam/config/v1alpha1/defaults.go
Normal file
36
pkg/controller/nodeipam/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultNodeIPAMControllerConfiguration defaults a pointer to a
|
||||
// NodeIPAMControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultNodeIPAMControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.NodeIPAMControllerConfiguration) {
|
||||
if obj.NodeCIDRMaskSize == 0 {
|
||||
obj.NodeCIDRMaskSize = 24
|
||||
}
|
||||
}
|
21
pkg/controller/nodeipam/config/v1alpha1/doc.go
Normal file
21
pkg/controller/nodeipam/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/nodeipam/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/nodeipam/config/v1alpha1"
|
31
pkg/controller/nodeipam/config/v1alpha1/register.go
Normal file
31
pkg/controller/nodeipam/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/nodelifecycle/config/OWNERS
Normal file
14
pkg/controller/nodelifecycle/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/nodelifecycle/config/doc.go
Normal file
19
pkg/controller/nodelifecycle/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/nodelifecycle/config"
|
47
pkg/controller/nodelifecycle/config/types.go
Normal file
47
pkg/controller/nodelifecycle/config/types.go
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// NodeLifecycleControllerConfiguration contains elements describing NodeLifecycleController.
|
||||
type NodeLifecycleControllerConfiguration struct {
|
||||
// If set to true enables NoExecute Taints and will evict all not-tolerating
|
||||
// Pod running on Nodes tainted with this kind of Taints.
|
||||
EnableTaintManager bool
|
||||
// nodeEvictionRate is the number of nodes per second on which pods are deleted in case of node failure when a zone is healthy
|
||||
NodeEvictionRate float32
|
||||
// secondaryNodeEvictionRate is the number of nodes per second on which pods are deleted in case of node failure when a zone is unhealthy
|
||||
SecondaryNodeEvictionRate float32
|
||||
// nodeStartupGracePeriod is the amount of time which we allow starting a node to
|
||||
// be unresponsive before marking it unhealthy.
|
||||
NodeStartupGracePeriod metav1.Duration
|
||||
// nodeMontiorGracePeriod is the amount of time which we allow a running node to be
|
||||
// unresponsive before marking it unhealthy. Must be N times more than kubelet's
|
||||
// nodeStatusUpdateFrequency, where N means number of retries allowed for kubelet
|
||||
// to post node status.
|
||||
NodeMonitorGracePeriod metav1.Duration
|
||||
// podEvictionTimeout is the grace period for deleting pods on failed nodes.
|
||||
PodEvictionTimeout metav1.Duration
|
||||
// secondaryNodeEvictionRate is implicitly overridden to 0 for clusters smaller than or equal to largeClusterSizeThreshold
|
||||
LargeClusterSizeThreshold int32
|
||||
// Zone is treated as unhealthy in nodeEvictionRate and secondaryNodeEvictionRate when at least
|
||||
// unhealthyZoneThreshold (no less than 3) of Nodes in the zone are NotReady
|
||||
UnhealthyZoneThreshold float32
|
||||
}
|
40
pkg/controller/nodelifecycle/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/nodelifecycle/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/nodelifecycle/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with NodeLifecycleControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_NodeLifecycleControllerConfiguration_To_config_NodeLifecycleControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_NodeLifecycleControllerConfiguration_To_config_NodeLifecycleControllerConfiguration(in *v1alpha1.NodeLifecycleControllerConfiguration, out *config.NodeLifecycleControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_NodeLifecycleControllerConfiguration_To_config_NodeLifecycleControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_NodeLifecycleControllerConfiguration_To_v1alpha1_NodeLifecycleControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_NodeLifecycleControllerConfiguration_To_v1alpha1_NodeLifecycleControllerConfiguration(in *config.NodeLifecycleControllerConfiguration, out *v1alpha1.NodeLifecycleControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_NodeLifecycleControllerConfiguration_To_v1alpha1_NodeLifecycleControllerConfiguration(in, out, s)
|
||||
}
|
50
pkg/controller/nodelifecycle/config/v1alpha1/defaults.go
Normal file
50
pkg/controller/nodelifecycle/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
// RecommendedDefaultNodeLifecycleControllerConfiguration defaults a pointer to a
|
||||
// NodeLifecycleControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultNodeLifecycleControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.NodeLifecycleControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.PodEvictionTimeout == zero {
|
||||
obj.PodEvictionTimeout = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.NodeMonitorGracePeriod == zero {
|
||||
obj.NodeMonitorGracePeriod = metav1.Duration{Duration: 40 * time.Second}
|
||||
}
|
||||
if obj.NodeStartupGracePeriod == zero {
|
||||
obj.NodeStartupGracePeriod = metav1.Duration{Duration: 60 * time.Second}
|
||||
}
|
||||
if obj.EnableTaintManager == nil {
|
||||
obj.EnableTaintManager = utilpointer.BoolPtr(true)
|
||||
}
|
||||
}
|
21
pkg/controller/nodelifecycle/config/v1alpha1/doc.go
Normal file
21
pkg/controller/nodelifecycle/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/nodelifecycle/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/nodelifecycle/config/v1alpha1"
|
31
pkg/controller/nodelifecycle/config/v1alpha1/register.go
Normal file
31
pkg/controller/nodelifecycle/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/podautoscaler/config/OWNERS
Normal file
14
pkg/controller/podautoscaler/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/podautoscaler/config/doc.go
Normal file
19
pkg/controller/podautoscaler/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/podautoscaler/config"
|
50
pkg/controller/podautoscaler/config/types.go
Normal file
50
pkg/controller/podautoscaler/config/types.go
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// HPAControllerConfiguration contains elements describing HPAController.
|
||||
type HPAControllerConfiguration struct {
|
||||
// horizontalPodAutoscalerSyncPeriod is the period for syncing the number of
|
||||
// pods in horizontal pod autoscaler.
|
||||
HorizontalPodAutoscalerSyncPeriod metav1.Duration
|
||||
// horizontalPodAutoscalerUpscaleForbiddenWindow is a period after which next upscale allowed.
|
||||
HorizontalPodAutoscalerUpscaleForbiddenWindow metav1.Duration
|
||||
// horizontalPodAutoscalerDownscaleForbiddenWindow is a period after which next downscale allowed.
|
||||
HorizontalPodAutoscalerDownscaleForbiddenWindow metav1.Duration
|
||||
// HorizontalPodAutoscalerDowncaleStabilizationWindow is a period for which autoscaler will look
|
||||
// backwards and not scale down below any recommendation it made during that period.
|
||||
HorizontalPodAutoscalerDownscaleStabilizationWindow metav1.Duration
|
||||
// horizontalPodAutoscalerTolerance is the tolerance for when
|
||||
// resource usage suggests upscaling/downscaling
|
||||
HorizontalPodAutoscalerTolerance float64
|
||||
// HorizontalPodAutoscalerUseRESTClients causes the HPA controller to use REST clients
|
||||
// through the kube-aggregator when enabled, instead of using the legacy metrics client
|
||||
// through the API server proxy.
|
||||
HorizontalPodAutoscalerUseRESTClients bool
|
||||
// HorizontalPodAutoscalerCPUInitializationPeriod is the period after pod start when CPU samples
|
||||
// might be skipped.
|
||||
HorizontalPodAutoscalerCPUInitializationPeriod metav1.Duration
|
||||
// HorizontalPodAutoscalerInitialReadinessDelay is period after pod start during which readiness
|
||||
// changes are treated as readiness being set for the first time. The only effect of this is that
|
||||
// HPA will disregard CPU samples from unready pods that had last readiness change during that
|
||||
// period.
|
||||
HorizontalPodAutoscalerInitialReadinessDelay metav1.Duration
|
||||
}
|
40
pkg/controller/podautoscaler/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/podautoscaler/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/podautoscaler/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with HPAControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_config_HPAControllerConfiguration_To_v1alpha1_HPAControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_HPAControllerConfiguration_To_v1alpha1_HPAControllerConfiguration(in *config.HPAControllerConfiguration, out *v1alpha1.HPAControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_HPAControllerConfiguration_To_v1alpha1_HPAControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_v1alpha1_HPAControllerConfiguration_To_config_HPAControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_HPAControllerConfiguration_To_config_HPAControllerConfiguration(in *v1alpha1.HPAControllerConfiguration, out *config.HPAControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_HPAControllerConfiguration_To_config_HPAControllerConfiguration(in, out, s)
|
||||
}
|
62
pkg/controller/podautoscaler/config/v1alpha1/defaults.go
Normal file
62
pkg/controller/podautoscaler/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
// RecommendedDefaultHPAControllerConfiguration defaults a pointer to a
|
||||
// HPAControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultHPAControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.HPAControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.HorizontalPodAutoscalerUseRESTClients == nil {
|
||||
obj.HorizontalPodAutoscalerUseRESTClients = utilpointer.BoolPtr(true)
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerSyncPeriod == zero {
|
||||
obj.HorizontalPodAutoscalerSyncPeriod = metav1.Duration{Duration: 15 * time.Second}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerUpscaleForbiddenWindow == zero {
|
||||
obj.HorizontalPodAutoscalerUpscaleForbiddenWindow = metav1.Duration{Duration: 3 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerDownscaleStabilizationWindow == zero {
|
||||
obj.HorizontalPodAutoscalerDownscaleStabilizationWindow = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerCPUInitializationPeriod == zero {
|
||||
obj.HorizontalPodAutoscalerCPUInitializationPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerInitialReadinessDelay == zero {
|
||||
obj.HorizontalPodAutoscalerInitialReadinessDelay = metav1.Duration{Duration: 30 * time.Second}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerDownscaleForbiddenWindow == zero {
|
||||
obj.HorizontalPodAutoscalerDownscaleForbiddenWindow = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
if obj.HorizontalPodAutoscalerTolerance == 0 {
|
||||
obj.HorizontalPodAutoscalerTolerance = 0.1
|
||||
}
|
||||
}
|
21
pkg/controller/podautoscaler/config/v1alpha1/doc.go
Normal file
21
pkg/controller/podautoscaler/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/podautoscaler/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/podautoscaler/config/v1alpha1"
|
31
pkg/controller/podautoscaler/config/v1alpha1/register.go
Normal file
31
pkg/controller/podautoscaler/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/podgc/config/OWNERS
Normal file
14
pkg/controller/podgc/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/podgc/config/doc.go
Normal file
19
pkg/controller/podgc/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/podgc/config"
|
25
pkg/controller/podgc/config/types.go
Normal file
25
pkg/controller/podgc/config/types.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// PodGCControllerConfiguration contains elements describing PodGCController.
|
||||
type PodGCControllerConfiguration struct {
|
||||
// terminatedPodGCThreshold is the number of terminated pods that can exist
|
||||
// before the terminated pod garbage collector starts deleting terminated pods.
|
||||
// If <= 0, the terminated pod garbage collector is disabled.
|
||||
TerminatedPodGCThreshold int32
|
||||
}
|
40
pkg/controller/podgc/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/podgc/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/podgc/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with PodGCControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_PodGCControllerConfiguration_To_config_PodGCControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_PodGCControllerConfiguration_To_config_PodGCControllerConfiguration(in *v1alpha1.PodGCControllerConfiguration, out *config.PodGCControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_PodGCControllerConfiguration_To_config_PodGCControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_PodGCControllerConfiguration_To_v1alpha1_PodGCControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_PodGCControllerConfiguration_To_v1alpha1_PodGCControllerConfiguration(in *config.PodGCControllerConfiguration, out *v1alpha1.PodGCControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_PodGCControllerConfiguration_To_v1alpha1_PodGCControllerConfiguration(in, out, s)
|
||||
}
|
36
pkg/controller/podgc/config/v1alpha1/defaults.go
Normal file
36
pkg/controller/podgc/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultPodGCControllerConfiguration defaults a pointer to a
|
||||
// PodGCControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultPodGCControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.PodGCControllerConfiguration) {
|
||||
if obj.TerminatedPodGCThreshold == 0 {
|
||||
obj.TerminatedPodGCThreshold = 12500
|
||||
}
|
||||
}
|
21
pkg/controller/podgc/config/v1alpha1/doc.go
Normal file
21
pkg/controller/podgc/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/podgc/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/podgc/config/v1alpha1"
|
31
pkg/controller/podgc/config/v1alpha1/register.go
Normal file
31
pkg/controller/podgc/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/replicaset/config/OWNERS
Normal file
14
pkg/controller/replicaset/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/replicaset/config/doc.go
Normal file
19
pkg/controller/replicaset/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/replicaset/config"
|
25
pkg/controller/replicaset/config/types.go
Normal file
25
pkg/controller/replicaset/config/types.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// ReplicaSetControllerConfiguration contains elements describing ReplicaSetController.
|
||||
type ReplicaSetControllerConfiguration struct {
|
||||
// concurrentRSSyncs is the number of replica sets that are allowed to sync
|
||||
// concurrently. Larger number = more responsive replica management, but more
|
||||
// CPU (and network) load.
|
||||
ConcurrentRSSyncs int32
|
||||
}
|
40
pkg/controller/replicaset/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/replicaset/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/replicaset/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with ReplicaSetControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_ReplicaSetControllerConfiguration_To_config_ReplicaSetControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_ReplicaSetControllerConfiguration_To_config_ReplicaSetControllerConfiguration(in *v1alpha1.ReplicaSetControllerConfiguration, out *config.ReplicaSetControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_ReplicaSetControllerConfiguration_To_config_ReplicaSetControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_ReplicaSetControllerConfiguration_To_v1alpha1_ReplicaSetControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_ReplicaSetControllerConfiguration_To_v1alpha1_ReplicaSetControllerConfiguration(in *config.ReplicaSetControllerConfiguration, out *v1alpha1.ReplicaSetControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_ReplicaSetControllerConfiguration_To_v1alpha1_ReplicaSetControllerConfiguration(in, out, s)
|
||||
}
|
36
pkg/controller/replicaset/config/v1alpha1/defaults.go
Normal file
36
pkg/controller/replicaset/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultReplicaSetControllerConfiguration defaults a pointer to a
|
||||
// ReplicaSetControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultReplicaSetControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ReplicaSetControllerConfiguration) {
|
||||
if obj.ConcurrentRSSyncs == 0 {
|
||||
obj.ConcurrentRSSyncs = 5
|
||||
}
|
||||
}
|
21
pkg/controller/replicaset/config/v1alpha1/doc.go
Normal file
21
pkg/controller/replicaset/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/replicaset/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/replicaset/config/v1alpha1"
|
31
pkg/controller/replicaset/config/v1alpha1/register.go
Normal file
31
pkg/controller/replicaset/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/replication/config/OWNERS
Normal file
14
pkg/controller/replication/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/replication/config/doc.go
Normal file
19
pkg/controller/replication/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/replication/config"
|
25
pkg/controller/replication/config/types.go
Normal file
25
pkg/controller/replication/config/types.go
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
// ReplicationControllerConfiguration contains elements describing ReplicationController.
|
||||
type ReplicationControllerConfiguration struct {
|
||||
// concurrentRCSyncs is the number of replication controllers that are
|
||||
// allowed to sync concurrently. Larger number = more responsive replica
|
||||
// management, but more CPU (and network) load.
|
||||
ConcurrentRCSyncs int32
|
||||
}
|
40
pkg/controller/replication/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/replication/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/replication/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with ReplicationControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_ReplicationControllerConfiguration_To_config_ReplicationControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_ReplicationControllerConfiguration_To_config_ReplicationControllerConfiguration(in *v1alpha1.ReplicationControllerConfiguration, out *config.ReplicationControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_ReplicationControllerConfiguration_To_config_ReplicationControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_ReplicationControllerConfiguration_To_v1alpha1_ReplicationControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_ReplicationControllerConfiguration_To_v1alpha1_ReplicationControllerConfiguration(in *config.ReplicationControllerConfiguration, out *v1alpha1.ReplicationControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_ReplicationControllerConfiguration_To_v1alpha1_ReplicationControllerConfiguration(in, out, s)
|
||||
}
|
36
pkg/controller/replication/config/v1alpha1/defaults.go
Normal file
36
pkg/controller/replication/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultReplicationControllerConfiguration defaults a pointer to a
|
||||
// ReplicationControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultReplicationControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ReplicationControllerConfiguration) {
|
||||
if obj.ConcurrentRCSyncs == 0 {
|
||||
obj.ConcurrentRCSyncs = 5
|
||||
}
|
||||
}
|
21
pkg/controller/replication/config/v1alpha1/doc.go
Normal file
21
pkg/controller/replication/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/replication/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/replication/config/v1alpha1"
|
31
pkg/controller/replication/config/v1alpha1/register.go
Normal file
31
pkg/controller/replication/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/resourcequota/config/OWNERS
Normal file
14
pkg/controller/resourcequota/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
19
pkg/controller/resourcequota/config/doc.go
Normal file
19
pkg/controller/resourcequota/config/doc.go
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/controller/resourcequota/config"
|
32
pkg/controller/resourcequota/config/types.go
Normal file
32
pkg/controller/resourcequota/config/types.go
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ResourceQuotaControllerConfiguration contains elements describing ResourceQuotaController.
|
||||
type ResourceQuotaControllerConfiguration struct {
|
||||
// resourceQuotaSyncPeriod is the period for syncing quota usage status
|
||||
// in the system.
|
||||
ResourceQuotaSyncPeriod metav1.Duration
|
||||
// concurrentResourceQuotaSyncs is the number of resource quotas that are
|
||||
// allowed to sync concurrently. Larger number = more responsive quota
|
||||
// management, but more CPU (and network) load.
|
||||
ConcurrentResourceQuotaSyncs int32
|
||||
}
|
40
pkg/controller/resourcequota/config/v1alpha1/conversion.go
Normal file
40
pkg/controller/resourcequota/config/v1alpha1/conversion.go
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/controller/resourcequota/config"
|
||||
)
|
||||
|
||||
// Important! The public back-and-forth conversion functions for the types in this package
|
||||
// with ResourceQuotaControllerConfiguration types need to be manually exposed like this in order for
|
||||
// other packages that reference this package to be able to call these conversion functions
|
||||
// in an autogenerated manner.
|
||||
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
|
||||
// in autogenerated code as well.
|
||||
|
||||
// Convert_v1alpha1_ResourceQuotaControllerConfiguration_To_config_ResourceQuotaControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_v1alpha1_ResourceQuotaControllerConfiguration_To_config_ResourceQuotaControllerConfiguration(in *v1alpha1.ResourceQuotaControllerConfiguration, out *config.ResourceQuotaControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha1_ResourceQuotaControllerConfiguration_To_config_ResourceQuotaControllerConfiguration(in, out, s)
|
||||
}
|
||||
|
||||
// Convert_config_ResourceQuotaControllerConfiguration_To_v1alpha1_ResourceQuotaControllerConfiguration is an autogenerated conversion function.
|
||||
func Convert_config_ResourceQuotaControllerConfiguration_To_v1alpha1_ResourceQuotaControllerConfiguration(in *config.ResourceQuotaControllerConfiguration, out *v1alpha1.ResourceQuotaControllerConfiguration, s conversion.Scope) error {
|
||||
return autoConvert_config_ResourceQuotaControllerConfiguration_To_v1alpha1_ResourceQuotaControllerConfiguration(in, out, s)
|
||||
}
|
43
pkg/controller/resourcequota/config/v1alpha1/defaults.go
Normal file
43
pkg/controller/resourcequota/config/v1alpha1/defaults.go
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
|
||||
)
|
||||
|
||||
// RecommendedDefaultResourceQuotaControllerConfiguration defaults a pointer to a
|
||||
// ResourceQuotaControllerConfiguration struct. This will set the recommended default
|
||||
// values, but they may be subject to change between API versions. This function
|
||||
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
|
||||
// function to allow consumers of this type to set whatever defaults for their
|
||||
// embedded configs. Forcing consumers to use these defaults would be problematic
|
||||
// as defaulting in the scheme is done as part of the conversion, and there would
|
||||
// be no easy way to opt-out. Instead, if you want to use this defaulting method
|
||||
// run it in your wrapper struct of this type in its `SetDefaults_` method.
|
||||
func RecommendedDefaultResourceQuotaControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ResourceQuotaControllerConfiguration) {
|
||||
zero := metav1.Duration{}
|
||||
if obj.ConcurrentResourceQuotaSyncs == 0 {
|
||||
obj.ConcurrentResourceQuotaSyncs = 5
|
||||
}
|
||||
if obj.ResourceQuotaSyncPeriod == zero {
|
||||
obj.ResourceQuotaSyncPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
}
|
||||
}
|
21
pkg/controller/resourcequota/config/v1alpha1/doc.go
Normal file
21
pkg/controller/resourcequota/config/v1alpha1/doc.go
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/resourcequota/config
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
|
||||
|
||||
package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/resourcequota/config/v1alpha1"
|
31
pkg/controller/resourcequota/config/v1alpha1/register.go
Normal file
31
pkg/controller/resourcequota/config/v1alpha1/register.go
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder is the scheme builder with scheme init functions to run for this API package
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
|
||||
// defaulting and conversion init funcs are registered as well.
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
14
pkg/controller/service/config/OWNERS
Normal file
14
pkg/controller/service/config/OWNERS
Normal file
@@ -0,0 +1,14 @@
|
||||
approvers:
|
||||
- api-approvers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
||||
reviewers:
|
||||
- api-reviewers
|
||||
- deads2k
|
||||
- luxas
|
||||
- mtaufen
|
||||
- sttts
|
||||
- stewart-yu
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user