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 ¶
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 CoreNamespaceMigration ¶
type CoreNamespaceMigration struct {
// contains filtered or unexported fields
}
func NewCoreNamespaceMigration ¶
func NewCoreNamespaceMigration(cfg *rest.Config) (*CoreNamespaceMigration, error)
NewCoreNamespaceMigration initializes a CoreNamespaceMigration and returns a handle to it.
func (*CoreNamespaceMigration) CleanupMigration ¶
func (m *CoreNamespaceMigration) CleanupMigration() 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() (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 ¶
func (m *CoreNamespaceMigration) Run(log logr.Logger) error
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