func CreateCert(client clientset.Interface, pkiPath string) error {
	caCert, caKey, err := pkiutil.TryLoadCertAndKeyFromDisk(pkiPath, constants.CACertAndKeyBaseName)
	if err != nil {
		return errors.Wrap(err, "unable to load kubernetes CA certificate and key")
	}
	cert, key, err := util.NewServerCertAndKey(caCert, caKey, certCommonName, []string{})
	if err != nil {
		return errors.Wrap(err, "could not genenerate metrics-server server cert")
	}
	if err := util.CreateOrUpdateCertToSecret(client, caCert, cert, key, secretCertName); err != nil {
		return errors.Wrap(err, "unable to create/update cert to secret")
	}
	return nil
}
CreateCert creates a signed certificate for metrics-server
with kubernetes CA certificate and key
package metricsserver
import (
	"context"
	"github.com/pkg/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	clientset "k8s.io/client-go/kubernetes"
	"k8s.io/kubernetes/cmd/kubeadm/app/constants"
	"k8s.io/kubernetes/cmd/kubeadm/app/util/pkiutil"
	"github.com/SUSE/skuba/internal/pkg/skuba/kubernetes"
	"github.com/SUSE/skuba/internal/pkg/skuba/util"
)
const (
	certCommonName = "metrics-server.kube-system.svc"  
	secretCertName = "metrics-server-cert"
)