func NewDeployment(ctx context.Context, namespace, name, image string, port int32) *appsv1.Deployment {
	deployment := &appsv1.Deployment{
		TypeMeta: metav1.TypeMeta{
			Kind: "Deployment",
		},
		ObjectMeta: metav1.ObjectMeta{
			Name:      name,
			Namespace: namespace,
			Labels:    labels(name),
		},
		Spec: appsv1.DeploymentSpec{
			Selector: &metav1.LabelSelector{
				MatchLabels: labels(name),
			},
			Replicas: int32P(1),
			Template: corev1.PodTemplateSpec{
				ObjectMeta: metav1.ObjectMeta{
					Labels: labels(name),
				},
				Spec: corev1.PodSpec{
					Containers: []corev1.Container{
						{
							Image:           image,
							Name:            name,
							ImagePullPolicy: "Always",
							Ports: []corev1.ContainerPort{
								{
									ContainerPort: port,
								},
							},
							Env: []corev1.EnvVar{
								{
									Name:  "ENV",
									Value: "cscaler",
								},
							},
						},
					},
				},
			},
		},
	}
	return deployment
}
NewDeployment creates a new deployment object in the given namespace
with the given name and the given image. This does not actually create
the deployment in the cluster, it just creates the deployment object
in memory
package k8s
import (
	context "context"
	appsv1 "k8s.io/api/apps/v1"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	k8sappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
)
func DeleteDeployment(ctx context.Context, name string, cl k8sappsv1.DeploymentInterface) error {
	return cl.Delete(ctx, name, metav1.DeleteOptions{})
}