v1alpha1

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the apps v1alpha1 API group +kubebuilder:object:generate=true +groupName=apps.m88i.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "apps.m88i.io", Version: "v1alpha1"}

	// 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

Types

type Nexus

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

	Spec   NexusSpec   `json:"spec,omitempty"`
	Status NexusStatus `json:"status,omitempty"`
}

func (*Nexus) DeepCopy

func (in *Nexus) DeepCopy() *Nexus

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

func (*Nexus) DeepCopyInto

func (in *Nexus) DeepCopyInto(out *Nexus)

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

func (*Nexus) DeepCopyObject

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

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

type NexusAutomaticUpdate

type NexusAutomaticUpdate struct {
	// Whether or not the Operator should perform automatic updates. Defaults to `false` (auto updates are enabled).
	// Is set to `false` if `spec.image` is not empty and is different from the default community image.
	// +optional
	Disabled bool `json:"disabled,omitempty"`
	// The Nexus image minor version the deployment should stay in. If left blank and automatic updates are enabled the latest minor is set.
	// +kubebuilder:validation:Minimum=0
	// +optional
	MinorVersion *int `json:"minorVersion,omitempty"` // must keep a pointer to tell apart uninformed from 0
}

NexusAutomaticUpdate defines configuration for automatic updates

func (*NexusAutomaticUpdate) DeepCopy

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

func (*NexusAutomaticUpdate) DeepCopyInto

func (in *NexusAutomaticUpdate) DeepCopyInto(out *NexusAutomaticUpdate)

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

type NexusList

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

NexusList contains a list of Nexus +kubebuilder:object:root=true

func (*NexusList) DeepCopy

func (in *NexusList) DeepCopy() *NexusList

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

func (*NexusList) DeepCopyInto

func (in *NexusList) DeepCopyInto(out *NexusList)

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

func (*NexusList) DeepCopyObject

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

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

type NexusNetworking

type NexusNetworking struct {
	// Annotations that should be added to the Ingress/Route resource
	// +optional
	// +nullable
	Annotations map[string]string `json:"annotations,omitempty"`
	// Labels that should be added to the Ingress/Route resource
	// +optional
	// +nullable
	Labels map[string]string `json:"labels,omitempty"`
	// Set to `true` to expose the Nexus application. Defaults to `false`.
	Expose bool `json:"expose,omitempty"`
	// Type of networking exposure: NodePort, Route or Ingress. Defaults to Route on OpenShift and Ingress on Kubernetes.
	// Routes are only available on Openshift and Ingresses are only available on Kubernetes.
	// +kubebuilder:validation:Enum=NodePort;Route;Ingress
	ExposeAs NexusNetworkingExposeType `json:"exposeAs,omitempty"`
	// Host where the Nexus service is exposed. This attribute is required if the service is exposed via Ingress.
	Host string `json:"host,omitempty"`
	// NodePort defined in the exposed service. Required if exposed via NodePort.
	NodePort int32 `json:"nodePort,omitempty"`
	// TLS/SSL-related configuration
	// +optional
	TLS NexusNetworkingTLS `json:"tls,omitempty"`
	// IgnoreUpdates controls whether the Operator monitors and undoes external changes to the Ingress/Route resources.
	// Defaults to `false`, meaning the Operator will change the Ingress/Route specification to match its state as
	// defined by this resource.
	// Set to `true` in order to prevent the Operator from undoing external changes in the resources' configuration.
	IgnoreUpdates bool `json:"ignoreUpdates,omitempty"`
}

NexusNetworking is the base structure for Nexus networking information

func (*NexusNetworking) DeepCopy

func (in *NexusNetworking) DeepCopy() *NexusNetworking

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

func (*NexusNetworking) DeepCopyInto

func (in *NexusNetworking) DeepCopyInto(out *NexusNetworking)

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

type NexusNetworkingExposeType

type NexusNetworkingExposeType string

NexusNetworkingExposeType defines how to expose Nexus service

