kind: sigs.k8s.io/kind/pkg/build/node/internal/kube Index | Files

package kube

import "sigs.k8s.io/kind/pkg/build/node/internal/kube"

Package kube implements functionality to build Kubernetes for the purposes of installing into the kind node image

Index

Package Files

bazelbuildbits.go bits.go doc.go dockerbuildbits.go source.go version.go

Constants

const ImportPath = "k8s.io/kubernetes"

ImportPath is the canonical import path for the kubernetes root package this is used by FindSource

func FindSource Uses

func FindSource() (root string, err error)

FindSource attempts to locate a kubernetes checkout using go's build package

type BazelBuildBits Uses

type BazelBuildBits struct {
    // contains filtered or unexported fields
}

BazelBuildBits implements Bits for a local Bazel build

func (*BazelBuildBits) Build Uses

func (b *BazelBuildBits) Build() error

Build implements Bits.Build

func (*BazelBuildBits) ImagePaths Uses

func (b *BazelBuildBits) ImagePaths() []string

ImagePaths implements Bits.ImagePaths

func (*BazelBuildBits) Install Uses

func (b *BazelBuildBits) Install(install InstallContext) error

Install implements Bits.Install

func (*BazelBuildBits) Paths Uses

func (b *BazelBuildBits) Paths() map[string]string

Paths implements Bits.Paths

type Bits Uses

type Bits interface {
    // Build returns any errors encountered while building it Kubernetes.
    // Some implementations (upstream binaries) may use this step to obtain
    // an existing build instead
    Build() error
    // Paths returns a map of path on host machine to desired path in the image
    // These paths will be populated in the image relative to some base path,
    // obtainable by NodeInstall.BasePath()
    Paths() map[string]string
    // ImagePaths returns a list of paths to image archives to be loaded into
    // the Node
    ImagePaths() []string
    // Install should install the built sources on the node, assuming paths
    // have been populated
    // TODO(bentheelder): eliminate install, make install file-copies only,
    // support cross-building
    Install(InstallContext) error
}

Bits provides the locations of Kubernetes Binaries / Images needed on the cluster nodes Implementations should be registered with RegisterNamedBits

func NewBazelBuildBits Uses

func NewBazelBuildBits(logger log.Logger, kubeRoot, arch string) (bits Bits, err error)

NewBazelBuildBits returns a new Bits backed by bazel build, given kubeRoot, the path to the kubernetes source directory

func NewDockerBuildBits Uses

func NewDockerBuildBits(logger log.Logger, kubeRoot, arch string) (bits Bits, err error)

NewDockerBuildBits returns a new Bits backed by the docker-ized build, given kubeRoot, the path to the kubernetes source directory

func NewNamedBits Uses

func NewNamedBits(logger log.Logger, name, kubeRoot, arch string) (bits Bits, err error)

NewNamedBits returns a new Bits by named implementation currently this includes: "apt" -> NewAptBits(kubeRoot) "bazel" -> NewBazelBuildBits(kubeRoot) "docker" or "make" -> NewDockerBuildBits(kubeRoot)

type DockerBuildBits Uses

type DockerBuildBits struct {
    // contains filtered or unexported fields
}

DockerBuildBits implements Bits for a local docker-ized make / bash build

func (*DockerBuildBits) Build Uses

func (b *DockerBuildBits) Build() error

Build implements Bits.Build

func (*DockerBuildBits) ImagePaths Uses

func (b *DockerBuildBits) ImagePaths() []string

ImagePaths implements Bits.ImagePaths

func (*DockerBuildBits) Install Uses

func (b *DockerBuildBits) Install(install InstallContext) error

Install implements Bits.Install

func (*DockerBuildBits) Paths Uses

func (b *DockerBuildBits) Paths() map[string]string

Paths implements Bits.Paths

type InstallContext Uses

type InstallContext interface {
    // Returns the base path Paths() were populated relative to
    BasePath() string
    // Run execs (cmd, ...args) in the build container and returns error
    Run(string, ...string) error
    // CombinedOutputLines is like Run but returns the output lines
    CombinedOutputLines(string, ...string) ([]string, error)
}

InstallContext should be implemented by users of Bits to allow installing the bits in a Docker image

Package kube imports 10 packages (graph) and is imported by 2 packages. Updated 2019-12-10. Refresh now. Tools for package owners.