Help us shape the future of Go! Take the 2026 Go Developer Survey

v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=ansibleee.openstack.org

Index

Constants

View Source
const (
	//
	// AnsibleExecutionJob condition messages
	//
	// AnsibleExecutionJobInitMessage
	AnsibleExecutionJobInitMessage = "AnsibleExecutionJob not started"

	// AnsibleExecutionJobReadyMessage
	AnsibleExecutionJobReadyMessage = "AnsibleExecutionJob complete"

	// AnsibleExecutionJobNotFoundMessage
	AnsibleExecutionJobNotFoundMessage = "AnsibleExecutionJob not found"

	// AnsibleExecutionJobWaitingMessage
	AnsibleExecutionJobWaitingMessage = "AnsibleExecutionJob is running"

	// AnsibleExecutionJobErrorMessage
	AnsibleExecutionJobErrorMessage = "AnsibleExecutionJob error occured %s"
)

Common Messages used by AnsibleEE objects.

View Source
const (
	// JobStatusSucceeded -
	JobStatusSucceeded = "Succeeded"

	// JobStatusFailed -
	JobStatusFailed = "Failed"

	// JobStatusRunning -
	JobStatusRunning = "Running"

	// JobStatusPending -
	JobStatusPending = "Pending"
)
View Source
const (
	// AnsibleExecutionJobReadyCondition Status=True condition indicates
	// AnsibleExecutionJob is ready.
	AnsibleExecutionJobReadyCondition condition.Type = "AnsibleExecutionJobReady"
)

AnsibleEE Condition Types.

View Source
const (

	// OpenStackAnsibleEEContainerImage is the fall-back container image for OpenStackAnsibleEE
	OpenStackAnsibleEEContainerImage = "quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "ansibleee.openstack.org", 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

func SetupDefaults

func SetupDefaults()

SetupDefaults - initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)

func SetupOpenStackAnsibleEEDefaults

func SetupOpenStackAnsibleEEDefaults(defaults OpenStackAnsibleEEDefaults)

SetupOpenStackAnsibleEEDefaults - initialize OpenStackAnsibleEE spec defaults for use with either internal or external webhooks

Types

type Config

type Config struct {
	// Name is the name of the ConfigMap that we want to mount
	Name string `json:"name"`
	// MountPoint is the directory of the container where the ConfigMap will be mounted
	MountPath string `json:"mountpath"`
}

Config is a specification of where to mount a certain ConfigMap object

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

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

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

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

type ImportRole

type ImportRole struct {
	Name      string `json:"name" yaml:"name"`
	TasksFrom string `json:"tasks_from,omitempty" yaml:"tasks_from,omitempty"`
}

ImportRole contains the actual rolename and tasks file name to execute

func (*ImportRole) DeepCopy

func (in *ImportRole) DeepCopy() *ImportRole

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

func (*ImportRole) DeepCopyInto

func (in *ImportRole) DeepCopyInto(out *ImportRole)

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

type OpenStackAnsibleEE

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

	Spec   OpenStackAnsibleEESpec   `json:"spec,omitempty"`
	Status OpenStackAnsibleEEStatus `json:"status,omitempty"`
}

OpenStackAnsibleEE is the Schema for the openstackansibleees API

func (*OpenStackAnsibleEE) DeepCopy

func (in *OpenStackAnsibleEE) DeepCopy() *OpenStackAnsibleEE

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

func (*OpenStackAnsibleEE) DeepCopyInto

func (in *OpenStackAnsibleEE) DeepCopyInto(out *OpenStackAnsibleEE)

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

func (*OpenStackAnsibleEE) DeepCopyObject

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

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

func (*OpenStackAnsibleEE) Default

func (r *OpenStackAnsibleEE) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (OpenStackAnsibleEE) IsReady

func (instance OpenStackAnsibleEE) IsReady() bool

IsReady - returns true if the OpenStackAnsibleEE is ready

func (*OpenStackAnsibleEE) SetupWebhookWithManager

func (r *OpenStackAnsibleEE) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager sets up the webhook with the Manager

func (*OpenStackAnsibleEE) ValidateCreate

