func (f *Framework) CreateReplicationController(namespace string, replicationcontroller *corev1.ReplicationController) error {
	if _, err := f.KubeClient.CoreV1().ReplicationControllers(namespace).Create(context.TODO(), replicationcontroller, metav1.CreateOptions{}); err != nil {
		return err
	}
	if err := f.WaitForReplicationController(replicationcontroller.Name, namespace, time.Minute); err != nil {
		return err
	}
	f.WaitForReplicationControllerPods(replicationcontroller.Name, namespace, time.Second*45)
	return nil
}
CreateReplicationController creates a replication controller and waits for it to show.
package framework
import (
	"context"
	"fmt"
	"time"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/apimachinery/pkg/util/yaml"
)
func (f *Framework) LoadReplicationControllerManifest(pathToManifest string) (*corev1.ReplicationController, error) {
	manifest, err := openFile(pathToManifest)
	if err != nil {
		return nil, fmt.Errorf("Unable to open file %q: %v", pathToManifest, err)
	}
	replicationcontroller := corev1.ReplicationController{}
	if err := yaml.NewYAMLOrJSONDecoder(manifest, 100).Decode(&replicationcontroller); err != nil {
		return nil, fmt.Errorf("Unable to decode file %q: %v", pathToManifest, err)
	}
	return &replicationcontroller, nil
}