v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. GameServer and GameServerSet crd are designed based on Google agones. +groupName=carrier.ocgi.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder initializes a scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: carrier.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CanaryUpdateSquad

type CanaryUpdateSquad struct {
	// Type of update GameServer. Can be "deleteFirst" or "createFirst" or "inplace". Default is "createFirst".
	Type GameServerStrategyType `json:"type"`
	// The number of GameServers than can be updated
	// Value can be an absolute number(ex: 5) or a percentage of total GameServers at
	// the start of the update (ex: 10%)
	Threshold *intstr.IntOrString `json:"threshold"`
}

CanaryUpdateSquad controls the desired behavior of canary update.

func (*CanaryUpdateSquad) DeepCopy

func (in *CanaryUpdateSquad) DeepCopy() *CanaryUpdateSquad

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

func (*CanaryUpdateSquad) DeepCopyInto

func (in *CanaryUpdateSquad) DeepCopyInto(out *CanaryUpdateSquad)

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

type ConditionStatus

type ConditionStatus string

ConditionStatus includes True or False

const (
	ConditionTrue  ConditionStatus = "True"
	ConditionFalse ConditionStatus = "False"
)

These are valid condition statuses. "ConditionTrue" means a resource is in the condition. "ConditionFalse" means a resource is not in the condition.

type Configurations

type Configurations struct {
	// ClientConfig is the config for the webhook
	ClientConfig v1.WebhookClientConfig `json:"clientConfig"`

	// Name is the webhook name, which should be same as the
	// config in GameServer or Squad annotations.
	// e.g, annotation is `carrier.ocgi.dev/webhook-config-name: ds-webhook`
	// then the name here should be `ds-webhook`.
	Name *string `json:"name,omitempty"`
	// Type includes `ReadinessWebhook`, `DeletableWebhook` and `ConstraintWebhook`
	Type *string `json:"type,omitempty"`
	// TimeoutSeconds means http request timeout
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
	// PeriodSeconds means http request frequency.
	PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
	// RequestPolicy defines request sdk server request policy
	RequestPolicy RequestPolicy `json:"requestPolicy,omitempty"`
}

Configurations defines the webhook configuration.

func (*Configurations) DeepCopy

func (in *Configurations) DeepCopy() *Configurations

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

func (*Configurations) DeepCopyInto

func (in *Configurations) DeepCopyInto(out *Configurations)

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

type Constraint

type Constraint struct {
	// Type is the ConstraintType name, e.g. NotInService.
	Type ConstraintType `json:"type"`
	// Effective describes whether the constraint is effective.
	Effective *bool `json:"effective,omitempty"`
	// Message explains why this constraint is added.
	Message string `json:"message,omitempty"`
	// TimeAdded describes when it is added.
	TimeAdded *metav1.Time `json:"timeAdded,omitempty"`
}

Constraint describes the constraint info of GameServer.

func (*Constraint) DeepCopy

func (in *Constraint) DeepCopy() *Constraint

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

func (*Constraint) DeepCopyInto

func (in *Constraint) DeepCopyInto(out *Constraint)

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

type ConstraintType

type ConstraintType string

ConstraintType describes the constraint name

const NotInService ConstraintType = `NotInService`

NotInService is one of the ConstraintTypes, which marks GameServer should close the connection.

type GameServer

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

	Spec   GameServerSpec   `json:"spec"`
	Status GameServerStatus `json:"status"`
}

GameServer is the data structure for a GameServer resource.

func (*GameServer) DeepCopy

func (in *GameServer) DeepCopy() *GameServer

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

func (*GameServer) DeepCopyInto

func (in *GameServer) DeepCopyInto(out *GameServer)

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

func (*GameServer) DeepCopyObject

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

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

type GameServerCondition

type GameServerCondition struct {
	// Type is the type of the condition.
	Type GameServerConditionType `json:"type"`
	// Status is the status of the condition.
	// Can be True, False.
	Status ConditionStatus `json:"status"`
	// Last time we probed the condition.
	LastProbeTime metav1.Time `json:"lastProbeTime"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`
	// Message enables setting more information to a GameServer.
	// For example:
	// When a GameServer starts up, set number of allocatable players,
	// then if a player connects, change the number, which makes
	// developing a gpa webhook based on online players possible.
	Message string `json:"message,omitempty"`
}

