Documentation ¶
Overview ¶
+groupName=skiperator.kartverket.no +versionName=v1alpha1
Index ¶
- Variables
- func GetStaticReplicas(jsonReplicas *apiextensionsv1.JSON) (uint, error)
- func IsHPAEnabled(jsonReplicas *apiextensionsv1.JSON) bool
- func MarshalledReplicas(replicas interface{}) *apiextensionsv1.JSON
- type Application
- func (a *Application) CalculateApplicationStatus() Status
- func (in *Application) DeepCopy() *Application
- func (in *Application) DeepCopyInto(out *Application)
- func (in *Application) DeepCopyObject() runtime.Object
- func (a *Application) FillDefaultsSpec()
- func (a *Application) FillDefaultsStatus()
- func (a *Application) ShouldUpdateApplicationStatus(newStatus Status) bool
- func (a *Application) UpdateApplicationStatus()
- func (a *Application) UpdateControllerStatus(controllerName string, message string, status StatusNames)
- type ApplicationList
- type ApplicationSpec
- type ApplicationStatus
- type AuthorizationSettings
- type ContainerSettings
- type CronSettings
- type JobSettings
- type PrometheusConfig
- type Replicas
- type SKIPJob
- type SKIPJobList
- type SKIPJobSpec
- type SKIPJobStatus
- type Status
- type StatusNames
- type Strategy
Constants ¶
This section is empty.
Variables ¶
var ( GroupVersion = schema.GroupVersion{Group: "skiperator.kartverket.no", Version: "v1alpha1"} AddToScheme = schemeBuilder.AddToScheme )
var ( DefaultTTLSecondsAfterFinished = int32(60 * 60 * 24 * 7) // One week DefaultBackoffLimit = int32(6) DefaultSuspend = false )
var JobCreatedCondition = "SKIPJobCreated"
Functions ¶
func GetStaticReplicas ¶ added in v1.0.0
func GetStaticReplicas(jsonReplicas *apiextensionsv1.JSON) (uint, error)
func IsHPAEnabled ¶ added in v1.0.0
func IsHPAEnabled(jsonReplicas *apiextensionsv1.JSON) bool
func MarshalledReplicas ¶ added in v1.0.0
func MarshalledReplicas(replicas interface{}) *apiextensionsv1.JSON
Types ¶
type Application ¶
type Application struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ApplicationSpec `json:"spec,omitempty"` Status ApplicationStatus `json:"status,omitempty"` }
+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName="app" +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.application.status`
func (*Application) CalculateApplicationStatus ¶ added in v0.1.5
func (a *Application) CalculateApplicationStatus() Status
func (*Application) DeepCopy ¶
func (in *Application) DeepCopy() *Application
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Application.
func (*Application) DeepCopyInto ¶
func (in *Application) DeepCopyInto(out *Application)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Application) DeepCopyObject ¶
func (in *Application) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Application) FillDefaultsSpec ¶ added in v0.1.5
func (a *Application) FillDefaultsSpec()
func (*Application) FillDefaultsStatus ¶ added in v0.1.5
func (a *Application) FillDefaultsStatus()
func (*Application) ShouldUpdateApplicationStatus ¶ added in v0.1.5
func (a *Application) ShouldUpdateApplicationStatus(newStatus Status) bool
func (*Application) UpdateApplicationStatus ¶ added in v0.1.5
func (a *Application) UpdateApplicationStatus()
func (*Application) UpdateControllerStatus ¶ added in v0.1.5
func (a *Application) UpdateControllerStatus(controllerName string, message string, status StatusNames)
type ApplicationList ¶
type ApplicationList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Application `json:"items"` }
+kubebuilder:object:root=true
func (*ApplicationList) DeepCopy ¶
func (in *ApplicationList) DeepCopy() *ApplicationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationList.
func (*ApplicationList) DeepCopyInto ¶
func (in *ApplicationList) DeepCopyInto(out *ApplicationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ApplicationList) DeepCopyObject ¶
func (in *ApplicationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ApplicationSpec ¶
type ApplicationSpec struct { //+kubebuilder:validation:Required Image string `json:"image"` //+kubebuilder:validation:Enum=low;medium;high //+kubebuilder:default=medium Priority string `json:"priority,omitempty"` //+kubebuilder:validation:Optional Command []string `json:"command,omitempty"` //+kubebuilder:validation:Optional Resources *podtypes.ResourceRequirements `json:"resources,omitempty"` //+kubebuilder:validation:Optional Replicas *apiextensionsv1.JSON `json:"replicas,omitempty"` //+kubebuilder:validation:Optional Strategy Strategy `json:"strategy,omitempty"` //+kubebuilder:validation:Optional Env []corev1.EnvVar `json:"env,omitempty"` //+kubebuilder:validation:Optional EnvFrom []podtypes.EnvFrom `json:"envFrom,omitempty"` //+kubebuilder:validation:Optional FilesFrom []podtypes.FilesFrom `json:"filesFrom,omitempty"` //+kubebuilder:validation:Required Port int `json:"port"` //+kubebuilder:validation:Optional AdditionalPorts []podtypes.InternalPort `json:"additionalPorts,omitempty"` //+kubebuilder:validation:Optional Prometheus *PrometheusConfig `json:"prometheus,omitempty"` //+kubebuilder:validation:Optional Liveness *podtypes.Probe `json:"liveness,omitempty"` //+kubebuilder:validation:Optional Readiness *podtypes.Probe `json:"readiness,omitempty"` //+kubebuilder:validation:Optional Startup *podtypes.Probe `json:"startup,omitempty"` // Ingresses must be lower case, contain no spaces, be a non-empty string, and have a hostname/domain separated by a period // //+kubebuilder:validation:Optional Ingresses []string `json:"ingresses,omitempty"` // Controls whether the application will automatically redirect all HTTP calls to HTTPS via the istio VirtualService. // This redirect does not happen on the route /.well-known/acme-challenge/, as the ACME challenge can only be done on port 80. // //+kubebuilder:validation:Optional //+kubebuilder:default:=true RedirectToHTTPS *bool `json:"redirectToHTTPS,omitempty"` // Whether to enable automatic Pod Disruption Budget creation for this application. // //+kubebuilder:validation:Optional //+kubebuilder:default=true EnablePDB *bool `json:"enablePDB,omitempty"` //+kubebuilder:validation:Optional AccessPolicy *podtypes.AccessPolicy `json:"accessPolicy,omitempty"` //+kubebuilder:validation:Optional GCP *podtypes.GCP `json:"gcp,omitempty"` //+kubebuilder:validation:Optional Labels map[string]string `json:"labels,omitempty"` //+kubebuilder:validation:Optional ResourceLabels map[string]map[string]string `json:"resourceLabels,omitempty"` //+kubebuilder:validation:Optional AuthorizationSettings *AuthorizationSettings `json:"authorizationSettings,omitempty"` }
+kubebuilder:object:generate=true
func (*ApplicationSpec) DeepCopy ¶
func (in *ApplicationSpec) DeepCopy() *ApplicationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationSpec.
func (*ApplicationSpec) DeepCopyInto ¶
func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ApplicationStatus ¶ added in v0.1.5
type ApplicationStatus struct { ApplicationStatus Status `json:"application"` ControllersStatus map[string]Status `json:"controllers"` }
+kubebuilder:object:generate=true
func (*ApplicationStatus) DeepCopy ¶ added in v0.1.5
func (in *ApplicationStatus) DeepCopy() *ApplicationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationStatus.
func (*ApplicationStatus) DeepCopyInto ¶ added in v0.1.5
func (in *ApplicationStatus) DeepCopyInto(out *ApplicationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AuthorizationSettings ¶ added in v1.0.0
type AuthorizationSettings struct { // Allows all endpoints by not creating an AuthorizationPolicy, and ignores the content of AllowList. // If field is false, the contents of AllowList will be used instead if AllowList is set. // //+kubebuilder:validation:Optional //+kubebuilder:default:=false AllowAll bool `json:"allowAll,omitempty"` // Allows specific endpoints. Common endpoints one might want to allow include /actuator/health, /actuator/startup, /actuator/info. // // Note that endpoints are matched specifically on the input, so if you allow /actuator/health, you will *not* allow /actuator/health/ // //+kubebuilder:validation:Optional AllowList []string `json:"allowList,omitempty"` }
AuthorizationSettings Settings for overriding the default deny of all actuator endpoints. AllowAll will allow any endpoint to be exposed. Use AllowList to only allow specific endpoints.
Please be aware that HTTP endpoints, such as actuator, may expose information about your application which you do not want to expose. Before allow listing HTTP endpoints, make note of what these endpoints will expose, especially if your application is served via an external ingress.
+kubebuilder:object:generate=true
func (*AuthorizationSettings) DeepCopy ¶ added in v1.0.0
func (in *AuthorizationSettings) DeepCopy() *AuthorizationSettings
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizationSettings.
func (*AuthorizationSettings) DeepCopyInto ¶ added in v1.0.0
func (in *AuthorizationSettings) DeepCopyInto(out *AuthorizationSettings)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ContainerSettings ¶ added in v1.0.0
type ContainerSettings struct { //+kubebuilder:validation:Required Image string `json:"image"` //+kubebuilder:validation:Enum=low;medium;high //+kubebuilder:default=medium Priority string `json:"priority,omitempty"` //+kubebuilder:validation:Optional Command []string `json:"command,omitempty"` //+kubebuilder:validation:Optional Resources *podtypes.ResourceRequirements `json:"resources,omitempty"` //+kubebuilder:validation:Optional Env []corev1.EnvVar `json:"env,omitempty"` //+kubebuilder:validation:Optional EnvFrom []podtypes.EnvFrom `json:"envFrom,omitempty"` //+kubebuilder:validation:Optional FilesFrom []podtypes.FilesFrom `json:"filesFrom,omitempty"` //+kubebuilder:validation:Optional AdditionalPorts []podtypes.InternalPort `json:"additionalPorts,omitempty"` //+kubebuilder:validation:Optional Liveness *podtypes.Probe `json:"liveness,omitempty"` //+kubebuilder:validation:Optional Readiness *podtypes.Probe `json:"readiness,omitempty"` //+kubebuilder:validation:Optional Startup *podtypes.Probe `json:"startup,omitempty"` //+kubebuilder:validation:Optional AccessPolicy *podtypes.AccessPolicy `json:"accessPolicy,omitempty"` //+kubebuilder:validation:Optional GCP *podtypes.GCP `json:"gcp,omitempty"` // +kubebuilder:validation:Enum=OnFailure;Never // +kubebuilder:default="Never" // +kubebuilder:validation:Optional RestartPolicy *corev1.RestartPolicy `json:"restartPolicy"` }
+kubebuilder:object:generate=true
func (*ContainerSettings) DeepCopy ¶ added in v1.0.0
func (in *ContainerSettings) DeepCopy() *ContainerSettings
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerSettings.
func (*ContainerSettings) DeepCopyInto ¶ added in v1.0.0
func (in *ContainerSettings) DeepCopyInto(out *ContainerSettings)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CronSettings ¶ added in v1.0.0
type CronSettings struct { // Denotes how Kubernetes should react to multiple instances of the Job being started at the same time. // Allow will allow concurrent jobs. Forbid will not allow this, and instead skip the newer schedule Job. // Replace will replace the current active Job with the newer scheduled Job. // // +kubebuilder:validation:Enum=Allow;Forbid;Replace // +kubebuilder:default="Allow" // +kubebuilder:validation:Optional ConcurrencyPolicy batchv1.ConcurrencyPolicy `json:"allowConcurrency,omitempty"` // A CronJob string for denoting the schedule of this job. See https://crontab.guru/ for help creating CronJob strings. // Kubernetes CronJobs also include the extended "Vixie cron" step values: https://man.freebsd.org/cgi/man.cgi?crontab%285%29. // //+kubebuilder:validation:Required Schedule string `json:"schedule"` // Denotes the deadline in seconds for starting a job on its schedule, if for some reason the Job's controller was not ready upon the scheduled time. // If unset, Jobs missing their deadline will be considered failed jobs and will not start. // //+kubebuilder:validation:Optional StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"` // If set to true, this tells Kubernetes to suspend this Job till the field is set to false. If the Job is active while this field is set to true, // all running Pods will be terminated. // //+kubebuilder:validation:Optional Suspend *bool `json:"suspend,omitempty"` }
+kubebuilder:object:generate=true
func (*CronSettings) DeepCopy ¶ added in v1.0.0
func (in *CronSettings) DeepCopy() *CronSettings
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronSettings.
func (*CronSettings) DeepCopyInto ¶ added in v1.0.0
func (in *CronSettings) DeepCopyInto(out *CronSettings)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobSettings ¶ added in v1.0.0
type JobSettings struct { // ActiveDeadlineSeconds denotes a duration in seconds started from when the job is first active. If the deadline is reached during the job's workload // the job and its Pods are terminated. If the job is suspended using the Suspend field, this timer is stopped and reset when unsuspended. // //+kubebuilder:validation:Optional ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` // Specifies the number of retry attempts before determining the job as failed. Defaults to 6. // //+kubebuilder:validation:Optional BackoffLimit *int32 `json:"backoffLimit,omitempty"` // If set to true, this tells Kubernetes to suspend this Job till the field is set to false. If the Job is active while this field is set to false, // all running Pods will be terminated. // //+kubebuilder:validation:Optional Suspend *bool `json:"suspend,omitempty"` // The number of seconds to wait before removing the Job after it has finished. If unset, Job will not be cleaned up. // It is recommended to set this to avoid clutter in your resource tree. // //+kubebuilder:validation:Optional TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` }
+kubebuilder:object:generate=true
func (*JobSettings) DeepCopy ¶ added in v1.0.0
func (in *JobSettings) DeepCopy() *JobSettings
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSettings.
func (*JobSettings) DeepCopyInto ¶ added in v1.0.0
func (in *JobSettings) DeepCopyInto(out *JobSettings)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PrometheusConfig ¶ added in v1.0.0
type PrometheusConfig struct { // The port number or name where metrics are exposed (at the Pod level). //+kubebuilder:validation:Required Port intstr.IntOrString `json:"port"` // The HTTP path where Prometheus compatible metrics exists //+kubebuilder:default:=/metrics //+kubebuilder:validation:Optional Path string `json:"path,omitempty"` }
PrometheusConfig contains configuration settings instructing how the app should be scraped. +kubebuilder:object:generate=true
func (*PrometheusConfig) DeepCopy ¶ added in v1.0.0
func (in *PrometheusConfig) DeepCopy() *PrometheusConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusConfig.
func (*PrometheusConfig) DeepCopyInto ¶ added in v1.0.0
func (in *PrometheusConfig) DeepCopyInto(out *PrometheusConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Replicas ¶
type Replicas struct { //+kubebuilder:validation:Required Min uint `json:"min"` //+kubebuilder:validation:Optional Max uint `json:"max,omitempty"` //+kubebuilder:default:=80 //+kubebuilder:validation:Optional TargetCpuUtilization uint `json:"targetCpuUtilization,omitempty"` }
+kubebuilder:object:generate=true
func GetScalingReplicas ¶ added in v1.0.0
func GetScalingReplicas(jsonReplicas *apiextensionsv1.JSON) (Replicas, error)
func NewDefaultReplicas ¶ added in v1.0.0
func NewDefaultReplicas() Replicas
func (*Replicas) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Replicas.
func (*Replicas) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SKIPJob ¶ added in v1.0.0
type SKIPJob struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` //+kubebuilder:validation:Required Spec SKIPJobSpec `json:"spec"` //+kubebuilder:validation:Optional Status SKIPJobStatus `json:"status"` }
+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:object:generate=true SKIPJob is the Schema for the skipjobs API
func (*SKIPJob) ApplyDefaults ¶ added in v1.0.0
func (*SKIPJob) DeepCopy ¶ added in v1.0.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SKIPJob.
func (*SKIPJob) DeepCopyInto ¶ added in v1.0.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SKIPJob) DeepCopyObject ¶ added in v1.0.0
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*SKIPJob) KindPostFixedName ¶ added in v1.0.0
type SKIPJobList ¶ added in v1.0.0
type SKIPJobList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []SKIPJob `json:"items"` }
SKIPJobList contains a list of SKIPJob
func (*SKIPJobList) DeepCopy ¶ added in v1.0.0
func (in *SKIPJobList) DeepCopy() *SKIPJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SKIPJobList.
func (*SKIPJobList) DeepCopyInto ¶ added in v1.0.0
func (in *SKIPJobList) DeepCopyInto(out *SKIPJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SKIPJobList) DeepCopyObject ¶ added in v1.0.0
func (in *SKIPJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type SKIPJobSpec ¶ added in v1.0.0
type SKIPJobSpec struct { // Settings for the actual Job. If you use a scheduled job, the settings in here will also specify the template of the job. // //+kubebuilder:validation:Optional Job *JobSettings `json:"job,omitempty"` // Settings for the Job if you are running a scheduled job. Optional as Jobs may be one-off. // //+kubebuilder:validation:Optional Cron *CronSettings `json:"cron,omitempty"` // Settings for the Pods running in the job. Fields are mostly the same as an Application, and are (probably) better documented there. Some fields are omitted, but none added. // Once set, you may not change Container without deleting your current SKIPJob // // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="The field Container is immutable. Please delete your SKIPJob to change the containers settings." // +kubebuilder:validation:Required Container ContainerSettings `json:"container"` }
SKIPJobSpec defines the desired state of SKIPJob
A SKIPJob is either defined as a one-off or a scheduled job. If the Cron field is set for SKIPJob, it may not be removed. If the Cron field is unset, it may not be added. The Container settings of a SKIPJob is also immutable, and may not be changed after creating a SKIPJob.
+kubebuilder:validation:XValidation:rule="(has(oldSelf.cron) && has(self.cron)) || (!has(oldSelf.cron) && !has(self.cron))", message="After creation of a SKIPJob you may not remove the Cron field if it was previously present, or add it if it was previously omitted. Please delete the SKIPJob to change its nature from a one-off/scheduled job." +kubebuilder:object:generate=true
func (*SKIPJobSpec) DeepCopy ¶ added in v1.0.0
func (in *SKIPJobSpec) DeepCopy() *SKIPJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SKIPJobSpec.
func (*SKIPJobSpec) DeepCopyInto ¶ added in v1.0.0
func (in *SKIPJobSpec) DeepCopyInto(out *SKIPJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SKIPJobStatus ¶ added in v1.0.0
type SKIPJobStatus struct { //+kubebuilder:validation:Optional Conditions []metav1.Condition `json:"conditions"` }
SKIPJobStatus defines the observed state of SKIPJob +kubebuilder:object:generate=true
func (*SKIPJobStatus) DeepCopy ¶ added in v1.0.0
func (in *SKIPJobStatus) DeepCopy() *SKIPJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SKIPJobStatus.
func (*SKIPJobStatus) DeepCopyInto ¶ added in v1.0.0
func (in *SKIPJobStatus) DeepCopyInto(out *SKIPJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Status ¶ added in v0.1.5
type Status struct { // +kubebuilder:default="Synced" Status StatusNames `json:"status"` // +kubebuilder:default="hello" Message string `json:"message"` // +kubebuilder:default="hello" TimeStamp string `json:"timestamp"` }
+kubebuilder:object:generate=true
func (*Status) DeepCopy ¶ added in v0.1.5
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.
func (*Status) DeepCopyInto ¶ added in v0.1.5
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StatusNames ¶ added in v0.1.5
type StatusNames string
const ( SYNCED StatusNames = "Synced" PROGRESSING StatusNames = "Progressing" ERROR StatusNames = "Error" PENDING StatusNames = "Pending" )
type Strategy ¶ added in v0.1.2
type Strategy struct { // +kubebuilder:default:=RollingUpdate // +kubebuilder:validation:Optional // +kubebuilder:validation:Enum=RollingUpdate;Recreate Type string `json:"type,omitempty"` }
+kubebuilder:object:generate=true
func (*Strategy) DeepCopy ¶ added in v1.0.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Strategy.
func (*Strategy) DeepCopyInto ¶ added in v1.0.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.