const (
	// NodePortExposeType The service is exposed via NodePort
	NodePortExposeType NexusNetworkingExposeType = "NodePort"
	// RouteExposeType On OpenShift, the service is exposed via a custom Route
	RouteExposeType NexusNetworkingExposeType = "Route"
	// IngressExposeType Supported on Kubernetes only, the service is exposed via NGINX Ingress
	IngressExposeType NexusNetworkingExposeType = "Ingress"
)

type NexusNetworkingTLS

type NexusNetworkingTLS struct {
	// When exposing via Route, set to `true` to only allow encrypted traffic using TLS (disables HTTP in favor of HTTPS). Defaults to `false`.
	// +optional
	Mandatory bool `json:"mandatory,omitempty"`
	// When exposing via Ingress, inform the name of the TLS secret containing certificate and private key for TLS encryption. It must be present in the same namespace as the Operator.
	// +optional
	SecretName string `json:"secretName,omitempty"`
}

NexusNetworkingTLS defines TLS/SSL-related configuration

func (*NexusNetworkingTLS) DeepCopy

func (in *NexusNetworkingTLS) DeepCopy() *NexusNetworkingTLS

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

func (*NexusNetworkingTLS) DeepCopyInto

func (in *NexusNetworkingTLS) DeepCopyInto(out *NexusNetworkingTLS)

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

type NexusPersistence

type NexusPersistence struct {
	// Flag to indicate if this instance installation will be persistent or not. If set to true a PVC is created for it.
	Persistent bool `json:"persistent"`
	// If persistent, the size of the Volume.
	// Defaults: 10Gi
	VolumeSize string `json:"volumeSize,omitempty"`
	// StorageClass used by the managed PVC.
	StorageClass string `json:"storageClass,omitempty"`
	// ExtraVolumes which should be mounted when deploying Nexus.
	// Updating this may lead to temporary unavailability while the new deployment with new volumes rolls out.
	// +optional
	// +listType=atomic
	ExtraVolumes []NexusVolume `json:"extraVolumes,omitempty"`
}

NexusPersistence is the structure for the data persistent +k8s:openapi-gen=true

func (*NexusPersistence) DeepCopy

func (in *NexusPersistence) DeepCopy() *NexusPersistence

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

func (*NexusPersistence) DeepCopyInto

func (in *NexusPersistence) DeepCopyInto(out *NexusPersistence)

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

type NexusProbe

type NexusProbe struct {
	// Number of seconds after the container has started before probes are initiated.
	// Defaults to 240 seconds. Minimum value is 0.
	// +optional
	// +kubebuilder:validation:Minimum=0
	InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty" protobuf:"varint,2,opt,name=initialDelaySeconds"`
	// Number of seconds after which the probe times out.
	// Defaults to 15 seconds. Minimum value is 1.
	// +optional
	// +kubebuilder:validation:Minimum=1
	TimeoutSeconds int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,3,opt,name=timeoutSeconds"`
	// How often (in seconds) to perform the probe.
	// Defaults to 10 seconds. Minimum value is 1.
	// +optional
	// +kubebuilder:validation:Minimum=1
	PeriodSeconds int32 `json:"periodSeconds,omitempty" protobuf:"varint,4,opt,name=periodSeconds"`
	// Minimum consecutive successes for the probe to be considered successful after having failed.
	// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
	// +optional
	// +kubebuilder:validation:Minimum=1
	SuccessThreshold int32 `json:"successThreshold,omitempty" protobuf:"varint,5,opt,name=successThreshold"`
	// Minimum consecutive failures for the probe to be considered failed after having succeeded.
	// Defaults to 3. Minimum value is 1.
	// +optional
	// +kubebuilder:validation:Minimum=1
	FailureThreshold int32 `json:"failureThreshold,omitempty" protobuf:"varint,6,opt,name=failureThreshold"`
}

NexusProbe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. +k8s:openapi-gen=true

func (*NexusProbe) DeepCopy

func (in *NexusProbe) DeepCopy() *NexusProbe

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

func (*NexusProbe) DeepCopyInto

func (in *NexusProbe) DeepCopyInto(out *NexusProbe)

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

type NexusSpec