GameServerCondition contains details for the current condition of this GameServer.

func (*GameServerCondition) DeepCopy

func (in *GameServerCondition) DeepCopy() *GameServerCondition

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

func (*GameServerCondition) DeepCopyInto

func (in *GameServerCondition) DeepCopyInto(out *GameServerCondition)

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

type GameServerConditionType

type GameServerConditionType string

GameServerConditionType is a valid value for GameServerCondition.Type

type GameServerList

type GameServerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []GameServer `json:"items"`
}

GameServerList is a list of GameServer resources

func (*GameServerList) DeepCopy

func (in *GameServerList) DeepCopy() *GameServerList

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

func (*GameServerList) DeepCopyInto

func (in *GameServerList) DeepCopyInto(out *GameServerList)

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

func (*GameServerList) DeepCopyObject

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

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

type GameServerPort

type GameServerPort struct {
	// Name is the descriptive name of the port.
	Name string `json:"name,omitempty"`
	// ContainerPort is the port that is being opened on the specified container's process.
	ContainerPort *int32 `json:"containerPort,omitempty"`
	// ContainerPortRange is the port range that is being opened on the specified container's process.
	ContainerPortRange *PortRange `json:"containerPortRange,omitempty"`
	// PortPolicy describes the policy to allocate ports. Dynamic is currently not implemented.
	PortPolicy PortPolicy `json:"portPolicy,omitempty"`
	// HostPort the port exposed on the host for clients to connect to.
	HostPort *int32 `json:"hostPort,omitempty"`
	// HostPortRange is the port range that exposed on the host for clients to connect to.
	HostPortRange *PortRange `json:"hostPortRange,omitempty"`
	// Protocol is the network protocol being used. Defaults to UDP. TCP and TCPUDP are other options.
	Protocol corev1.Protocol `json:"protocol,omitempty"`
}

GameServerPort defines a set of Ports that. are to be exposed via the GameServer.

func (*GameServerPort) DeepCopy

func (in *GameServerPort) DeepCopy() *GameServerPort

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

func (*GameServerPort) DeepCopyInto

func (in *GameServerPort) DeepCopyInto(out *GameServerPort)

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

type GameServerSet

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

	Spec   GameServerSetSpec   `json:"spec"`
	Status GameServerSetStatus `json:"status"`
}

GameServerSet is the data structure for a set of GameServers.

func (*GameServerSet) DeepCopy

func (in *GameServerSet) DeepCopy() *GameServerSet

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

func (*GameServerSet) DeepCopyInto

func (in *GameServerSet) DeepCopyInto(out *GameServerSet)

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

func (*GameServerSet) DeepCopyObject

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

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

type GameServerSetCondition

type GameServerSetCondition struct {
	// Type of GameServerSet condition.
	Type GameServerSetConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// The last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`
	// The reason for the condition's last transition.
	Reason string `json:"reason"`
	// A human readable message indicating details about the transition.
	Message string `json:"message"`
}

GameServerSetCondition describes the state of a GameServerSet at a certain point.

func (*GameServerSetCondition) DeepCopy

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

func (*GameServerSetCondition) DeepCopyInto

func (in *GameServerSetCondition) DeepCopyInto(out *GameServerSetCondition)

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

type GameServerSetConditionType

type GameServerSetConditionType string
const (
	// GameServerSetReplicaFailure is added in a GameServerSet when one of its GameServers fails to be created
	// due to insufficient quota, limit ranges, GameServer security policy, node selectors, etc. or deleted
	// due to kubelet being down or finalizers are failing.
	GameServerSetReplicaFailure GameServerSetConditionType = "ReplicaFailure"
	// GameServerSetScalingInProgress is the state that GameServerSet is scaling. This would be added the condition of
	// GameServerSet, this condition should be set by squad controller and would be removed when GameServerSet
	// finishes scaling.
	GameServerSetScalingInProgress GameServerSetConditionType = "ScalingInProgress"
)

These are valid conditions of a GameServerSet.

type GameServerSetList

type GameServerSetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []GameServerSet `json:"items"`
}

GameServerSetList is a list of GameServerSet resources

func (*GameServerSetList) DeepCopy

func (in *GameServerSetList) DeepCopy() *GameServerSetList

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

