// NewPods returns executor that removes old Kubernetes pods.
//
// All Kubernetes pods have to be recreated when the cluster comes up after
// reconfiguration to ensure that no old pods are lingering (Kubernetes may
// get confused after the old node is gone and keep pods in terminating state
// for a long time) and that they mount proper service tokens.
NewPods returns executor that removes old Kubernetes pods.

All Kubernetes pods have to be recreated when the cluster comes up after
reconfiguration to ensure that no old pods are lingering (Kubernetes may
get confused after the old node is gone and keep pods in terminating state
for a long time) and that they mount proper service tokens.
// NewPods returns executor that removes old Kubernetes pods . // // All Kubernetes pods have to be recreated when the cluster comes up after // reconfiguration to ensure that no old pods are lingering ( Kubernetes may // get confused after the old node is gone and keep pods in terminating state // for a long time ) and that they mount proper service tokens .
func NewPods(p fsm.ExecutorParams, operator ops.Operator) (*podsExecutor, error) {
	logger := &fsm.Logger{
		FieldLogger: logrus.WithField(constants.FieldPhase, p.Phase.ID),
		Key:         p.Key(),
		Operator:    operator,
		Server:      p.Phase.Data.Server,
	}
	client, _, err := httplib.GetClusterKubeClient(p.Plan.DNSConfig.Addr())
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return &podsExecutor{
		FieldLogger:    logger,
		ExecutorParams: p,
		Client:         client,
	}, nil
}
func NewPods ( p fsm . ExecutorParams , operator ops . Operator ) ( * podsExecutor , error ) { logger := & fsm . Logger { FieldLogger : logrus . WithField ( constants . FieldPhase , p . Phase . ID ) , Key : p . Key ( ) , Operator : operator , Server : p . Phase . Data . Server , } client , _ , err := httplib . GetClusterKubeClient ( p . Plan . DNSConfig . Addr ( ) ) if err != nil { return nil , trace . Wrap ( err ) } return & podsExecutor { FieldLogger : logger , ExecutorParams : p , Client : client , } , nil }
NewPods returns executor that removes old Kubernetes pods.
NewPods returns executor that removes old Kubernetes pods .