-
Notifications
You must be signed in to change notification settings - Fork 458
/
types.go
136 lines (121 loc) · 6.42 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
133
134
135
136
// Copyright (c) 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 v1alpha1
import (
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
)
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 = 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
// LogLevelDebug is the debug log level, i.e. the most verbose.
LogLevelDebug = "debug"
// LogLevelInfo is the default log level.
LogLevelInfo = "info"
// LogLevelError is a log level where only errors are logged.
LogLevelError = "error"
// LogFormatJSON is the output type that produces a JSON object per log line.
LogFormatJSON = "json"
// LogFormatText outputs the log as human-readable text.
LogFormatText = "text"
)
// 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 SeedManager admission plugin.
type SchedulerConfiguration struct {
metav1.TypeMeta `json:",inline"`
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver.
ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection,omitempty"`
// LeaderElection defines the configuration of leader election client.
// +optional
LeaderElection *componentbaseconfigv1alpha1.LeaderElectionConfiguration `json:"leaderElection,omitempty"`
// LogLevel is the level/severity for the logs. Must be one of [info,debug,error].
LogLevel string `json:"logLevel,omitempty"`
// LogFormat is the output format for the logs. Must be one of [text,json].
LogFormat string `json:"logFormat,omitempty"`
// Server defines the configuration of the HTTP server. This is deprecated in favor of
// HealthServer.
Server ServerConfiguration `json:"server,omitempty"`
// Debugging holds configuration for Debugging related features.
// +optional
Debugging *componentbaseconfigv1alpha1.DebuggingConfiguration `json:"debugging,omitempty"`
// Scheduler defines the configuration of the schedulers.
Schedulers SchedulerControllerConfiguration `json:"schedulers"`
// 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
// +optional
FeatureGates map[string]bool `json:"featureGates,omitempty"`
}
// SchedulerControllerConfiguration defines the configuration of the controllers.
type SchedulerControllerConfiguration struct {
// BackupBucket defines the configuration of the BackupBucket controller.
// +optional
BackupBucket *BackupBucketSchedulerConfiguration `json:"backupBucket,omitempty"`
// Shoot defines the configuration of the Shoot controller.
// +optional
Shoot *ShootSchedulerConfiguration `json:"shoot,omitempty"`
}
// 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 `json:"concurrentSyncs"`
}
// 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 `json:"concurrentSyncs"`
// Strategy defines how seeds for shoots, that do not specify a seed explicitly, are being determined
Strategy CandidateDeterminationStrategy `json:"candidateDeterminationStrategy"`
}
// ServerConfiguration contains details for the HTTP(S) servers.
type ServerConfiguration struct {
// HealthProbes is the configuration for serving the healthz and readyz endpoints.
// +optional
HealthProbes *Server `json:"healthProbes,omitempty"`
// Metrics is the configuration for serving the metrics endpoint.
// +optional
Metrics *Server `json:"metrics,omitempty"`
}
// 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 `json:"bindAddress"`
// Port is the port on which to serve unsecured, unauthenticated access.
Port int `json:"port"`
}