func (*GameServerSetList) DeepCopyInto

func (in *GameServerSetList) DeepCopyInto(out *GameServerSetList)

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

func (*GameServerSetList) DeepCopyObject

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

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

type GameServerSetSpec

type GameServerSetSpec struct {
	// Replicas are the number of GameServers that should be in this set
	Replicas int32 `json:"replicas"`
	// Scheduling strategy. Defaults to "MostAllocated".
	Scheduling SchedulingStrategy `json:"scheduling,omitempty"`
	// Template the GameServer template to apply for this GameServerSet
	Template GameServerTemplateSpec `json:"template"`
	// Selector is a label query over pods that should match the replica count.
	// Label keys and values that must match in order to be controlled by this replica set.
	// It must match the pod template's labels.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
	Selector *metav1.LabelSelector `json:"selector,omitempty"`
	// ExcludeConstraints describes if we should exclude GameServer with constraints
	// when computing replicas
	ExcludeConstraints *bool `json:"excludeConstraints,omitempty"`
}

GameServerSetSpec the specification for GameServerSet

func (*GameServerSetSpec) DeepCopy

func (in *GameServerSetSpec) DeepCopy() *GameServerSetSpec

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

func (*GameServerSetSpec) DeepCopyInto

func (in *GameServerSetSpec) DeepCopyInto(out *GameServerSetSpec)

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

type GameServerSetStatus

type GameServerSetStatus struct {
	// Replicas is the total number of current GameServer replicas
	Replicas int32 `json:"replicas"`
	// ReadyReplicas is the number of Ready GameServer replicas
	ReadyReplicas int32 `json:"readyReplicas"`
	// ObservedGeneration is the most recent generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration"`
	// Represents the latest available observations of a GameServerSet's current state.
	Conditions []GameServerSetCondition `json:"conditions,omitempty"`
	// Selector is a string format, which is for scale
	Selector string `json:"selector,omitempty"`
}

GameServerSetStatus is the status of a GameServerSet

func (*GameServerSetStatus) DeepCopy

func (in *GameServerSetStatus) DeepCopy() *GameServerSetStatus

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

func (*GameServerSetStatus) DeepCopyInto

func (in *GameServerSetStatus) DeepCopyInto(out *GameServerSetStatus)

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

type GameServerSpec

type GameServerSpec struct {
	// Ports are the array of ports that can be exposed via the GameServer.
	Ports []GameServerPort `json:"ports"`

	// Scheduling strategy, including "LeastAllocated, MostAllocated, Default". Defaults to "MostAllocated".
	Scheduling SchedulingStrategy `json:"scheduling,omitempty"`

	// Template describes the Pod that will be created for the GameServer.
	Template corev1.PodTemplateSpec `json:"template"`

	// Constraints describes the constraints of GameServer.
	// This filed may be added or changed by controller or manually.
	// If anyone of them is `NotInService` and Effective is `True`,
	// GameServer container should not continue serving and should set `Retired` true, HasNoPlayer true
	// to conditions when it has closed the connection to players.
	Constraints []Constraint `json:"constraints,omitempty"`

	// If specified, all readiness gates will be evaluated for GameServer readiness.
	// A GameServer is ready when all its pod are ready AND
	// all conditions specified in the readiness gates have status equal to "True"
	// +optional
	ReadinessGates []string `json:"readinessGates,omitempty"`

	// If specified, all deletable gates will be evaluated for GameServer deletable.
	// A GameServer is deletable when all its pod are deletable AND
	// all conditions specified in the deletable gates have status equal to "True"
	// +optional
	DeletableGates []string `json:"deletableGates,omitempty"`
}

GameServerSpec is the spec for a GameServer resource.

func (*GameServerSpec) DeepCopy

func (in *GameServerSpec) DeepCopy() *GameServerSpec

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

func (*GameServerSpec) DeepCopyInto

func (in *GameServerSpec) DeepCopyInto(out *GameServerSpec)

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

type GameServerState

type GameServerState string

GameServerState is the state of a GameServer at the current time.

