tool

package
v0.0.0-...-6994bf7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BootTypeLocal   = "local"
	BootTypeRecover = "recover"
	BootTypeCoord   = "coordinator"
	BootTypeJoin    = "manager"
)
View Source
const NODE_MASTER_LABEL = "host-role.kubernetes.io/master"

Variables

View Source
var (
	CA          = "ca"
	ETCD_PEER   = "etcd.peer"
	ETCD_CLIENT = "etcd.client"
)
View Source
var AUTH_FILE = "/etc/kubernetes/admin.conf"
View Source
var KubeConfigTpl = `` /* 473-byte string literal not displayed */

Functions

func AddHostResolve

func AddHostResolve(doman, ip string) error

func ApplyYaml

func ApplyYaml(data string, name string) error

ApplyYaml run kubectl --kubeconfig /etc/kubernetes/admin.local apply -f /tmp/cfg.yaml NOT concurrentable

func ApplyYamlCommon

func ApplyYamlCommon(data, authf, tmp string) error

func DefaultImage

func DefaultImage(id string) string

func FileExist

func FileExist(file string) (bool, error)

func GetDNSIP

func GetDNSIP(subnet string, index int) (net.IP, error)

func Kubectl

func Kubectl(args ...string) ([]string, error)

func NewConfig

func NewConfig(
	cid, ip string,
	ca, crt, key []byte,
) clientcmdapi.Config

func NodeArray

func NodeArray(ns map[string]*corev1.Node) []string

func NodeIsMaster

func NodeIsMaster(node *corev1.Node) bool

func PrettyJson

func PrettyJson(obj interface{}) string

func PrettyYaml

func PrettyYaml(obj interface{}) string

func RandomID

func RandomID(strlen int) string

func RenderConfig

func RenderConfig(
	tplName string,
	tpl string,
	data interface{},
) (string, error)

func UnknownCondition

func UnknownCondition(condition []corev1.NodeCondition) bool

func Write

func Write(config clientcmdapi.Config) ([]byte, error)

Types

type Errors

type Errors []error

func (Errors) Error

func (e Errors) Error() string

func (Errors) HasError

func (e Errors) HasError() error

type RenderParam

type RenderParam struct {
	AuthCA      string
	Address     string
	Port        string
	ClientCRT   string
	ClientKey   string
	ClusterName string
	UserName    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL