/
types.go
132 lines (117 loc) · 5.91 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// 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 (
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
componentbaseconfig "k8s.io/component-base/config"
)
const (
// SameRegion Strategy determines a seed candidate for a shoot only if the cloud profile and region are identical
SameRegion CandidateDeterminationStrategy = "SameRegion"
// MinimalDistance Strategy determines a seed candidate for a shoot if the cloud profile are identical. Then chooses the seed with the minimal distance to the shoot.
MinimalDistance CandidateDeterminationStrategy = "MinimalDistance"
// Default Strategy is the default strategy to use when there is no configuration provided
Default CandidateDeterminationStrategy = SameRegion
// SchedulerDefaultLockObjectNamespace is the default lock namespace for leader election.
SchedulerDefaultLockObjectNamespace = "garden"
// SchedulerDefaultLockObjectName is the default lock name for leader election.
SchedulerDefaultLockObjectName = "gardener-scheduler-leader-election"
// SchedulerDefaultConfigurationConfigMapNamespace is the namespace of the scheduler configuration config map
SchedulerDefaultConfigurationConfigMapNamespace = "garden"
// SchedulerDefaultConfigurationConfigMapName is the name of the scheduler configuration config map
SchedulerDefaultConfigurationConfigMapName = "gardener-scheduler-configmap"
// DefaultDiscoveryTTL is the default ttl for the cached discovery client.
DefaultDiscoveryTTL = 10 * time.Second
)
// Strategies defines all currently implemented SeedCandidateDeterminationStrategies
var Strategies = []CandidateDeterminationStrategy{SameRegion, MinimalDistance}
// CandidateDeterminationStrategy defines how seeds for shoots, that do not specify a seed explicitly, are being determined
type CandidateDeterminationStrategy string
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// SchedulerConfiguration provides the configuration for the Gardener scheduler
type SchedulerConfiguration struct {
metav1.TypeMeta
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the gardener-apiserver.
ClientConnection componentbaseconfig.ClientConnectionConfiguration
// LeaderElection defines the configuration of leader election client.
LeaderElection *componentbaseconfig.LeaderElectionConfiguration
// LogLevel is the level/severity for the logs. Must be one of [info,debug,error].
LogLevel string
// LogFormat is the output format for the logs. Must be one of [text,json].
LogFormat string
// Server defines the configuration of the HTTP server. This is deprecated in favor of
// HealthServer.
Server ServerConfiguration
// Debugging holds configuration for Debugging related features.
Debugging *componentbaseconfig.DebuggingConfiguration
// Scheduler defines the configuration of the schedulers.
Schedulers SchedulerControllerConfiguration
// FeatureGates is a map of feature names to bools that enable or disable alpha/experimental
// features. This field modifies piecemeal the built-in default values from
// "github.com/gardener/gardener/pkg/scheduler/features/features.go".
// Default: nil
FeatureGates map[string]bool
}
// SchedulerControllerConfiguration defines the configuration of the controllers.
type SchedulerControllerConfiguration struct {
// BackupBucket defines the configuration of the BackupBucket controller.
// +optional
BackupBucket *BackupBucketSchedulerConfiguration
// Shoot defines the configuration of the Shoot controller.
// +optional
Shoot *ShootSchedulerConfiguration
}
// BackupBucketSchedulerConfiguration defines the configuration of the BackupBucket to Seed
// scheduler.
type BackupBucketSchedulerConfiguration struct {
// ConcurrentSyncs is the number of workers used for the controller to work on
// events.
ConcurrentSyncs int
}
// BackupEntrySchedulerConfiguration defines the configuration of the BackupEntry to Seed
// scheduler.
type BackupEntrySchedulerConfiguration struct {
// ConcurrentSyncs is the number of workers used for the controller to work on
// events.
ConcurrentSyncs int
// RetrySyncPeriod is the duration how fast BackupEntries with an errornous operation are
// re-added to the queue so that the operation can be retried. Defaults to 15s.
// +optional
RetrySyncPeriod metav1.Duration
}
// ShootSchedulerConfiguration defines the configuration of the Shoot to Seed
// scheduler.
type ShootSchedulerConfiguration struct {
// ConcurrentSyncs is the number of workers used for the controller to work on
// events.
ConcurrentSyncs int
// Strategy defines how seeds for shoots, that do not specify a seed explicitly, are being determined
Strategy CandidateDeterminationStrategy
}
// ServerConfiguration contains details for the HTTP(S) servers.
type ServerConfiguration struct {
// HealthProbes is the configuration for serving the healthz and readyz endpoints.
HealthProbes *Server
// Metrics is the configuration for serving the metrics endpoint.
Metrics *Server
}
// Server contains information for HTTP(S) server configuration.
type Server struct {
// BindAddress is the IP address on which to listen for the specified port.
BindAddress string
// Port is the port on which to serve unsecured, unauthenticated access.
Port int
}