type NexusSpec struct {

	// Number of pod replicas desired. Defaults to 0.
	// +kubebuilder:validation:Maximum=100
	// +kubebuilder:validation:Minimum=0
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Replicas"
	Replicas int32 `json:"replicas"`

	// Full image tag name for this specific deployment. Will be ignored if `spec.useRedHatImage` is set to `true`.
	// Default: docker.io/sonatype/nexus3:latest
	// +optional
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image"
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:image"
	Image string `json:"image,omitempty"`

	// Automatic updates configuration
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Automatic Update"
	AutomaticUpdate NexusAutomaticUpdate `json:"automaticUpdate,omitempty"`

	// The image pull policy for the Nexus image. If left blank behavior will be determined by the image tag (`Always` if "latest" and `IfNotPresent` otherwise).
	// Possible values: `Always`, `IfNotPresent` or `Never`.
	// +kubebuilder:validation:Enum=Always;IfNotPresent;Never
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
	// +optional
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// Defined Resources for the Nexus instance
	// +optional
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resources"
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// Persistence definition
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=false
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Persistence"
	Persistence NexusPersistence `json:"persistence"`

	// If you have access to Red Hat Container Catalog, set this to `true` to use the certified image provided by Sonatype
	// Defaults to `false`
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Use Red Hat Image"
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
	UseRedHatImage bool `json:"useRedHatImage"`

	// GenerateRandomAdminPassword enables the random password generation.
	// Defaults to `false`: the default password for a newly created instance is 'admin123', which should be changed in the first login.
	// If set to `true`, you must use the automatically generated 'admin' password, stored in the container's file system at `/nexus-data/admin.password`.
	// The operator uses the default credentials to create a user for itself to create default repositories.
	// If set to `true`, the repositories won't be created since the operator won't fetch for the random password.
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Generate Random Admin Password"
	// +optional
	GenerateRandomAdminPassword bool `json:"generateRandomAdminPassword,omitempty"`

	// Networking definition
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=false
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Networking"
	Networking NexusNetworking `json:"networking,omitempty"`

	// ServiceAccountName is the name of the ServiceAccount used to run the Pods. If left blank, a default ServiceAccount is created with the same name as the Nexus CR (`metadata.name`).
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Service Account"
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// LivenessProbe describes how the Nexus container liveness probe should work
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=false
	// +optional
	LivenessProbe *NexusProbe `json:"livenessProbe,omitempty"`

	// ReadinessProbe describes how the Nexus container readiness probe should work
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=false
	// +optional
	ReadinessProbe *NexusProbe `json:"readinessProbe,omitempty"`

	// ServerOperations describes the options for the operations performed on the deployed server instance
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +optional
	ServerOperations ServerOperationsOpts `json:"serverOperations,omitempty"`

	// Properties describes the configuration properties in the Java properties format that will be included in the nexus.properties file mounted with the Nexus server deployment.
	// For example: nexus.conan.hosted.enabled: true
	// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
	// +optional
	Properties map[string]string `json:"properties,omitempty"`
}

NexusSpec defines the desired state of Nexus +k8s:openapi-gen=true +kubebuilder:resource:path=nexus,scope=Namespaced

func (*NexusSpec) DeepCopy

func (in *NexusSpec) DeepCopy() *NexusSpec

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

func (*NexusSpec) DeepCopyInto

func (in *NexusSpec) DeepCopyInto(out *NexusSpec)

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

type NexusStatus

type NexusStatus struct {
	// Condition status for the Nexus deployment
	// +operator-sdk:gen-csv:customresourcedefinitions.statusDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.statusDescriptors.displayName="appsv1.DeploymentStatus"
	DeploymentStatus v1.DeploymentStatus `json:"deploymentStatus,omitempty"`
	// Will be "OK" when this Nexus instance is up
	// +operator-sdk:gen-csv:customresourcedefinitions.statusDescriptors=true
	NexusStatus NexusStatusType `json:"nexusStatus,omitempty"`
	// Gives more information about a failure status
	// +operator-sdk:gen-csv:customresourcedefinitions.statusDescriptors=true
	Reason string `json:"reason,omitempty"`
	// Route for external service access
	// +operator-sdk:gen-csv:customresourcedefinitions.statusDescriptors=true
	NexusRoute string `json:"nexusRoute,omitempty"`
	// Conditions reached during an update
	// +listType=atomic
	// +operator-sdk:gen-csv:customresourcedefinitions.statusDescriptors=true
	// +operator-sdk:gen-csv:customresourcedefinitions.statusDescriptors.displayName="Update Conditions"
	UpdateConditions []string `json:"updateConditions,omitempty"`
	// ServerOperationsStatus describes the general status for the operations performed in the Nexus server instance
	ServerOperationsStatus OperationsStatus `json:"serverOperationsStatus,omitempty"`
}