const (
	// GameServerStarting means the pod phase of GameServer is Pending or pod not existing
	GameServerStarting GameServerState = "Starting"
	// GameServerRunning means the pod phase of GameServer is Running
	GameServerRunning GameServerState = "Running"
	// GameServerExited means GameServer has exited
	GameServerExited GameServerState = "Exited"
	// GameServerFailed means the pod phase of GameServer is Failed
	GameServerFailed GameServerState = "Failed"
	// GameServerUnknown means the pod phase of GameServer is Unkown
	GameServerUnknown GameServerState = "Unknown"
)

These are the valid state of GameServer.

type GameServerStatus

type GameServerStatus struct {
	// GameServerState is the current state of a GameServer, e.g. Pending, Running, Succeeded, etc
	State GameServerState `json:"state,omitempty"`
	// Conditions represent GameServer conditions
	Conditions []GameServerCondition `json:"conditions,omitempty"`
	// Address is the IP address of GameServer
	Address string `json:"address,omitempty"`
	// NodeName is the K8s node name
	NodeName string `json:"nodeName,omitempty"`
	// LoadBalancerStatus is the load-balancer status
	LoadBalancerStatus *LoadBalancerStatus `json:"loadBalancerStatus,omitempty"`
}

GameServerStatus is the status for a GameServer resource.

func (*GameServerStatus) DeepCopy

func (in *GameServerStatus) DeepCopy() *GameServerStatus

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

func (*GameServerStatus) DeepCopyInto

func (in *GameServerStatus) DeepCopyInto(out *GameServerStatus)

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

type GameServerStrategyType

type GameServerStrategyType string
const (
	// DeleteFirstGameServerStrategyType Kill GameServer before creating new ones
	DeleteFirstGameServerStrategyType GameServerStrategyType = "deleteFirst"
	// CreateFirstGameServerStrategyType Create new GameServer before kill the old ones
	CreateFirstGameServerStrategyType GameServerStrategyType = "createFirst"
)

type GameServerTemplateSpec

type GameServerTemplateSpec struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              GameServerSpec `json:"spec"`
}

GameServerTemplateSpec is a template for GameServers

func (*GameServerTemplateSpec) DeepCopy

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

func (*GameServerTemplateSpec) DeepCopyInto

func (in *GameServerTemplateSpec) DeepCopyInto(out *GameServerTemplateSpec)

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

type InplaceUpdateSquad

type InplaceUpdateSquad struct {
	// The number of GameServers than can be updated
	// Value can be an absolute number(ex: 5) or a percentage of total GameServers at
	// the start of the update (ex: 10%)
	Threshold *intstr.IntOrString `json:"threshold"`
}

InplaceUpdateSquad to control the desired behavior of inplace update.

func (*InplaceUpdateSquad) DeepCopy

func (in *InplaceUpdateSquad) DeepCopy() *InplaceUpdateSquad

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

func (*InplaceUpdateSquad) DeepCopyInto

func (in *InplaceUpdateSquad) DeepCopyInto(out *InplaceUpdateSquad)

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

type LoadBalancerIngress

type LoadBalancerIngress struct {
	// IP is the IP of load-balancer.
	IP string `json:"ip"`
	// Ports  are the array of ports that can be exposed via the load-balancer for the GameServer.
	Ports []LoadBalancerPort `json:"ports"`
}

LoadBalancerIngress represents the status of a load-balancer ingress point.

func (*LoadBalancerIngress) DeepCopy

func (in *LoadBalancerIngress) DeepCopy() *LoadBalancerIngress

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

func (*LoadBalancerIngress) DeepCopyInto

func (in *LoadBalancerIngress) DeepCopyInto(out *LoadBalancerIngress)

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

type LoadBalancerPort

type LoadBalancerPort struct {
	// Name is the load balancer name
	Name string `json:"name,omitempty"`
	// ContainerPort is the port that is being opened on the container's process.
	ContainerPort *int32 `json:"containerPort,omitempty"`
	// ExternalPort is the load-balancer port that exposed to client.
	ExternalPort *int32 `json:"externalPort,omitempty"`
	// ContainerPortRange is a range of port that opened on the container's process.
	ContainerPortRange *PortRange `json:"containerPortRange,omitempty"`
	// ExternalPortRange is a range of load-balancer port that exposed to client.
	ExternalPortRange *PortRange `json:"externalPortRange,omitempty"`
	// Protocol is the network protocol being used. Defaults to UDP. TCP and TCPUDP are other options.
	Protocol corev1.Protocol `json:"protocol,omitempty"`
}

