resources

package
v1.21.0-alpha.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCluster

func DeleteCluster(name string, clientset simple.Clientset) error

Types

type ApplyOptions

type ApplyOptions struct {
	// Skip allows skipping cluster apply
	Skip bool
	// AllowKopsDowngrade permits applying with a kops version older than what was last used to apply to the cluster
	AllowKopsDowngrade bool
}

type Cluster

type Cluster struct {
	kops.ClusterSpec
	// Revision is incremented every time the resource changes, this is useful for triggering cluster updater
	Revision int
	// Name defines the cluster name
	Name string
	// AdminSshKey defines the cluster admin ssh key
	AdminSshKey string
	// Secrets defines the cluster secret
	Secrets *ClusterSecrets
}

Cluster defines the configuration for a cluster

func CreateCluster

func CreateCluster(name, adminSshKey string, secrets *ClusterSecrets, spec kops.ClusterSpec, clientset simple.Clientset) (*Cluster, error)

func GetCluster

func GetCluster(name string, clientset simple.Clientset) (*Cluster, error)

func UpdateCluster

func UpdateCluster(name, adminSshKey string, secrets *ClusterSecrets, spec kops.ClusterSpec, clientset simple.Clientset) (*Cluster, error)

type ClusterSecrets

type ClusterSecrets struct {
	// DockerConfig holds a valid docker config.
	// After creating a dockerconfig secret, a /root/.docker/config.json file will be added to newly created nodes.
	// This file will be used by Kubernetes to authenticate to container registries and will also work when using containerd as container runtime.
	DockerConfig string
}

ClusterSecrets defines cluster secrets

func CreateOrUpdateClusterSecrets

func CreateOrUpdateClusterSecrets(secretStore fi.SecretStore, secrets *ClusterSecrets) (*ClusterSecrets, error)

func GetClusterSecrets

func GetClusterSecrets(secretStore fi.SecretStore) (*ClusterSecrets, error)

type ClusterUpdater

type ClusterUpdater struct {
	// Revision is incremented every time the resource changes, this is useful for triggering cluster updater
	Revision int
	// ClusterName is the target cluster name
	ClusterName string
	// Keepers contains arbitrary strings used to update the resource when one changes
	Keepers map[string]string
	// Apply holds cluster apply options
	Apply ApplyOptions
	// RollingUpdate holds cluster rolling update options
	RollingUpdate RollingUpdateOptions
	// Validate holds cluster validation options
	Validate ValidateOptions
}

ClusterUpdater takes care of applying changes and/or rolling update the cluster when needed

func (*ClusterUpdater) UpdateCluster

func (u *ClusterUpdater) UpdateCluster(clientset simple.Clientset) error

type InstanceGroup

type InstanceGroup struct {
	kops.InstanceGroupSpec
	// Revision is incremented every time the resource changes, this is useful for triggering cluster updater
	Revision int
	// ClusterName defines the cluster name the instance group belongs to
	ClusterName string
	// Name defines the instance group name
	Name string
}

InstanceGroup represents a group of instances (either bastions, nodes or masters) with the same configuration

func CreateInstanceGroup

func CreateInstanceGroup(clusterName, name string, spec kops.InstanceGroupSpec, clientset simple.Clientset) (*InstanceGroup, error)

func GetInstanceGroup

func GetInstanceGroup(clusterName, name string, clientset simple.Clientset) (*InstanceGroup, error)

func UpdateInstanceGroup

func UpdateInstanceGroup(clusterName, name string, spec kops.InstanceGroupSpec, clientset simple.Clientset) (*InstanceGroup, error)

type RollingUpdateOptions

type RollingUpdateOptions struct {
	// Skip allows skipping cluster rolling update
	Skip bool
	utils.RollingUpdateOptions
}

type ValidateOptions

type ValidateOptions struct {
	// Skip allows skipping cluster validation
	Skip bool
	utils.ValidateOptions
}

Jump to

Keyboard shortcuts

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