NexusStatus defines the observed state of Nexus +k8s:openapi-gen=true

func (*NexusStatus) DeepCopy

func (in *NexusStatus) DeepCopy() *NexusStatus

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

func (*NexusStatus) DeepCopyInto

func (in *NexusStatus) DeepCopyInto(out *NexusStatus)

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

type NexusStatusType

type NexusStatusType string
const (
	// NexusStatusOK is the ok status
	NexusStatusOK NexusStatusType = "OK"
	// NexusStatusFailure is the failed status
	NexusStatusFailure NexusStatusType = "Failure"
	// NexusStatusPending is the failed status
	NexusStatusPending NexusStatusType = "Pending"
)

type NexusVolume added in v0.6.0

type NexusVolume struct {
	corev1.Volume `json:",inline"`
	// MountPath is the path where this volume should be mounted
	MountPath string `json:"mountPath"`
}

NexusVolume embeds a Volume structure to represent a volume to be mounted in the Nexus pod at the specified MountPath

func (*NexusVolume) DeepCopy added in v0.6.0

func (in *NexusVolume) DeepCopy() *NexusVolume

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

func (*NexusVolume) DeepCopyInto added in v0.6.0

func (in *NexusVolume) DeepCopyInto(out *NexusVolume)

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

type OperationsStatus

type OperationsStatus struct {
	ServerReady                  bool   `json:"serverReady,omitempty"`
	OperatorUserCreated          bool   `json:"operatorUserCreated,omitempty"`
	CommunityRepositoriesCreated bool   `json:"communityRepositoriesCreated,omitempty"`
	MavenCentralUpdated          bool   `json:"mavenCentralUpdated,omitempty"`
	Reason                       string `json:"reason,omitempty"`
	MavenPublicURL               string `json:"mavenPublicURL,omitempty"`
}

OperationsStatus describes the status for each operation made by the operator in the deployed Nexus Server

func (*OperationsStatus) DeepCopy

func (in *OperationsStatus) DeepCopy() *OperationsStatus

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

func (*OperationsStatus) DeepCopyInto

func (in *OperationsStatus) DeepCopyInto(out *OperationsStatus)

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

type ServerOperationsOpts

type ServerOperationsOpts struct {
	// DisableRepositoryCreation disables the auto-creation of Apache, JBoss and Red Hat repositories and their addition to
	// the Maven Public group in this Nexus instance.
	// Defaults to `false` (always try to create the repos). Set this to `true` to not create them. Only works if `spec.generateRandomAdminPassword` is `false`.
	DisableRepositoryCreation bool `json:"disableRepositoryCreation,omitempty"`
	// DisableOperatorUserCreation disables the auto-creation of the `nexus-operator` user on the deployed server. This user performs
	// all the operations on the server (such as creating the community repos). If disabled, the Operator will use the default `admin` user.
	// Defaults to `false` (always create the user). Setting this to `true` is not recommended as it grants the Operator more privileges than it needs and it would not be possible to tell apart operations performed by the `admin` and the Operator.
	DisableOperatorUserCreation bool `json:"disableOperatorUserCreation,omitempty"`
}

ServerOperationsOpts describes the options for the operations performed in the Nexus server deployed instance

func (*ServerOperationsOpts) DeepCopy

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

func (*ServerOperationsOpts) DeepCopyInto

func (in *ServerOperationsOpts) DeepCopyInto(out *ServerOperationsOpts)

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

Jump to

Keyboard shortcuts

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