kubeconfig

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDependentCertificateNotFound = errors.New("could not find secret ca")

ErrDependentCertificateNotFound is returned when the kubeconfig cannot be generated because the dependent certificate is not found.

Functions

func CreateSecret

func CreateSecret(ctx context.Context, c client.Client, cluster *clusterv1.Cluster) error

CreateSecret creates the Kubeconfig secret for the given cluster.

func CreateSecretWithOwner

func CreateSecretWithOwner(ctx context.Context, c client.Client, clusterName client.ObjectKey, endpoint string, owner metav1.OwnerReference) error

CreateSecretWithOwner creates the Kubeconfig secret for the given cluster name, namespace, endpoint, and owner reference.

func GenerateSecret

func GenerateSecret(cluster *clusterv1.Cluster, data []byte) *corev1.Secret

GenerateSecret returns a Kubernetes secret for the given Cluster and kubeconfig data.

func GenerateSecretWithOwner

func GenerateSecretWithOwner(clusterName client.ObjectKey, data []byte, owner metav1.OwnerReference) *corev1.Secret

GenerateSecretWithOwner returns a Kubernetes secret for the given Cluster name, namespace, kubeconfig data, and ownerReference.

func New

func New(
	clusterName,
	endpoint string,
	clientCACert *x509.Certificate, clientCAKey crypto.Signer, serverCACert *x509.Certificate,
) (*api.Config, error)

New creates a new Kubeconfig using the cluster name and specified endpoint.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL