Documentation
¶
Index ¶
- Constants
- func ValidateCACertSecret(ctx context.Context, c client.Client, caSecret types.NamespacedName) (string, error)
- func ValidateEndpointCerts(ctx context.Context, h *helper.Helper, namespace string, ...) (string, error)
- type API
- type APIService
- type Ca
- type GenericService
- func (in *GenericService) DeepCopy() *GenericService
- func (in *GenericService) DeepCopyInto(out *GenericService)
- func (s *GenericService) Enabled() bool
- func (s *GenericService) ToService() (*Service, error)
- func (s *GenericService) ValidateCertSecret(ctx context.Context, h *helper.Helper, namespace string) (string, error)
- type Service
- type SimpleService
Constants ¶
const ( // CABundleSecret - CABundleSecret = "combined-ca-bundle" // CABundleLabel added to the CA bundle secret for the namespace CABundleLabel = "combined-ca-bundle" // CABundleKey - key in CaBundleSecret holding a full CA bundle CABundleKey = "tls-ca-bundle.pem" // InternalCABundleKey - key in CABundleSecret only holding the internal CA InternalCABundleKey = "internal-ca-bundle.pem" // DefaultCAPrefix - DefaultCAPrefix = "rootca-" // DownstreamTLSCABundlePath - DownstreamTLSCABundlePath = "/etc/pki/ca-trust/extracted/pem/" + CABundleKey // UpstreamTLSCABundlePath - UpstreamTLSCABundlePath = "/etc/ssl/certs/ca-certificates.crt" // CertKey - key of the secret entry holding the cert CertKey = "tls.crt" // PrivateKey - key of the secret entry holding the cert private key PrivateKey = "tls.key" // CAKey - key of the secret entry holding the CA CAKey = "ca.crt" // DefaultCertMountDir - updated default path to mount cert files inside container DefaultCertMountDir = "/var/lib/config-data/tls/certs" // DefaultKeyMountDir - updated default path to mount cert keys inside container DefaultKeyMountDir = "/var/lib/config-data/tls/private" // TLSHashName - Name of the hash of hashes of all cert resources used to identify a change TLSHashName = "certs" // AdditionalSubjectNamesKey - Comma separated list of additionalSubjectNames // that should be passed to the CertificateRequest AdditionalSubjectNamesKey = "additionalSubjectNames" // DefaultClusterInternalDomain - cluster internal dns domain DefaultClusterInternalDomain = "cluster.local" )
Variables ¶
This section is empty.
Functions ¶
func ValidateCACertSecret ¶
func ValidateCACertSecret( ctx context.Context, c client.Client, caSecret types.NamespacedName, ) (string, error)
ValidateCACertSecret - validates the content of the cert secret to make sure "tls-ca-bundle.pem" key exists
Types ¶
type API ¶
type API struct { // +kubebuilder:validation:optional // +operator-sdk:csv:customresourcedefinitions:type=spec // API tls type which encapsulates for API services API APIService `json:"api,omitempty"` // +kubebuilder:validation:optional // +operator-sdk:csv:customresourcedefinitions:type=spec // Secret containing CA bundle Ca `json:",inline"` }
API defines the observed state of TLS with API only
func (*API) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new API.
func (*API) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type APIService ¶
type APIService struct { // +kubebuilder:validation:optional // +operator-sdk:csv:customresourcedefinitions:type=spec // Public GenericService - holds the secret for the public endpoint Public GenericService `json:"public,omitempty"` // +kubebuilder:validation:optional // +operator-sdk:csv:customresourcedefinitions:type=spec // Internal GenericService - holds the secret for the internal endpoint Internal GenericService `json:"internal,omitempty"` }
APIService - API tls type which encapsulates for API services
func (*APIService) DeepCopy ¶
func (in *APIService) DeepCopy() *APIService
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIService.
func (*APIService) DeepCopyInto ¶
func (in *APIService) DeepCopyInto(out *APIService)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*APIService) Enabled ¶
func (a *APIService) Enabled(endpt service.Endpoint) bool
Enabled - returns true if TLS is configured for the public and internal
func (*APIService) ValidateCertSecrets ¶
func (a *APIService) ValidateCertSecrets( ctx context.Context, h *helper.Helper, namespace string, ) (string, error)
ValidateCertSecrets - validates the content of the cert secrets to make sure "tls-ca-bundle.pem" key exists
type Ca ¶
type Ca struct { // CaBundleSecretName - holding the CA certs in a pre-created bundle file CaBundleSecretName string `json:"caBundleSecretName,omitempty"` }
Ca contains CA-specific settings, which could be used both by services (to define their own CA certificates) and by clients (to verify the server's certificate)
func (*Ca) CreateVolume ¶
CreateVolume creates volumes for CA bundle file
func (*Ca) CreateVolumeMounts ¶
func (c *Ca) CreateVolumeMounts(caBundleMount *string) []corev1.VolumeMount
CreateVolumeMounts creates volume mounts for CA bundle file
func (*Ca) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ca.
func (*Ca) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GenericService ¶
type GenericService struct { // +kubebuilder:validation:Optional // SecretName - holding the cert, key for the service SecretName *string `json:"secretName,omitempty"` }
GenericService contains server-specific TLS secret or issuer
func (*GenericService) DeepCopy ¶
func (in *GenericService) DeepCopy() *GenericService
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericService.
func (*GenericService) DeepCopyInto ¶
func (in *GenericService) DeepCopyInto(out *GenericService)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GenericService) Enabled ¶
func (s *GenericService) Enabled() bool
Enabled - returns true if TLS is configured for the service
func (*GenericService) ToService ¶
func (s *GenericService) ToService() (*Service, error)
ToService - convert tls.APIService to tls.Service
func (*GenericService) ValidateCertSecret ¶
func (s *GenericService) ValidateCertSecret( ctx context.Context, h *helper.Helper, namespace string, ) (string, error)
ValidateCertSecret - validates the content of the cert secrets to make sure "tls-ca-bundle.pem" key exists
type Service ¶
type Service struct { // SecretName - holding the cert, key for the service SecretName string `json:"secretName"` // CertMount - dst location to mount the service tls.crt cert. Can be used to override the default location which is /etc/tls/certs/<service id>.crt CertMount *string `json:"certMount,omitempty"` // KeyMount - dst location to mount the service tls.key key. Can be used to override the default location which is /etc/tls/private/<service id>.key KeyMount *string `json:"keyMount,omitempty"` // CaMount - dst location to mount the CA cert ca.crt to. Can be used if the service CA cert should be mounted specifically, e.g. to be set in a service config for validation, instead of the env wide bundle. CaMount *string `json:"caMount,omitempty"` }
Service contains server-specific TLS secret +kubebuilder:object:generate:=false
func (*Service) CreateVolume ¶
CreateVolume - add volume for TLS certificates and CA certificate for the service
func (*Service) CreateVolumeMounts ¶
func (s *Service) CreateVolumeMounts(serviceID string) []corev1.VolumeMount
CreateVolumeMounts - add volume mount for TLS certificates and CA certificate for the service
type SimpleService ¶
type SimpleService struct { // +kubebuilder:validation:optional // +operator-sdk:csv:customresourcedefinitions:type=spec // Secret containing certificates for the service GenericService `json:",inline"` // +kubebuilder:validation:optional // +operator-sdk:csv:customresourcedefinitions:type=spec // Secret containing CA bundle Ca `json:",inline"` }
SimpleService defines the observed state of TLS for a single service
func (*SimpleService) DeepCopy ¶
func (in *SimpleService) DeepCopy() *SimpleService
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimpleService.
func (*SimpleService) DeepCopyInto ¶
func (in *SimpleService) DeepCopyInto(out *SimpleService)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.