talos
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
5package kubernetes6
7import (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
16const (17namespace = "kube-system"18
19kubeAPIServer = "kube-apiserver"20kubeControllerManager = "kube-controller-manager"21kubeScheduler = "kube-scheduler"22)
23
24// UpgradeOptions represents Kubernetes control plane upgrade settings.
25type UpgradeOptions struct {26Path *upgrade.Path27
28ControlPlaneEndpoint string29LogOutput io.Writer30PrePullImages bool31UpgradeKubelet bool32DryRun bool33EncoderOpt encoder.Option34
35KubeletImage string36APIServerImage string37ControllerManagerImage string38SchedulerImage string39ProxyImage string40
41controlPlaneNodes []string42workerNodes []string43}
44
45// Log writes the line to logger or to stdout if no logger was provided.
46func (options *UpgradeOptions) Log(line string, args ...interface{}) {47if options.LogOutput != nil {48options.LogOutput.Write([]byte(fmt.Sprintf(line, args...))) //nolint:errcheck49
50return51}52
53fmt.Printf(line+"\n", args...)54}
55