tlscert

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PatchCABundleOnMutatingWebhooks added in v0.5.0

func PatchCABundleOnMutatingWebhooks(ctx context.Context, logger log.Logger, kubeClient kubernetes.Interface, namespace string, caPEM []byte) error

PatchCABundleOnMutatingWebhooks patches the CA bundle of all mutating webhook configurations that have the specified labels in the cluster. Webhook configurations should have the following labels: "grafana.com/inject-rollout-operator-ca": "true", "grafana.com/namespace": <specified namespace>,

func PatchCABundleOnValidatingWebhooks

func PatchCABundleOnValidatingWebhooks(ctx context.Context, logger log.Logger, kubeClient kubernetes.Interface, namespace string, caPEM []byte) error

PatchCABundleOnValidatingWebhooks patches the CA bundle of all validating webhook configurations that have the specified labels in the cluster. Webhook configurations should have the following labels: "grafana.com/inject-rollout-operator-ca": "true", "grafana.com/namespace": <specified namespace>,

Types

type Certificate

type Certificate struct {
	// CA might be empty for non self-signed certificates.
	CA []byte

	// Cert is the certificate.
	Cert []byte
	Key  []byte
}

type FileCertProvider

type FileCertProvider struct {
	Cert []byte
	Key  []byte
}

func NewFileCertProvider

func NewFileCertProvider(certFile, keyFile string) (FileCertProvider, error)

NewFileCertProvider creates a new certificate provider that reads the certificate and key from the given files.

func (FileCertProvider) Certificate

func (cp FileCertProvider) Certificate(context.Context) (Certificate, error)

type KubeSecretPersistedCertProvider

type KubeSecretPersistedCertProvider struct {
	// contains filtered or unexported fields
}

func NewKubeSecretPersistedCertProvider

func NewKubeSecretPersistedCertProvider(provider Provider, logger log.Logger, kubeClient kubernetes.Interface, namespace, secretName string) KubeSecretPersistedCertProvider

NewKubeSecretPersistedCertProvider returns a new Provider that wraps another Provider and persists the certificate in a Kubernetes secret.

func (KubeSecretPersistedCertProvider) Certificate

type Provider

type Provider interface {
	Certificate(context.Context) (Certificate, error)
}

A Provider either provides or creates certificates.

type SelfSignedProvider

type SelfSignedProvider struct {
	// contains filtered or unexported fields
}

func NewSelfSignedCertProvider

func NewSelfSignedCertProvider(commonName string, dnsNames []string, orgs []string, expiration time.Duration) SelfSignedProvider

NewSelfSignedCertProvider creates a new certificate provider that creates a self-signed certificate.

func (SelfSignedProvider) Certificate

Jump to

Keyboard shortcuts

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