Documentation ¶
Index ¶
- Constants
- func AddClusterAPICRDs(b *plan.Builder, fs http.FileSystem) ([]string, error)
- func ApplyPlan(ctx context.Context, o *OS, p *plan.Plan) error
- func ConfigureFlux(b *plan.Builder, params SeedNodeParams) error
- func CreateAssetConfigMap(eic *existinginfrav1.ExistingInfraCluster, namespace string, ...) (*v1.ConfigMap, error)
- func CreateClusterConfigMap(eic *existinginfrav1.ExistingInfraCluster, namespace string) *v1.ConfigMap
- func CreateConfigFileResourcesFromConfigMaps(fileSpecs []existinginfrav1.FileSpec, configMaps map[string]*v1.ConfigMap) ([]*resource.File, error)
- func CreateConfigFileResourcesFromFileSpecs(fileSpecs []existinginfrav1.FileSpec) ([]*resource.File, error)
- func CreatePlan(b *plan.Builder) (*plan.Plan, error)
- func CreateSeedNodeSetupPlan(ctx context.Context, o *OS, params SeedNodeParams) (*plan.Plan, error)
- func FindDaemonSet(manifest *v1.List) (int, *appsv1.DaemonSet, error)
- func GetAPIServerArgs(providerSpec *existinginfrav1.ClusterSpec) map[string]string
- func InjectEnvVarToContainer(containers []v1.Container, name string, newEnvVar v1.EnvVar) error
- func SetWeaveNetPodCIDRBlock(manifests [][]byte, podsCIDRBlock string) ([][]byte, error)
- func SetupSeedNode(ctx context.Context, o *OS, params SeedNodeParams) error
- func StoreIfNotEmpty(vals map[string]string, key, value string)
- func UpdateControllerImage(manifest []byte, controllerImageOverride string) ([]byte, error)
- func WksControllerManifest(imageOverride, namespace string) ([]byte, error)
- type AuthParams
- type CRDFile
- type ControllerParams
- type GitParams
- type MachineInfo
- type NodeParams
- type OS
- type SecretResourceSpec
- type SeedNodeParams
Constants ¶
const ( LocalCluster = "wks.weave.works/local-cluster" Created = "wks.weave.works/is-created" PemDestDir = "/etc/pki/weaveworks/wksctl/pem" ConfigDestDir = "/etc/pki/weaveworks/wksctl" )
TODO replace wksctl with a more generic term
const ( CentOS = "centos" Ubuntu = "ubuntu" RHEL = "rhel" )
Variables ¶
This section is empty.
Functions ¶
func AddClusterAPICRDs ¶ added in v0.0.4
func ConfigureFlux ¶ added in v0.0.4
func ConfigureFlux(b *plan.Builder, params SeedNodeParams) error
func CreateAssetConfigMap ¶ added in v0.2.1
func CreateAssetConfigMap(eic *existinginfrav1.ExistingInfraCluster, namespace string, assetDescriptions map[string]kubeadm.AssetDescription) (*v1.ConfigMap, error)
func CreateClusterConfigMap ¶ added in v0.0.7
func CreateClusterConfigMap(eic *existinginfrav1.ExistingInfraCluster, namespace string) *v1.ConfigMap
func CreateConfigFileResourcesFromFileSpecs ¶ added in v0.0.4
func CreateConfigFileResourcesFromFileSpecs(fileSpecs []existinginfrav1.FileSpec) ([]*resource.File, error)
func CreatePlan ¶
CreatePlan generates a plan from a plan builder
func CreateSeedNodeSetupPlan ¶ added in v0.0.4
CreateSeedNodeSetupPlan constructs the seed node plan used to setup the initial node prior to turning control over to wks-controller
func FindDaemonSet ¶ added in v0.0.4
Returns a daemonset manifest from a list
func GetAPIServerArgs ¶ added in v0.0.4
func GetAPIServerArgs(providerSpec *existinginfrav1.ClusterSpec) map[string]string
func InjectEnvVarToContainer ¶ added in v0.0.4
Finds container in the list by name, adds an env var, fails if env var exists with different value
func SetWeaveNetPodCIDRBlock ¶ added in v0.0.4
Sets the pod CIDR block in the weave-net manifest
func SetupSeedNode ¶ added in v0.0.4
func SetupSeedNode(ctx context.Context, o *OS, params SeedNodeParams) error
SetupSeedNode installs Kubernetes on this machine, and store the provided manifests in the API server, so that the rest of the cluster can then be set up by the WKS controller.
func StoreIfNotEmpty ¶ added in v0.0.4
func UpdateControllerImage ¶ added in v0.0.4
updateControllerImage replaces the controller image in the manifest and returns the updated manifest
func WksControllerManifest ¶ added in v0.0.4
Types ¶
type AuthParams ¶ added in v0.0.4
type AuthParams struct { PEMSecretResources map[string]*SecretResourceSpec AuthConfigMap *v1.ConfigMap AuthConfigManifest []byte }
AuthParams are parameters used to configure authn and authz for the cluster
type ControllerParams ¶ added in v0.0.4
type ControllerParams struct { // ImageOverride will override the WKS controller image if set. It will do so // whether the controller manifest comes from a git repository or is the // built-in one. ImageOverride string // ImageBuiltin is the WKS controller image to use when generating the WKS // controller manifest from in-memory data. ImageBuiltin string // Namespace in which the controller runs Namespace string }
ControllerParams are all SeedNodeParams related to the WKS controller
type GitParams ¶ added in v0.0.4
GitParams are all SeedNodeParams related to the user's Git(Hub) repo
type MachineInfo ¶ added in v0.0.4
type MachineInfo struct { SSHUser string `json:"sshUser"` SSHKey string `json:"sshKey"` PublicIP string `json:"publicIP"` PublicPort string `json:"publicPort"` PrivateIP string `json:"privateIP"` PrivatePort string `json:"privatePort"` }
MachineInfo holds connection information (key, ips, ports) about a machine
type NodeParams ¶
type NodeParams struct { IsMaster bool // true if this node is a master, false else. MasterIP string MasterPort int Token string // kubeadm's --token DiscoveryTokenCaCertHash string // kubeadm's --discovery-token-ca-cert-hash CertificateKey string // kubeadm's --certificate-key KubeletConfig config.KubeletConfig KubernetesVersion string CRI existinginfrav1.ContainerRuntime CNI string ConfigFileSpecs []existinginfrav1.FileSpec ProviderConfigMaps map[string]*v1.ConfigMap AuthConfigMap *v1.ConfigMap Secrets map[string]resource.SecretData // kind of auth -> names/values as-in v1.Secret Namespace string ControlPlaneEndpoint string // used instead of MasterIP if existed AddonNamespaces map[string]string AssetDescriptions map[string]kubeadm.AssetDescription Flavor existinginfrav1.ClusterFlavor }
NodeParams groups required inputs to configure a Kubernetes node.
func (NodeParams) Validate ¶
func (params NodeParams) Validate() error
Validate generally validates this NodeParams struct, e.g. ensures it contains mandatory values, that these are well-formed, etc.
type OS ¶
OS represents an operating system and exposes the operations required to install Kubernetes on a machine setup with that OS.
func Identify ¶
Identify uses the provided SSH client to identify the operating system of the machine it is configured to talk to.
func (OS) CreateNodeSetupPlan ¶
CreateNodeSetupPlan creates the plan that will be used to set up a node.
type SecretResourceSpec ¶ added in v0.0.4
type SecretResourceSpec struct { SecretName string Decrypted resource.SecretData Resource plan.Resource }
type SeedNodeParams ¶ added in v0.0.4
type SeedNodeParams struct { PublicIP string PrivateIP string ServicesCIDRBlocks []string PodsCIDRBlocks []string ExistingInfraCluster existinginfrav1.ExistingInfraCluster ClusterManifest string MachinesManifest string ConnectionInfo []MachineInfo // BootstrapToken is the token used by kubeadm init and kubeadm join // to safely form new clusters. BootstrapToken *kubeadmapi.BootstrapTokenString KubeletConfig config.KubeletConfig Controller ControllerParams GitData GitParams AuthInfo *AuthParams SealedSecretKey string SealedSecretCert string ConfigDirectory string Namespace string ImageRepository string ControlPlaneEndpoint string AdditionalSANs []string AddonNamespaces map[string]string AssetDescriptions map[string]kubeadm.AssetDescription Flavor existinginfrav1.ClusterFlavor }
SeedNodeParams groups required inputs to configure a "seed" Kubernetes node.
func (SeedNodeParams) Validate ¶ added in v0.0.4
func (params SeedNodeParams) Validate() error
Validate generally validates this SeedNodeParams struct, e.g. ensures it contains mandatory values, that these are well-formed, etc.