|
| 1 | +/* |
| 2 | +Copyright 2020 The Kubernetes Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package config |
| 18 | + |
| 19 | +import ( |
| 20 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | +) |
| 22 | + |
| 23 | +// LeaderMigrationConfiguration provides versioned configuration for all migrating leader locks. |
| 24 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 25 | +type LeaderMigrationConfiguration struct { |
| 26 | + metav1.TypeMeta `json:",inline"` |
| 27 | + |
| 28 | + // LeaderName is the name of the leader election resource that protects the migration |
| 29 | + // E.g. 1-20-KCM-to-1-21-CCM |
| 30 | + LeaderName string `json:"leaderName"` |
| 31 | + |
| 32 | + // ResourceLock indicates the resource object type that will be used to lock |
| 33 | + // Should be "leases" or "endpoints" |
| 34 | + ResourceLock string `json:"resourceLock"` |
| 35 | + |
| 36 | + // ControllerLeaders contains a list of migrating leader lock configurations |
| 37 | + ControllerLeaders []ControllerLeaderConfiguration `json:"controllerLeaders"` |
| 38 | +} |
| 39 | + |
| 40 | +// ControllerLeaderConfiguration provides the configuration for a migrating leader lock. |
| 41 | +type ControllerLeaderConfiguration struct { |
| 42 | + // Name is the name of the controller being migrated |
| 43 | + // E.g. service-controller, route-controller, cloud-node-controller, etc |
| 44 | + Name string `json:"name"` |
| 45 | + |
| 46 | + // Component is the name of the component in which the controller should be running. |
| 47 | + // E.g. kube-controller-manager, cloud-controller-manager, etc |
| 48 | + Component string `json:"component"` |
| 49 | +} |
0 commit comments