v_6_0_0

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const MasterTemplate = `` /* 24452-byte string literal not displayed */
View Source
const WorkerTemplate = `` /* 13723-byte string literal not displayed */

Variables

This section is empty.

Functions

func GetIgnitionPath

func GetIgnitionPath(ignitionDir string) string

GetIgnitionPath returns path for the ignition assets based on base ignition directory and package subdirectory with assets.

func GetPackagePath

func GetPackagePath() (string, error)

GetPackagePath returns top package path for the current runtime file. For example, for /go/src/k8scloudconfig/v_4_1_0/file.go function returns /go/src/k8scloudconfig. This function used only in tests for retrieving ignition assets in runtime.

func IsComponentNotFound

func IsComponentNotFound(err error) bool

IsComponentNotFound asserts componentNotFoundError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func RenderAssetContent

func RenderAssetContent(assetContent string, params interface{}) ([]string, error)

func RenderFileAssetContent

func RenderFileAssetContent(assetContent string, params interface{}) (string, error)

RenderFileAssetContent returns base64 representation of the rendered assetContent.

Types

type CloudConfig

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

func NewCloudConfig

func NewCloudConfig(config CloudConfigConfig) (*CloudConfig, error)

func (*CloudConfig) Base64

func (c *CloudConfig) Base64() string

func (*CloudConfig) ExecuteTemplate

func (c *CloudConfig) ExecuteTemplate() error

func (*CloudConfig) String

func (c *CloudConfig) String() string

type CloudConfigConfig

type CloudConfigConfig struct {
	Params   Params
	Template string
}

func DefaultCloudConfigConfig

func DefaultCloudConfigConfig() CloudConfigConfig

type Debug

type Debug struct {
	Enabled    bool
	LogsPrefix string
	LogsToken  string
}

type Extension

type Extension interface {
	Files() ([]FileAsset, error)
	Units() ([]UnitAsset, error)
	VerbatimSections() []VerbatimSection
}

type FileAsset

type FileAsset struct {
	Metadata FileMetadata
	Content  string
}

type FileMetadata

type FileMetadata struct {
	AssetContent string
	Path         string
	Owner        Owner
	Compression  bool
	Permissions  int
}

type Files

type Files map[string]string

Files is map[string]string (k: filename, v: contents) for files that are fetched from disk and then filled with data.

func RenderFiles

func RenderFiles(filesdir string, ctx interface{}) (Files, error)

RenderFiles walks over filesdir and parses all regular files with text/template. Parsed templates are then rendered with ctx, base64 encoded and added to returned Files.

filesdir must not contain any other files than templates that can be parsed with text/template.

type Group

type Group struct {
	ID   int
	Name string
}

Group object reflects spec for ignition Group object. If both ID and name are specified, ID is preferred.

type Hyperkube

type Hyperkube struct {
	Apiserver         HyperkubeApiserver
	ControllerManager HyperkubeControllerManager
	Kubelet           HyperkubeKubelet
}

type HyperkubeApiserver

type HyperkubeApiserver struct {
	Pod HyperkubePod
}

type HyperkubeControllerManager

type HyperkubeControllerManager struct {
	Pod HyperkubePod
}

type HyperkubeDocker

type HyperkubeDocker struct {
	RunExtraArgs     []string
	CommandExtraArgs []string
}

type HyperkubeKubelet

type HyperkubeKubelet struct {
	Docker HyperkubeDocker
}

type HyperkubePod

type HyperkubePod struct {
	HyperkubePodHostExtraMounts []HyperkubePodHostMount
	CommandExtraArgs            []string
}

type HyperkubePodHostMount

type HyperkubePodHostMount struct {
	Name     string
	Path     string
	ReadOnly bool
}

type Images

type Images struct {
	CalicoCNI                    string
	CalicoKubeControllers        string
	CalicoNode                   string
	Etcd                         string
	Hyperkube                    string
	Kubectl                      string
	KubernetesAPIHealthz         string
	KubernetesNetworkSetupDocker string
}

func BuildImages

func BuildImages(registryDomain string, versions Versions) Images

type Owner

type Owner struct {
	Group Group
	User  User
}

type Params

type Params struct {
	// APIServerEncryptionKey is AES-CBC with PKCS#7 padding key to encrypt API
	// etcd data.
	APIServerEncryptionKey string
	BaseDomain             string
	Cluster                v1alpha1.Cluster
	// Debug options
	Debug Debug
	// DisableCalico flag. When set removes all calico related Kubernetes
	// manifests from the cloud config together with their initialization.
	DisableCalico bool
	// DisableEncryptionAtREST flag. When set removes all manifests from the cloud
	// config related to Kubernetes encryption at REST.
	DisableEncryptionAtREST bool
	// DisableIngressControllerService flag. When set removes the manifest for
	// the Ingress Controller service. This allows us to migrate providers to
	// chart-operator independently.
	DisableIngressControllerService bool
	// Hyperkube allows to pass extra `docker run` and `command` arguments
	// to hyperkube image commands. This allows to e.g. add cloud provider
	// extensions.
	Hyperkube Hyperkube
	// EtcdPort allows the Etcd port to be specified.
	// aws-operator sets this to the Etcd listening port so Calico on the
	// worker nodes can access via a CNAME record to the master.
	EtcdPort  int
	Extension Extension
	// ExtraManifests allows to specify extra Kubernetes manifests in
	// /opt/k8s-addons script. The manifests are applied after calico is
	// ready.
	//
	// The general use-case is to create a manifest file with Extension and
	// then apply the manifest by adding it to ExtraManifests.
	ExtraManifests []string
	Files          Files
	// ImagePullProgressDeadline is the duration after which image pulling is
	// cancelled if no progress has been made.
	ImagePullProgressDeadline string
	// Container images used in the cloud-config templates
	Images       Images
	Node         v1alpha1.ClusterNode
	SSOPublicKey string
}

func DefaultParams

func DefaultParams() Params

func (*Params) Validate

func (p *Params) Validate() error

type UnitAsset

type UnitAsset struct {
	Metadata UnitMetadata
	Content  []string
}

type UnitMetadata

type UnitMetadata struct {
	AssetContent string
	Name         string
	Enabled      bool
}

type User

type User struct {
	ID   int
	Name string
}

User object reflects spec for ignition User object. If both ID and name are specified, ID is preferred.

type VerbatimSection

type VerbatimSection struct {
	Name    string
	Content string
}

VerbatimSection is a blob of YAML we want to add to the CloudConfig, with no variable interpolation.

type Versions

type Versions struct {
	Calico                       string
	CRITools                     string
	Etcd                         string
	Kubectl                      string
	Kubernetes                   string
	KubernetesAPIHealthz         string
	KubernetesNetworkSetupDocker string
}

func ExtractComponentVersions

func ExtractComponentVersions(releaseComponents []v1alpha1.ReleaseSpecComponent) (Versions, error)

Jump to

Keyboard shortcuts

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