LoadBalancerPort describes load balancer info

func (*LoadBalancerPort) DeepCopy

func (in *LoadBalancerPort) DeepCopy() *LoadBalancerPort

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

func (*LoadBalancerPort) DeepCopyInto

func (in *LoadBalancerPort) DeepCopyInto(out *LoadBalancerPort)

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

type LoadBalancerStatus

type LoadBalancerStatus struct {
	// Ingress is a list containing ingress points for the load-balancer.
	Ingress []LoadBalancerIngress `json:"ingress,omitempty"`
}

LoadBalancerStatus represents the status of a load-balancer.

func (*LoadBalancerStatus) DeepCopy

func (in *LoadBalancerStatus) DeepCopy() *LoadBalancerStatus

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

func (*LoadBalancerStatus) DeepCopyInto

func (in *LoadBalancerStatus) DeepCopyInto(out *LoadBalancerStatus)

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

type PortPolicy

type PortPolicy string

PortPolicy is the port policy for the GameServer

const (
	// Static PortPolicy will use the port defined in the Pod spec or GameServerSpec.
	Static PortPolicy = "Static"
	// Dynamic PortPolicy will dynamically allocated host Ports.
	Dynamic PortPolicy = "Dynamic"
	// LoadBalancer PortPolicy will apply the port allocated from external load balacner.
	LoadBalancer PortPolicy = "LoadBalancer"
)

type PortRange

type PortRange struct {
	// MinPort is the start of the range, inclusive.
	MinPort int32 `json:"minPort"`
	// MaxPort is the end of the range, inclusive.
	MaxPort int32 `json:"maxPort"`
}

PortRange define a range of ports. It requires both the start and end to be defined.

func (*PortRange) DeepCopy

func (in *PortRange) DeepCopy() *PortRange

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

func (*PortRange) DeepCopyInto

func (in *PortRange) DeepCopyInto(out *PortRange)

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

type RequestPolicy

type RequestPolicy string

RequestPolicy defines request sdk server request policy

const (
	// RequestPolicyOnce means request only once if condition true
	RequestPolicyOnce RequestPolicy = "Once"
	// RequestPolicyAlways means always request(Default)
	RequestPolicyAlways RequestPolicy = "Always"
)

type RollbackConfig

type RollbackConfig struct {
	// The revision to rollback to. If set to 0, rollback to the last revision.
	Revision int64 `json:"revision"`
}

RollbackConfig is the rollback config for a Squad

func (*RollbackConfig) DeepCopy

func (in *RollbackConfig) DeepCopy() *RollbackConfig

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

func (*RollbackConfig) DeepCopyInto

func (in *RollbackConfig) DeepCopyInto(out *RollbackConfig)

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

type RollingUpdateSquad

type RollingUpdateSquad struct {
	// The maximum number of GameServers that can be unavailable during the update.
	// Value can be an absolute number (ex: 5) or a percentage of total GameServers at the start of update (ex: 10%).
	// Absolute number is calculated from percentage by rounding down.
	// This can not be 0 if MaxSurge is 0.
	// By default, a fixed value of 1 is used.
	// Example: when this is set to 30%, the old RC can be scaled down by 30%
	// immediately when the rolling update starts. Once new GameServers are ready, old RC
	// can be scaled down further, followed by scaling up the new RC, ensuring
	// that at least 70% of original number of GameServers are available at all times
	// during the update.
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable"`
	// The maximum number of GameServers that can be scheduled above the original number of
	// GameServers.
	// Value can be an absolute number (ex: 5) or a percentage of total GameServers at
	// the start of the update (ex: 10%). This can not be 0 if MaxUnavailable is 0.
	// Absolute number is calculated from percentage by rounding up.
	// By default, a value of 1 is used.
	// Example: when this is set to 30%, the new RC can be scaled up by 30%
	// immediately when the rolling update starts. Once old GameServers have been killed,
	// new RC can be scaled up further, ensuring that total number of GameServers running
	// at any time during the update is atmost 130% of original GameServers.
	MaxSurge *intstr.IntOrString `json:"maxSurge"`
}

RollingUpdateSquad controls the desired behavior of rolling update.

func (*RollingUpdateSquad) DeepCopy

