Documentation
¶
Index ¶
- Variables
- func Config(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB) (tls.Config, error)
- func GetCertificateSans(cr *api.PerconaServerMongoDB) []string
- func GetDNSNamesFromCert(tlsCertPEM []byte) ([]string, error)
- func IsExternalIssuer(cr *api.PerconaServerMongoDB) bool
- func IsSecretCreatedByUser(ctx context.Context, c client.Client, cr *api.PerconaServerMongoDB, ...) (bool, error)
- func Issue(hosts []string) (caCert []byte, tlsCert []byte, tlsKey []byte, err error)
- func IssueCA() (caCertPEM []byte, caKeyPEM []byte, err error)
- func IssueWithCA(hosts []string, caCertPEM, caKeyPEM []byte) (tlsCert []byte, tlsKey []byte, err error)
- func ManualCASecretName(cr *api.PerconaServerMongoDB) string
- func MergePEM(target []byte, toMerge ...[]byte) ([]byte, error)
- type CertManagerController
- type Certificate
- type NewCertManagerControllerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCertManagerNotFound = errors.New("cert-manager not found") ErrCertManagerNotReady = errors.New("cert-manager not ready") )
Functions ¶
func Config ¶ added in v1.10.0
func Config(ctx context.Context, k8sclient client.Client, cr *api.PerconaServerMongoDB) (tls.Config, error)
Config returns tls.Config to be used in mongo.Config
func GetCertificateSans ¶ added in v1.15.0
func GetCertificateSans(cr *api.PerconaServerMongoDB) []string
func GetDNSNamesFromCert ¶ added in v1.23.0
GetDNSNamesFromCert extracts DNS names from the SANs of a PEM-encoded TLS certificate.
func IsExternalIssuer ¶ added in v1.23.0
func IsExternalIssuer(cr *api.PerconaServerMongoDB) bool
func IsSecretCreatedByUser ¶ added in v1.16.1
func IssueCA ¶ added in v1.23.0
IssueCA generates a new self-signed CA certificate and returns the CA cert and CA private key in PEM format.
func IssueWithCA ¶ added in v1.23.0
func IssueWithCA(hosts []string, caCertPEM, caKeyPEM []byte) (tlsCert []byte, tlsKey []byte, err error)
IssueWithCA generates a TLS certificate signed by the given CA and returns the TLS cert and TLS private key in PEM format.
func ManualCASecretName ¶ added in v1.23.0
func ManualCASecretName(cr *api.PerconaServerMongoDB) string
ManualCASecretName returns the name of the CA secret for manual TLS management.
Types ¶
type CertManagerController ¶ added in v1.15.0
type CertManagerController interface {
ApplyIssuer(ctx context.Context, cr *api.PerconaServerMongoDB) (util.ApplyStatus, error)
ApplyCAIssuer(ctx context.Context, cr *api.PerconaServerMongoDB) (util.ApplyStatus, error)
ApplyCertificate(ctx context.Context, cr *api.PerconaServerMongoDB, cert Certificate) (util.ApplyStatus, error)
WaitForCerts(ctx context.Context, cr *api.PerconaServerMongoDB, certificates ...Certificate) error
GetMergedCA(ctx context.Context, cr *api.PerconaServerMongoDB, secretNames []string) ([]byte, error)
Check(ctx context.Context, config *rest.Config, ns string) error
IsDryRun() bool
GetClient() client.Client
}
func NewCertManagerController ¶ added in v1.15.0
type Certificate ¶ added in v1.22.0
type Certificate interface {
Name() string
Namespace() string
SecretName() string
Object() *cm.Certificate
}
func CertificateCA ¶ added in v1.22.0
func CertificateCA(cr *api.PerconaServerMongoDB) Certificate
func CertificateTLS ¶ added in v1.22.0
func CertificateTLS(cr *api.PerconaServerMongoDB, internal bool) Certificate
type NewCertManagerControllerFunc ¶ added in v1.16.0
Click to show internal directories.
Click to hide internal directories.