migration

package
v1.18.9 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBindingForKubeSystemNode

func AddBindingForKubeSystemNode(crb *rbacv1.ClusterRoleBinding)

AddBindingForKubeSystemNode updates the ClusterRoleBinding passed in to also bind the service account in the kube-system namespace to the Role. Without this, when the new ClusterRoleBinding overwrites the previous role binding the kube-system calico-node account would lose permissions for accessing the datastore.

func LimitDaemonSetToMigratedNodes

func LimitDaemonSetToMigratedNodes(ds *appsv1.DaemonSet)

LimitDaemonSetToMigratedNodes updates the ds DaemonSet passed in with a nodeSelector that will only allow pods to be schedueled on nodes with the key:value projectcalico.org/operator-node-migration:migrated. This is to ensure that only one kube-system calico-node or the new calico-node pod will attempt to run on one node at a time.

func SetTyphaAntiAffinity

func SetTyphaAntiAffinity(d *appsv1.Deployment)

SetTyphaAntiAffinity updates the Deployment passed in with a PodAntiAffinity to ensure the new typha pods will not be scheduled to the same nodes as the 'old' typha pods.

Types

type Converter added in v1.12.0

type Converter interface {
	Convert() (*operatorv1.Installation, error)
}

Converter converts an unmanaged Calico install into an Installation resource which represents said install. It will return an error if the unmanaged install cannot be represented by an Installation resource.

type CoreNamespaceMigration

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

func (*CoreNamespaceMigration) CleanupMigration

func (m *CoreNamespaceMigration) CleanupMigration(ctx context.Context) error

CleanupMigration ensures all labels used during the migration are removed and any migration resources are stopped.

func (*CoreNamespaceMigration) NeedCleanup

func (m *CoreNamespaceMigration) NeedCleanup() bool

NeedCleanup returns if the migration has been marked completed or not. If cleanup is needed then we need to make sure that all our labels have been removed from the nodes. We could check if the label is present on any nodes but it is almost the same operation to call the remove so we'll assume there are labels if we have not removed them previously.

func (*CoreNamespaceMigration) NeedsCoreNamespaceMigration

func (m *CoreNamespaceMigration) NeedsCoreNamespaceMigration(ctx context.Context) (bool, error)

NeedsCoreNamespaceMigration returns true if any components still exist in the kube-system namespace. It checks the following in the kube-system namespace: calico-kube-controllers deployment, typha deployment, or calico-node deployment

func (*CoreNamespaceMigration) Run

Run will update old deployments and daemonsets, label nodes, migrate the calio-node pods on each node from the old pod to the new one, then clean up. The expectation is that this function will do the majority of the migration before returning (the exception being label clean up on the nodes), if there is an error it will be returned and the

type NamespaceMigration added in v1.14.0

type NamespaceMigration interface {
	NeedsCoreNamespaceMigration(ctx context.Context) (bool, error)
	Run(ctx context.Context, log logr.Logger) error
	NeedCleanup() bool
	CleanupMigration(ctx context.Context) error
}

func NewCoreNamespaceMigration

func NewCoreNamespaceMigration(cfg *rest.Config) (NamespaceMigration, error)

NewCoreNamespaceMigration initializes a CoreNamespaceMigration and returns a handle to it.

type StringPatch

type StringPatch struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

Directories

Path Synopsis
package convert reads config from existing Calico installations that are not managed by Operator, and generates Operator Config that can be used to configure a similar cluster.
package convert reads config from existing Calico installations that are not managed by Operator, and generates Operator Config that can be used to configure a similar cluster.
numorstring
package numorstring is copied from libcalico-go so that we can convert felix env vars which map to felixconfiguration fields of type numorstring.
package numorstring is copied from libcalico-go so that we can convert felix env vars which map to felixconfiguration fields of type numorstring.

Jump to

Keyboard shortcuts

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