func (r *OpenStackAnsibleEE) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*OpenStackAnsibleEE) ValidateDelete

func (r *OpenStackAnsibleEE) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*OpenStackAnsibleEE) ValidateUpdate

func (r *OpenStackAnsibleEE) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type OpenStackAnsibleEEDefaults

type OpenStackAnsibleEEDefaults struct {
	ContainerImageURL string
}

OpenStackAnsibleEEDefaults -

func (*OpenStackAnsibleEEDefaults) DeepCopy

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

func (*OpenStackAnsibleEEDefaults) DeepCopyInto

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

type OpenStackAnsibleEEList

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

OpenStackAnsibleEEList contains a list of OpenStackAnsibleEE

func (*OpenStackAnsibleEEList) DeepCopy

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

func (*OpenStackAnsibleEEList) DeepCopyInto

func (in *OpenStackAnsibleEEList) DeepCopyInto(out *OpenStackAnsibleEEList)

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

func (*OpenStackAnsibleEEList) DeepCopyObject

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

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

type OpenStackAnsibleEESpec

type OpenStackAnsibleEESpec struct {

	// Play is the playbook contents that ansible will run on execution.
	// If both Play and Roles are specified, Play takes precedence
	Play string `json:"play,omitempty"`
	// Playbook is the playbook that ansible will run on this execution
	Playbook string `json:"playbook,omitempty"`
	// Image is the container image that will execute the ansible command
	Image string `json:"image,omitempty"`
	// Args are the command plus the playbook executed by the image. If args is passed, Playbook is ignored.
	Args []string `json:"args,omitempty"`
	// Name is the name of the internal container inside the pod
	// +kubebuilder:default:="openstackansibleee"
	Name string `json:"name,omitempty"`
	// EnvConfigMapName is the name of the k8s config map that contains the ansible env variables
	// +kubebuilder:default:="openstack-aee-default-env"
	EnvConfigMapName string `json:"envConfigMapName,omitempty"`
	// Env is a list containing the environment variables to pass to the pod
	Env []corev1.EnvVar `json:"env,omitempty"`
	// RestartPolicy is the policy applied to the Job on whether it needs to restart the Pod. It can be "OnFailure" or "Never".
	// RestartPolicy default: Never
	// +kubebuilder:validation:Enum:=OnFailure;Never
	// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:select:OnFailure","urn:alm:descriptor:com.tectonic.ui:select:Never"}
	// +kubebuilder:default:="Never"
	RestartPolicy string `json:"restartPolicy,omitempty"`
	// PreserveJobs - do not delete jobs after they finished e.g. to check logs
	// PreserveJobs default: true
	// +kubebuilder:validation:Enum:=true;false
	// +kubebuilder:default:=true
	PreserveJobs bool `json:"preserveJobs,omitempty"`
	// UID is the userid that will be used to run the container.
	// +kubebuilder:default:=1001
	UID int64 `json:"uid,omitempty"`
	// Inventory is the inventory that the ansible playbook will use to launch the job.
	Inventory string `json:"inventory,omitempty"`
	// +kubebuilder:validation:Optional
	// ExtraMounts containing conf files and credentials
	ExtraMounts []storage.VolMounts `json:"extraMounts,omitempty"`
	// BackoffLimit allows to define the maximum number of retried executions (defaults to 6).
	// +kubebuilder:default:=6
	// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:number"}
	BackoffLimit *int32 `json:"backoffLimit,omitempty"`
	// Role is the description of an Ansible Role
	// If both Play and Role are specified, Play takes precedence
	// +kubebuilder:validation:Optional
	Role *Role `json:"roles,omitempty"`
	// +kubebuilder:validation:Optional
	// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
	NetworkAttachments []string `json:"networkAttachments,omitempty"`
	// +kubebuilder:validation:Optional
	// CmdLine is the command line passed to ansible-runner
	CmdLine string `json:"cmdLine,omitempty"`
	// +kubebuilder:validation:Optional
	// InitContainers allows the passing of an array of containers that will be executed before the ansibleee execution itself
	InitContainers []corev1.Container `json:"initContainers,omitempty"`
	// +kubebuilder:validation:Optional
	// ServiceAccountName allows to specify what ServiceAccountName do we want the ansible execution run with. Without specifying,
	// it will run with default serviceaccount
	ServiceAccountName string `json:"serviceAccountName,omitempty"`
	// DNSConfig allows to specify custom dnsservers and search domains
	// +kubebuilder:validation:Optional
	DNSConfig *corev1.PodDNSConfig `json:"dnsConfig,omitempty"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	// Debug run the pod in debug mode without executing the ansible-runner commands
	Debug bool `json:"debug"`
}

OpenStackAnsibleEESpec defines the desired state of OpenStackAnsibleEE

func NewOpenStackAnsibleEE

func NewOpenStackAnsibleEE(name string) OpenStackAnsibleEESpec

NewOpenStackAnsibleEE returns a OpenStackAnsibleEESpec where the fields are defaulted according to the CRD definition

func (*OpenStackAnsibleEESpec) DeepCopy

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

func (*OpenStackAnsibleEESpec) DeepCopyInto

func (in *OpenStackAnsibleEESpec) DeepCopyInto(out *OpenStackAnsibleEESpec)

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

func (*OpenStackAnsibleEESpec) Default

func (spec *OpenStackAnsibleEESpec) Default()

Default - set defaults for this OpenStackAnsibleEE spec

type OpenStackAnsibleEEStatus

type OpenStackAnsibleEEStatus struct {

	// Map of hashes to track e.g. job status
	Hash map[string]string `json:"hash,omitempty"`

	// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
	// Conditions
	Conditions condition.Conditions `json:"conditions,omitempty" optional:"true"`

	// NetworkAttachments status of the deployment pods
	NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`

	// +kubebuilder:validation:Enum:=Pending;Running;Succeeded;Failed
	// +kubebuilder:default:=Pending
	// JobStatus status of the executed job (Pending/Running/Succeeded/Failed)
	JobStatus string `json:"JobStatus,omitempty" optional:"true"`
}