func (in *RollingUpdateSquad) DeepCopy() *RollingUpdateSquad

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

func (*RollingUpdateSquad) DeepCopyInto

func (in *RollingUpdateSquad) DeepCopyInto(out *RollingUpdateSquad)

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

type SchedulingStrategy

type SchedulingStrategy string

SchedulingStrategy is the strategy that a Squad & GameServers will use when scheduling GameServers' Pods across a cluster.

const (
	// MostAllocated strategy will allocate GameServers
	// on Nodes with the most allocated by inject PodAffinity.
	MostAllocated SchedulingStrategy = "MostAllocated"

	// LeastAllocated strategy will prioritise allocating GameServers
	// on Nodes with the most allocated by inject PodAntiAffinity
	LeastAllocated SchedulingStrategy = "LeastAllocated"

	// Default will use scheduler default policy
	Default SchedulingStrategy = "Default"
)

type Squad

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

	Spec   SquadSpec   `json:"spec"`
	Status SquadStatus `json:"status"`
}

Squad is the data structure for a Squad resource

func (*Squad) DeepCopy

func (in *Squad) DeepCopy() *Squad

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

func (*Squad) DeepCopyInto

func (in *Squad) DeepCopyInto(out *Squad)

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

func (*Squad) DeepCopyObject

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

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

type SquadCondition

type SquadCondition struct {
	// Type of Squad condition.
	Type SquadConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// The last time this condition was updated.
	LastUpdateTime metav1.Time `json:"lastUpdateTime"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`
	// The reason for the condition's last transition.
	Reason string `json:"reason"`
	// A human readable message indicating details about the transition.
	Message string `json:"message"`
}

SquadCondition describes the state of a Squad at a certain point.

func (*SquadCondition) DeepCopy

func (in *SquadCondition) DeepCopy() *SquadCondition

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

func (*SquadCondition) DeepCopyInto

func (in *SquadCondition) DeepCopyInto(out *SquadCondition)

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

type SquadConditionType

type SquadConditionType string
const (
	// SquadProgressing means the Squad is progressing. Progress for a Squad is
	// considered when a new GameServer set is created or adopted, and when new GameServers scale
	// up or old GameServers scale down. Progress is not estimated for paused Squad or
	// when progressDeadlineSeconds is not specified.
	SquadProgressing SquadConditionType = "Progressing"
	// SquadReplicaFailure is added in a Squad when one of its GameServers fails to be created
	// or deleted.
	SquadReplicaFailure SquadConditionType = "ReplicaFailure"
)

These are valid conditions of a Squad.

type SquadList

type SquadList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []Squad `json:"items"`
}

SquadList is a list of Squad resources

func (*SquadList) DeepCopy

func (in *SquadList) DeepCopy() *SquadList

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

func (*SquadList) DeepCopyInto

func (in *SquadList) DeepCopyInto(out *SquadList)

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

func (*SquadList) DeepCopyObject

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

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

type SquadSpec

type SquadSpec struct {
	// Replicas are the number of GameServers that should be in this set. Defaults to 0.
	Replicas int32 `json:"replicas"`
	// Squad strategy,one of ReCreate, RollingUpdate, CanaryUpdate.
	Strategy SquadStrategy `json:"strategy,omitempty"`
	// Scheduling strategy. Defaults to "MostAllocated".
	Scheduling SchedulingStrategy `json:"scheduling,omitempty"`
	// Template the GameServer template to apply for this Squad
	Template GameServerTemplateSpec `json:"template"`
	// The number of old GameServerSets to retain to allow rollback.
	// This is a pointer to distinguish between explicit zero and not specified.
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
	// Indicates that the Squad is paused and will not be processed by the
	// Squad controller.
	Paused bool `json:"paused,omitempty"`
	// The config this Squad is rolling back to. Will be cleared after rollback is done.
	RollbackTo *RollbackConfig `json:"rollbackTo,omitempty"`
	// Selector is a label query over pods that should match the replica count.
	// Label keys and values that must match in order to be controlled by this replica set.
	// It must match the pod template's labels.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
	Selector *metav1.LabelSelector `json:"selector,omitempty"`
	// ExcludeConstraints describes if we should exclude GameServer with constraints
	// when computing replicas, default false.
	ExcludeConstraints *bool `json:"excludeConstraints,omitempty"`
}

