-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calico apiserver improvements #3481
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,9 @@ type APIServerDeploymentContainer struct { | |
// If used in conjunction with the deprecated ComponentResources, then this value takes precedence. | ||
// +optional | ||
Resources *v1.ResourceRequirements `json:"resources,omitempty"` | ||
|
||
// +optional | ||
Lifecycle *v1.Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,12,opt,name=lifecycle"` | ||
} | ||
|
||
// APIServerDeploymentInitContainer is an API server Deployment init container. | ||
|
@@ -146,6 +149,10 @@ type APIServerDeploymentPodSpec struct { | |
// WARNING: Please note that this field will override the default API server Deployment tolerations. | ||
// +optional | ||
Tolerations []v1.Toleration `json:"tolerations,omitempty"` | ||
|
||
// PriorityClassName allows to specify a PriorityClass resource to be used. | ||
// +optional | ||
PriorityClassName string `json:"priorityClassName,omitempty"` | ||
} | ||
|
||
// APIServerDeploymentPodTemplateSpec is the API server Deployment's PodTemplateSpec | ||
|
@@ -173,6 +180,12 @@ type APIServerDeployment struct { | |
|
||
// APIServerDeploymentSpec defines configuration for the API server Deployment. | ||
type APIServerDeploymentSpec struct { | ||
// Replicas defines how many instances of the API server pod will run. | ||
// +optional | ||
// +kubebuilder:validation:Minimum=0 | ||
// +kubebuilder:validation:Maximum=2147483647 | ||
Replicas *int32 `json:"replicas,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The replicas for the apiserver can already be controlled through the Installation resource with the |
||
|
||
// MinReadySeconds is the minimum number of seconds for which a newly created Deployment pod should | ||
// be ready without any of its container crashing, for it to be considered available. | ||
// If specified, this overrides any minReadySeconds value that may be set on the API server Deployment. | ||
|
@@ -185,6 +198,24 @@ type APIServerDeploymentSpec struct { | |
// Template describes the API server Deployment pod that will be created. | ||
// +optional | ||
Template *APIServerDeploymentPodTemplateSpec `json:"template,omitempty"` | ||
|
||
// The deployment strategy to use to replace existing pods with new ones. | ||
// +optional | ||
// +patchStrategy=retainKeys | ||
Strategy *APIServerDeploymentStrategy `json:"strategy,omitempty" patchStrategy:"retainKeys" protobuf:"bytes,4,opt,name=strategy"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd want to hear what the use case is that we need to add this override for the apiserver. In other words why would someone need to change the Strategy? |
||
} | ||
|
||
// APIServerDeploymentStrategy describes how to replace existing pods with new ones. | ||
type APIServerDeploymentStrategy struct { | ||
// Rolling update config params. Present only if DeploymentStrategyType = | ||
// RollingUpdate. | ||
// to be. | ||
// +optional | ||
RollingUpdate *appsv1.RollingUpdateDeployment `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"` | ||
|
||
// Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. | ||
// +optional | ||
Type *appsv1.DeploymentStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=DeploymentStrategyType"` | ||
} | ||
|
||
func (c *APIServerDeployment) GetMetadata() *Metadata { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to hear the use case for adding this. (I hadn't heard of Lifecycle before but looking at the K8s API reference I don't understand what its use case would be for the apiserver.)