2020-02-24 16:14:06 +00:00
|
|
|
package v1alpha1
|
|
|
|
|
|
|
|
import (
|
2022-09-13 18:34:08 +00:00
|
|
|
"github.com/traefik/traefik/v2/pkg/tls"
|
2020-02-24 16:14:06 +00:00
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
// +genclient
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
2021-03-03 14:32:04 +00:00
|
|
|
// +kubebuilder:storageversion
|
2020-02-24 16:14:06 +00:00
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// TLSStore is the CRD implementation of a Traefik TLS Store.
|
|
|
|
// For the time being, only the TLSStore named default is supported.
|
|
|
|
// This means that you cannot have two stores that are named default in different Kubernetes namespaces.
|
2023-03-22 10:06:05 +00:00
|
|
|
// More info: https://doc.traefik.io/traefik/v2.10/https/tls/#certificates-stores
|
2020-02-24 16:14:06 +00:00
|
|
|
type TLSStore struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
metav1.TypeMeta `json:",inline"`
|
|
|
|
// Standard object's metadata.
|
|
|
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
2020-02-24 16:14:06 +00:00
|
|
|
metav1.ObjectMeta `json:"metadata"`
|
|
|
|
|
|
|
|
Spec TLSStoreSpec `json:"spec"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen=true
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// TLSStoreSpec defines the desired state of a TLSStore.
|
2020-02-24 16:14:06 +00:00
|
|
|
type TLSStoreSpec struct {
|
2022-06-24 10:40:08 +00:00
|
|
|
// DefaultCertificate defines the default certificate configuration.
|
2022-05-19 14:42:09 +00:00
|
|
|
DefaultCertificate *Certificate `json:"defaultCertificate,omitempty"`
|
2022-09-13 18:34:08 +00:00
|
|
|
|
|
|
|
// DefaultGeneratedCert defines the default generated certificate configuration.
|
|
|
|
DefaultGeneratedCert *tls.GeneratedCert `json:"defaultGeneratedCert,omitempty"`
|
|
|
|
|
2022-05-19 14:42:09 +00:00
|
|
|
// Certificates is a list of secret names, each secret holding a key/certificate pair to add to the store.
|
|
|
|
Certificates []Certificate `json:"certificates,omitempty"`
|
2020-02-24 16:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen=true
|
|
|
|
|
2022-05-19 14:42:09 +00:00
|
|
|
// Certificate holds a secret name for the TLSStore resource.
|
|
|
|
type Certificate struct {
|
2021-03-03 14:32:04 +00:00
|
|
|
// SecretName is the name of the referenced Kubernetes Secret to specify the certificate details.
|
|
|
|
SecretName string `json:"secretName"`
|
2020-02-24 16:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// TLSStoreList is a collection of TLSStore resources.
|
2020-02-24 16:14:06 +00:00
|
|
|
type TLSStoreList struct {
|
|
|
|
metav1.TypeMeta `json:",inline"`
|
2022-06-24 10:40:08 +00:00
|
|
|
// Standard object's metadata.
|
|
|
|
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
|
2020-02-24 16:14:06 +00:00
|
|
|
metav1.ListMeta `json:"metadata"`
|
|
|
|
|
2022-06-24 10:40:08 +00:00
|
|
|
// Items is the list of TLSStore.
|
2020-02-24 16:14:06 +00:00
|
|
|
Items []TLSStore `json:"items"`
|
|
|
|
}
|