SquadSpec is the spec for a Squad

func (*SquadSpec) DeepCopy

func (in *SquadSpec) DeepCopy() *SquadSpec

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

func (*SquadSpec) DeepCopyInto

func (in *SquadSpec) DeepCopyInto(out *SquadSpec)

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

type SquadStatus

type SquadStatus struct {
	// Replicas the total number of current GameServer replicas
	Replicas int32 `json:"replicas"`
	// ReadyReplicas are the number of Ready GameServer replicas
	ReadyReplicas int32 `json:"readyReplicas"`
	// Total number of non-terminated GameServers targeted by this Squad that have the desired template spec.
	UpdatedReplicas int32 `json:"updatedReplicas"`
	// ObservedGeneration is the most recent generation observed by the controller.
	ObservedGeneration int64 `json:"observedGeneration"`
	// Represents the latest available observations of a Squad's current state.
	Conditions []SquadCondition `json:"conditions,omitempty"`
	// Selector is a string format, which is for scale
	Selector string `json:"selector,omitempty"`
}

SquadStatus is the status of a Squad

func (*SquadStatus) DeepCopy

func (in *SquadStatus) DeepCopy() *SquadStatus

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

func (*SquadStatus) DeepCopyInto

func (in *SquadStatus) DeepCopyInto(out *SquadStatus)

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

type SquadStrategy

type SquadStrategy struct {
	// Type of Squad. Can be "Recreate" or "RollingUpdate" or "CanaryUpdate". Default is RollingUpdate.
	Type SquadStrategyType `json:"type,omitempty"`
	// Rolling update config params. Present only if SquadStrategyType = RollingUpdate.
	RollingUpdate *RollingUpdateSquad `json:"rollingUpdate,omitempty"`
	// Canary update config params. Present only if SquadStrategyType = CanaryUpdate.
	CanaryUpdate *CanaryUpdateSquad `json:"canaryUpdate,omitempty"`
	// Inplace update config params. Present only if SquadStrategyType = InplaceUpdate.
	InplaceUpdate *InplaceUpdateSquad `json:"inplaceUpdate,omitempty"`
}

SquadStrategy is the strategy for a Squad

func (*SquadStrategy) DeepCopy

func (in *SquadStrategy) DeepCopy() *SquadStrategy

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

func (*SquadStrategy) DeepCopyInto

func (in *SquadStrategy) DeepCopyInto(out *SquadStrategy)

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

type SquadStrategyType

type SquadStrategyType string
const (
	// RecreateSquadStrategyType Kill all existing GameServers before creating new ones.
	RecreateSquadStrategyType SquadStrategyType = "Recreate"
	// RollingUpdateSquadStrategyType Replace the old GameServerSets by new one using rolling update
	// i.e gradually scale down the old GameServerSets and scale up the new one.
	RollingUpdateSquadStrategyType SquadStrategyType = "RollingUpdate"
	// CanaryUpdateSquadStrategyType Replace the old GameServerSets by new one using canary update,
	// you can specify the updated threshold
	CanaryUpdateSquadStrategyType SquadStrategyType = "CanaryUpdate"
	// InplaceUpdateSquadStrategyType Replace the old GameServerSets by new one using inplace update,
	// you can specify the updated threshold
	InplaceUpdateSquadStrategyType SquadStrategyType = "InplaceUpdate"
)

type WebhookConfiguration

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

	Webhooks []Configurations `json:"webhooks"`
}

WebhookConfiguration is the data structure for a WebhookConfiguration resource.

func (*WebhookConfiguration) DeepCopy

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

func (*WebhookConfiguration) DeepCopyInto

func (in *WebhookConfiguration) DeepCopyInto(out *WebhookConfiguration)

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

func (*WebhookConfiguration) DeepCopyObject

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

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

type WebhookConfigurationList

type WebhookConfigurationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []WebhookConfiguration `json:"items"`
}

WebhookConfigurationList is a list of WebhookConfiguration resources

func (*WebhookConfigurationList) DeepCopy

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

func (*WebhookConfigurationList) DeepCopyInto

func (in *WebhookConfigurationList) DeepCopyInto(out *WebhookConfigurationList)

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

func (*WebhookConfigurationList) DeepCopyObject

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

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

Jump to

Keyboard shortcuts

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