utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DOCKER_IMAGES = []string{
	constants.KeepalivedImage,
	fmt.Sprintf("k8s.gcr.io/kube-apiserver-amd64:%s", constants.KubernetesVersion),
	fmt.Sprintf("k8s.gcr.io/kube-controller-manager-amd64:%s", constants.KubernetesVersion),
	fmt.Sprintf("k8s.gcr.io/kube-scheduler-amd64:%s", constants.KubernetesVersion),
	fmt.Sprintf("k8s.gcr.io/kube-proxy-amd64:%s", constants.KubernetesVersion),
	fmt.Sprintf("k8s.gcr.io/k8s-dns-sidecar-amd64:%s", constants.KubeDNSVersion),
	fmt.Sprintf("k8s.gcr.io/k8s-dns-kube-dns-amd64:%s", constants.KubeDNSVersion),
	fmt.Sprintf("k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:%s", constants.KubeDNSVersion),
	"quay.io/coreos/flannel:v0.10.0-amd64",
	"k8s.gcr.io/pause-amd64:3.1",
	"metallb/speaker:master",
	"metallb/controller:master",
}
View Source
var NodeArtifact = []Artifact{
	{
		Name:     constants.KubeadmFilename,
		Type:     "executable",
		Upstream: fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/amd64/", constants.KubernetesVersion),
		Local:    filepath.Join(constants.CacheDir, constants.KubeDirName),
	},
	{
		Name:     constants.KubectlFilename,
		Type:     "executable",
		Upstream: fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/amd64/", constants.KubernetesVersion),
		Local:    filepath.Join(constants.CacheDir, constants.KubeDirName),
	},
	{
		Name:     constants.KubeletFilename,
		Type:     "executable",
		Upstream: fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/amd64/", constants.KubernetesVersion),
		Local:    filepath.Join(constants.CacheDir, constants.KubeDirName),
	},
	{
		Name:     constants.KubeletSystemdUnitFilename,
		Type:     "regular",
		Upstream: fmt.Sprintf("https://raw.githubusercontent.com/kubernetes/kubernetes/%s/build/debs/", constants.KubernetesVersion),
		Local:    filepath.Join(constants.CacheDir, constants.KubeDirName),
	},
	{
		Name:     constants.KubeadmKubeletSystemdDropinFilename,
		Type:     "regular",
		Upstream: fmt.Sprintf("https://raw.githubusercontent.com/kubernetes/kubernetes/%s/build/debs/", constants.KubernetesVersion),
		Local:    filepath.Join(constants.CacheDir, constants.KubeDirName),
	},
	{
		Name:     constants.CNIPluginsFilename,
		Type:     "regular",
		Upstream: fmt.Sprintf("https://github.com/containernetworking/plugins/releases/download/%s/", constants.CNIVersion),
		Local:    filepath.Join(constants.CacheDir, constants.CNIDirName),
	},
	{
		Name:     constants.FlannelManifestFilename,
		Type:     "regular",
		Upstream: fmt.Sprintf("https://raw.githubusercontent.com/coreos/flannel/%s/Documentation/", constants.FlannelVersion),
		Local:    filepath.Join(constants.CacheDir, constants.FlannelDirName),
	},
}

Functions

func CreateSymLinks(sourceDir, targetDir string, overwriteSymlinks bool)

Create symlinks of all the files inside sourceDir to targetDir

func Download

func Download(fileName string, url string, mode os.FileMode)

func EnableAndStartService

func EnableAndStartService(unitFile string) error

EnableAndStartService enables and starts the etcd service

func GetImages

func GetImages() []string

func InitConfigurationFromFile

func InitConfigurationFromFile(path string) (*apis.InitConfiguration, error)

func InstallMasterComponents

func InstallMasterComponents(config *apis.InitConfiguration)

func InstallNodeComponents

func InstallNodeComponents(config *apis.JoinConfiguration)

func JoinConfigurationFromFile

func JoinConfigurationFromFile(path string) (*apis.JoinConfiguration, error)

func PlaceComponentsFromCache

func PlaceComponentsFromCache(netConfig apis.Networking)

func PopulateCache

func PopulateCache()

func ReplaceString

func ReplaceString(file string, from string, to string)

func ResetFailedService

func ResetFailedService(unitFile string) error

ResetFailedService invokes reset-failed on a service if the service satisfies the is-failed query, otherwise a noop

func StopAndDisableService

func StopAndDisableService(unitFile string) error

StopAndDisableService stops and disables service

Types

type Artifact

type Artifact struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Upstream string `json:"upstream"`
	Local    string `json:"local"`
}

Jump to

Keyboard shortcuts

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