v1

package
v0.0.0-...-c21c255 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package v1 contains API Schema definitions for the mongodb v1 API group +k8s:deepcopy-gen=package,register +groupName=mongodbcommunity.mongodb.com +versionName=v1

Package v1 contains API Schema definitions for the mongodbcommunity v1 API group +kubebuilder:object:generate=true +groupName=mongodbcommunity.mongodb.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "mongodbcommunity.mongodb.com", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AuthMode

type AuthMode string

AuthMode ... +kubebuilder:validation:Enum=SCRAM;SCRAM-SHA-256;SCRAM-SHA-1

type Authentication

type Authentication struct {
	// Modes is an array specifying which authentication methods should be enabled.
	Modes []AuthMode `json:"modes"`

	// +optional
	// +kubebuilder:default:=true
	// +nullable
	IgnoreUnknownUsers *bool `json:"ignoreUnknownUsers,omitempty"`
}

Authentication ...

func (*Authentication) DeepCopy

func (in *Authentication) DeepCopy() *Authentication

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Authentication.

func (*Authentication) DeepCopyInto

func (in *Authentication) DeepCopyInto(out *Authentication)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AuthenticationRestriction

type AuthenticationRestriction struct {
	ClientSource  []string `json:"clientSource"`
	ServerAddress []string `json:"serverAddress"`
}

AuthenticationRestriction specifies a list of IP addresses and CIDR ranges users are allowed to connect to or from.

func (*AuthenticationRestriction) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationRestriction.

func (*AuthenticationRestriction) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CustomRole

type CustomRole struct {
	// The name of the role.
	Role string `json:"role"`
	// The database of the role.
	DB string `json:"db"`
	// The privileges to grant the role.
	Privileges []Privilege `json:"privileges"`
	// An array of roles from which this role inherits privileges.
	// +optional
	Roles []Role `json:"roles"`
	// The authentication restrictions the server enforces on the role.
	// +optional
	AuthenticationRestrictions []AuthenticationRestriction `json:"authenticationRestrictions,omitempty"`
}

CustomRole defines a custom MongoDB role.

func (*CustomRole) DeepCopy

func (in *CustomRole) DeepCopy() *CustomRole

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomRole.

func (*CustomRole) DeepCopyInto

func (in *CustomRole) DeepCopyInto(out *CustomRole)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LocalObjectReference

type LocalObjectReference struct {
	Name string `json:"name"`
}

LocalObjectReference is a reference to another Kubernetes object by name. TODO: Replace with a type from the K8s API. CoreV1 has an equivalent

"LocalObjectReference" type but it contains a TODO in its
description that we don't want in our CRD.

func (*LocalObjectReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectReference.

func (*LocalObjectReference) DeepCopyInto

func (in *LocalObjectReference) DeepCopyInto(out *LocalObjectReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MongoDBCommunity

type MongoDBCommunity struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   MongoDBCommunitySpec   `json:"spec,omitempty"`
	Status MongoDBCommunityStatus `json:"status,omitempty"`
}

MongoDBCommunity is the Schema for the mongodbs API +kubebuilder:subresource:status +kubebuilder:resource:path=mongodbcommunity,scope=Namespaced,shortName=mdbc,singular=mongodbcommunity +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Current state of the MongoDB deployment" +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".status.version",description="Version of MongoDB server"

func (*MongoDBCommunity) DeepCopy

func (in *MongoDBCommunity) DeepCopy() *MongoDBCommunity

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBCommunity.

func (*MongoDBCommunity) DeepCopyInto

func (in *MongoDBCommunity) DeepCopyInto(out *MongoDBCommunity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MongoDBCommunity) DeepCopyObject

func (in *MongoDBCommunity) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MongoDBCommunityList

type MongoDBCommunityList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []MongoDBCommunity `json:"items"`
}

MongoDBCommunityList contains a list of MongoDB

