v1alpha1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the k8s v1alpha1 API group +k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +groupName=k8s.amaiz.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "k8s.amaiz.com", Version: "v1alpha1"}

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

Functions

Types

type ContainerSpec

type ContainerSpec struct {
	// Image is a standard path for a Container image
	Image string `json:"image"`
	// Resources describes the compute resource requirements
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
	// SecurityContext holds security configuration that will be applied to a container
	SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
	// Number of seconds after the container has started before liveness probes are initiated.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
	// +optional
	InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
}

ContainerSpec allows to set some container-specific attributes

func (*ContainerSpec) DeepCopy

func (in *ContainerSpec) DeepCopy() *ContainerSpec

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

func (*ContainerSpec) DeepCopyInto

func (in *ContainerSpec) DeepCopyInto(out *ContainerSpec)

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

type Password

type Password struct {
	// SecretKeyRef is a reference to the Secret in the same namespace containing the password.
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef"`
}

Password allows to refer to a Secret containing password for Redis Password should be strong enough. Passwords shorter than 8 characters composed of ASCII alphanumeric symbols will lead to a mild warning logged by the Operator. Please note that password hashes are added as annotations to Pods to enable password rotation. Hashes are generated using argon2id KDF. Changing the password in the referenced Secret will not trigger the rolling Statefulset upgrade automatically. However an event in regard to any objects owned by the Redis resource fired afterwards will trigger the rolling upgrade. Redis operator does not store the password internally and reads it from the Secret any time the Reconcile is called. Hence it will not be able to connect to Pods with the “old” password. In scenarios when persistence is turned off all the data will be lost during password rotation.

func (*Password) DeepCopy

func (in *Password) DeepCopy() *Password

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

func (*Password) DeepCopyInto

func (in *Password) DeepCopyInto(out *Password)

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

type Redis

type Redis struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   RedisSpec   `json:"spec"`
	Status RedisStatus `json:"status,omitempty"`
}

Redis is the Schema for the redis API +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:printcolumn:name="Master",type="string",JSONPath=".status.master",description="Current master's Pod name" +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Current number of Redis instances" +kubebuilder:printcolumn:name="Desired",type="integer",JSONPath=".spec.replicas",description="Desired number of Redis instances" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:subresource:status +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas

func (*Redis) DeepCopy

func (in *Redis) DeepCopy() *Redis

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

func (*Redis) DeepCopyInto

func (in *Redis) DeepCopyInto(out *Redis)

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

func (*Redis) DeepCopyObject

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

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

type RedisList

type RedisList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata. More info:
	// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
	// +k8s:openapi-gen=false
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of Redis resources
	Items []Redis `json:"items"`
}

RedisList is a list of Redis resources +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*RedisList) DeepCopy

func (in *RedisList) DeepCopy() *RedisList

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

func (*RedisList) DeepCopyInto

func (in *RedisList) DeepCopyInto(out *RedisList)

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

func (*RedisList) DeepCopyObject

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

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

type RedisSpec

type RedisSpec struct {

	// Replicas is a number of replicas in a Redis failover cluster
	// +kubebuilder:validation:Minimum=3
	Replicas *int32 `json:"replicas"`

	// Config allows to pass custom Redis configuration parameters
	Config   map[string]string `json:"config,omitempty"`
	Password Password          `json:"password,omitempty"`

	// Pod annotations
	Annotations map[string]string `json:"annotations,omitempty"`
	// Pod securityContext
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
	// Pod affinity
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// NodeSelector specifies a map of key-value pairs. For the pod to be
	// eligible to run on a node, the node must have each of the indicated
	// key-value pairs as labels.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// Pod tolerations
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// Pod ServiceAccountName is the name of the ServiceAccount to use to run this pod.
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// Pod ImagePullSecrets
	// More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// Pod priorityClassName
	PriorityClassName string `json:"priorityClassName,omitempty"`
	// DataVolumeClaimTemplate for StatefulSet
	DataVolumeClaimTemplate corev1.PersistentVolumeClaim `json:"dataVolumeClaimTemplate,omitempty"`
	// Volumes for StatefulSet
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// Redis container specification
	Redis ContainerSpec `json:"redis"`

	// Exporter container specification
	Exporter ContainerSpec `json:"exporter,omitempty"`

	// Pod initContainers
	InitContainers []corev1.Container `json:"initContainers,omitempty"`
}

RedisSpec defines the desired state of Redis

func (*RedisSpec) DeepCopy

func (in *RedisSpec) DeepCopy() *RedisSpec

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

func (*RedisSpec) DeepCopyInto

func (in *RedisSpec) DeepCopyInto(out *RedisSpec)

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

type RedisStatus

type RedisStatus struct {
	// Replicas is the number of active Redis instances in the replication
	Replicas int `json:"replicas"`
	// Master is the current master's Pod name
	Master string `json:"master"`
}

RedisStatus contains the observed state of Redis

func (*RedisStatus) DeepCopy

func (in *RedisStatus) DeepCopy() *RedisStatus

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

func (*RedisStatus) DeepCopyInto

func (in *RedisStatus) DeepCopyInto(out *RedisStatus)

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