talos

Форк
0
54 строки · 1.3 Кб
1
// This Source Code Form is subject to the terms of the Mozilla Public
2
// License, v. 2.0. If a copy of the MPL was not distributed with this
3
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4

5
package kubernetes
6

7
import (
8
	"fmt"
9
	"io"
10

11
	"github.com/siderolabs/go-kubernetes/kubernetes/upgrade"
12

13
	"github.com/siderolabs/talos/pkg/machinery/config/encoder"
14
)
15

16
const (
17
	namespace = "kube-system"
18

19
	kubeAPIServer         = "kube-apiserver"
20
	kubeControllerManager = "kube-controller-manager"
21
	kubeScheduler         = "kube-scheduler"
22
)
23

24
// UpgradeOptions represents Kubernetes control plane upgrade settings.
25
type UpgradeOptions struct {
26
	Path *upgrade.Path
27

28
	ControlPlaneEndpoint string
29
	LogOutput            io.Writer
30
	PrePullImages        bool
31
	UpgradeKubelet       bool
32
	DryRun               bool
33
	EncoderOpt           encoder.Option
34

35
	KubeletImage           string
36
	APIServerImage         string
37
	ControllerManagerImage string
38
	SchedulerImage         string
39
	ProxyImage             string
40

41
	controlPlaneNodes []string
42
	workerNodes       []string
43
}
44

45
// Log writes the line to logger or to stdout if no logger was provided.
46
func (options *UpgradeOptions) Log(line string, args ...interface{}) {
47
	if options.LogOutput != nil {
48
		options.LogOutput.Write([]byte(fmt.Sprintf(line, args...))) //nolint:errcheck
49

50
		return
51
	}
52

53
	fmt.Printf(line+"\n", args...)
54
}
55

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.