func (*MongoDBCommunityList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBCommunityList.

func (*MongoDBCommunityList) DeepCopyInto

func (in *MongoDBCommunityList) DeepCopyInto(out *MongoDBCommunityList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MongoDBCommunityList) DeepCopyObject

func (in *MongoDBCommunityList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MongoDBCommunitySpec

type MongoDBCommunitySpec struct {
	// Members is the number of members in the replica set
	// +optional
	Members int `json:"members"`
	// Type defines which type of MongoDB deployment the resource should create
	// +kubebuilder:validation:Enum=ReplicaSet
	Type Type `json:"type"`
	// Version defines which version of MongoDB will be used
	Version string `json:"version"`

	// Arbiters is the number of arbiters (each counted as a member) in the replica set
	// +optional
	Arbiters int `json:"arbiters"`

	// FeatureCompatibilityVersion configures the feature compatibility version that will
	// be set for the deployment
	// +optional
	FeatureCompatibilityVersion string `json:"featureCompatibilityVersion,omitempty"`

	// ReplicaSetHorizons Add this parameter and values if you need your database
	// to be accessed outside of Kubernetes. This setting allows you to
	// provide different DNS settings within the Kubernetes cluster and
	// to the Kubernetes cluster. The Kubernetes Operator uses split horizon
	// DNS for replica set members. This feature allows communication both
	// within the Kubernetes cluster and from outside Kubernetes.
	// +optional
	ReplicaSetHorizons ReplicaSetHorizonConfiguration `json:"replicaSetHorizons,omitempty"`

	// Security configures security features, such as TLS, and authentication settings for a deployment
	// +required
	Security Security `json:"security"`

	// Users specifies the MongoDB users that should be configured in your deployment
	// +required
	Users []MongoDBUser `json:"users"`

	// +optional
	StatefulSetConfiguration StatefulSetConfiguration `json:"statefulSet,omitempty"`

	// AdditionalMongodConfig is additional configuration that can be passed to
	// each data-bearing mongod at runtime. Uses the same structure as the mongod
	// configuration file: https://docs.mongodb.com/manual/reference/configuration-options/
	// +kubebuilder:validation:Type=object
	// +optional
	// +kubebuilder:pruning:PreserveUnknownFields
	// +nullable
	AdditionalMongodConfig MongodConfiguration `json:"additionalMongodConfig,omitempty"`
}

MongoDBCommunitySpec defines the desired state of MongoDB

func (*MongoDBCommunitySpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBCommunitySpec.

func (*MongoDBCommunitySpec) DeepCopyInto

func (in *MongoDBCommunitySpec) DeepCopyInto(out *MongoDBCommunitySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MongoDBCommunityStatus

type MongoDBCommunityStatus struct {
	MongoURI string `json:"mongoUri"`
	Phase    Phase  `json:"phase"`

	CurrentStatefulSetReplicas int `json:"currentStatefulSetReplicas"`
	CurrentMongoDBMembers      int `json:"currentMongoDBMembers"`

	Message string `json:"message,omitempty"`
}

MongoDBCommunityStatus defines the observed state of MongoDB

func (*MongoDBCommunityStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBCommunityStatus.

func (*MongoDBCommunityStatus) DeepCopyInto

func (in *MongoDBCommunityStatus) DeepCopyInto(out *MongoDBCommunityStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MongoDBUser

type MongoDBUser struct {
	// Name is the username of the user
	Name string `json:"name"`

	// DB is the database the user is stored in. Defaults to "admin"
	// +optional
	DB string `json:"db"`

	// PasswordSecretRef is a reference to the secret containing this user's password
	PasswordSecretRef SecretKeyReference `json:"passwordSecretRef"`

	// Roles is an array of roles assigned to this user
	Roles []Role `json:"roles"`

	// ScramCredentialsSecretName appended by string "scram-credentials" is the name of the secret object created by the mongoDB operator for storing SCRAM credentials
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
	ScramCredentialsSecretName string `json:"scramCredentialsSecretName"`
}

MongoDBUser ...

func (*MongoDBUser) DeepCopy

func (in *MongoDBUser) DeepCopy() *MongoDBUser

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBUser.

func (*MongoDBUser) DeepCopyInto

func (in *MongoDBUser) DeepCopyInto(out *MongoDBUser)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MongodConfiguration

type MongodConfiguration struct {
	Object map[string]interface{} `json:"-"`
}

MongodConfiguration holds the optional mongod configuration that should be merged with the operator created one.

The CRD generator does not support map[string]interface{} on the top level and hence we need to work around this with a wrapping struct.

func (*MongodConfiguration) DeepCopy

DeepCopy ...

func (*MongodConfiguration) DeepCopyInto

func (in *MongodConfiguration) DeepCopyInto(out *MongodConfiguration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Phase

type Phase string

Phase ...

const (
	// Running ...
	Running Phase = "Running"
	// Failed ...
	Failed Phase = "Failed"
	// Pending ...
	Pending Phase = "Pending"
)

type Privilege

type Privilege struct {
	Resource Resource `json:"resource"`
	Actions  []string `json:"actions"`
}

Privilege defines the actions a role is allowed to perform on a given resource.

func (*Privilege) DeepCopy

func (in *Privilege) DeepCopy() *Privilege

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Privilege.

func (*Privilege) DeepCopyInto

func (in *Privilege) DeepCopyInto(out *Privilege)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReplicaSetHorizonConfiguration

type ReplicaSetHorizonConfiguration []map[string]string

ReplicaSetHorizonConfiguration holds the split horizon DNS settings for replica set members.

func (ReplicaSetHorizonConfiguration) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSetHorizonConfiguration.

func (ReplicaSetHorizonConfiguration) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Resource

type Resource struct {
	// +optional
	DB *string `json:"db,omitempty"`
	// +optional
	Collection *string `json:"collection,omitempty"`
	// +optional
	Cluster bool `json:"cluster,omitempty"`
	// +optional
	AnyResource bool `json:"anyResource,omitempty"`
}

Resource specifies specifies the resources upon which a privilege permits actions. See https://docs.mongodb.com/manual/reference/resource-document for more.

func (*Resource) DeepCopy

func (in *Resource) DeepCopy() *Resource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resource.

func (*Resource) DeepCopyInto

func (in *Resource) DeepCopyInto(out *Resource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Role

type Role struct {
	// DB is the database the role can act on
	DB string `json:"db"`
	// Name is the name of the role
	Name string `json:"name"`
}

Role is the database role this user should have

func (*Role) DeepCopy

func (in *Role) DeepCopy() *Role

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Role.

func (*Role) DeepCopyInto

func (in *Role) DeepCopyInto(out *Role)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretKeyReference

type SecretKeyReference struct {
	// Name is the name of the secret storing this user's password
	Name string `json:"name"`

	// Key is the key in the secret storing this password. Defaults to "password"
	// +optional
	Key string `json:"key"`
}

SecretKeyReference is a reference to the secret containing the user's password

func (*SecretKeyReference) DeepCopy

func (in *SecretKeyReference) DeepCopy() *SecretKeyReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeyReference.

func (*SecretKeyReference) DeepCopyInto

func (in *SecretKeyReference) DeepCopyInto(out *SecretKeyReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Security

type Security struct {
	// +optional
	Authentication Authentication `json:"authentication"`
	// TLS configuration for both client-server and server-server communication
	// +optional
	TLS TLS `json:"tls"`
	// User-specified custom MongoDB roles that should be configured in the deployment.
	// +optional
	Roles []CustomRole `json:"roles,omitempty"`
}

Security ...

func (*Security) DeepCopy

func (in *Security) DeepCopy() *Security

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Security.

func (*Security) DeepCopyInto

func (in *Security) DeepCopyInto(out *Security)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StatefulSetConfiguration

type StatefulSetConfiguration struct {
	// +kubebuilder:pruning:PreserveUnknownFields
	SpecWrapper StatefulSetSpecWrapper `json:"spec"`
}

StatefulSetConfiguration holds the optional custom StatefulSet that should be merged into the operator created one.

func (*StatefulSetConfiguration) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatefulSetConfiguration.

func (*StatefulSetConfiguration) DeepCopyInto

func (in *StatefulSetConfiguration) DeepCopyInto(out *StatefulSetConfiguration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StatefulSetSpecWrapper

type StatefulSetSpecWrapper struct {
	Spec appsv1.StatefulSetSpec `json:"-"`
}

StatefulSetSpecWrapper is a wrapper around StatefulSetSpec with a custom implementation of MarshalJSON and UnmarshalJSON which delegate to the underlying Spec to avoid CRD pollution.

func (*StatefulSetSpecWrapper) DeepCopy

DeepCopy ...

func (*StatefulSetSpecWrapper) DeepCopyInto

func (in *StatefulSetSpecWrapper) DeepCopyInto(out *StatefulSetSpecWrapper)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TLS

type TLS struct {
	Enabled bool `json:"enabled"`

	// Optional configures if TLS should be required or optional for connections
	// +optional
	Optional bool `json:"optional"`

	// CertificateKeySecret is a reference to a Secret containing a private key and certificate to use for TLS.
	// The key and cert are expected to be PEM encoded and available at "tls.key" and "tls.crt".
	// This is the same format used for the standard "kubernetes.io/tls" Secret type, but no specific type is required.
	// +optional
	CertificateKeySecret LocalObjectReference `json:"certificateKeySecretRef"`

	// CaConfigMap is a reference to a ConfigMap containing the certificate for the CA which signed the server certificates
	// The certificate is expected to be available under the key "ca.crt"
	// +optional
	CaConfigMap LocalObjectReference `json:"caConfigMapRef"`
}

TLS is the configuration used to set up TLS encryption

func (*TLS) DeepCopy

func (in *TLS) DeepCopy() *TLS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLS.

func (*TLS) DeepCopyInto

func (in *TLS) DeepCopyInto(out *TLS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Type

type Type string

Type ...

const (
	// ReplicaSet ...
	ReplicaSet Type = "ReplicaSet"
)

Jump to

Keyboard shortcuts

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