OpenStackAnsibleEEStatus defines the observed state of OpenStackAnsibleEE

func (*OpenStackAnsibleEEStatus) DeepCopy

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

func (*OpenStackAnsibleEEStatus) DeepCopyInto

func (in *OpenStackAnsibleEEStatus) DeepCopyInto(out *OpenStackAnsibleEEStatus)

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

type Role

type Role struct {
	// +kubebuilder:default:="Run Standalone Role"
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// +kubebuilder:default:="{{ primary_role_name | default([]) }}:{{ deploy_target_host | default('overcloud') }}"
	Hosts string `json:"hosts,omitempty" yaml:"hosts,omitempty"`
	// +kubebuilder:default:=linear
	// strategy defaults to linear
	Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"`
	// +kubebuilder:default:=true
	// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
	// any_errors_fatal defaults to true
	AnyErrorsFatal bool `json:"any_errors_fatal,omitempty" yaml:"any_errors_fatal,omitempty"`
	// +kubebuilder:default:=false
	// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
	// become defaults to false
	Become bool `json:"become,omitempty" yaml:"become,omitempty"`
	// +kubebuilder:default:=false
	// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
	// gather_facts defaults to false
	GatherFacts bool   `json:"gather_facts,omitempty" yaml:"gather_facts,omitempty"`
	Tasks       []Task `json:"tasks,omitempty" yaml:"tasks,omitempty"`
}

Role describes the format of an ansible playbook destinated to run roles

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 Task

type Task struct {
	Name       string     `json:"name" yaml:"name"`
	ImportRole ImportRole `json:"import_role" yaml:"import_role"`
	Vars       []string   `json:"vars,omitempty" yaml:"vars,omitempty"`
	When       string     `json:"when,omitempty" yaml:"when,omitempty"`
	Tags       []string   `json:"tags,omitempty" yaml:"tags,omitempty"`
}

Task describes a task centered exclusively in running import_role

func (*Task) DeepCopy

func (in *Task) DeepCopy() *Task

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

func (*Task) DeepCopyInto

func (in *Task) DeepCopyInto(out *Task)

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