Skip to content

Commit

Permalink
Bump Kubernetes dependencies to 1.22 (#915)
Browse files Browse the repository at this point in the history
Signed-off-by: FillZpp <[email protected]>
  • Loading branch information
FillZpp authored Mar 2, 2022
1 parent d3e8035 commit 7722528
Show file tree
Hide file tree
Showing 2,499 changed files with 165,191 additions and 58,758 deletions.
72 changes: 0 additions & 72 deletions .github/workflows/e2e-1.18.yaml

This file was deleted.

19 changes: 18 additions & 1 deletion apis/apps/v1alpha1/containerrecreaterequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type ContainerRecreateRequestContainer struct {
// PreStop is synced from the real container in Pod spec during this ContainerRecreateRequest creating.
// Populated by the system.
// Read-only.
PreStop *v1.Handler `json:"preStop,omitempty"`
PreStop *ProbeHandler `json:"preStop,omitempty"`
// Ports is synced from the real container in Pod spec during this ContainerRecreateRequest creating.
// Populated by the system.
// Read-only.
Expand All @@ -74,6 +74,23 @@ type ContainerRecreateRequestContainer struct {
StatusContext *ContainerRecreateRequestContainerContext `json:"statusContext,omitempty"`
}

// ProbeHandler defines a specific action that should be taken
// TODO(FillZpp): improve the definition when openkruise/kruise updates to k8s 1.23
type ProbeHandler struct {
// One and only one of the following should be specified.
// Exec specifies the action to take.
// +optional
Exec *v1.ExecAction `json:"exec,omitempty" protobuf:"bytes,1,opt,name=exec"`
// HTTPGet specifies the http request to perform.
// +optional
HTTPGet *v1.HTTPGetAction `json:"httpGet,omitempty" protobuf:"bytes,2,opt,name=httpGet"`
// TCPSocket specifies an action involving a TCP port.
// TCP hooks not yet supported
// TODO: implement a realistic TCP lifecycle hook
// +optional
TCPSocket *v1.TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"`
}

// ContainerRecreateRequestContainerContext contains context status of the container that need to recreate.
type ContainerRecreateRequestContainerContext struct {
// Container's ID in the format 'docker://<container_id>'.
Expand Down
3 changes: 1 addition & 2 deletions apis/apps/v1alpha1/ephemeraljob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

const (
EphemeralContainerCreateByJob = "apps.kruise.io/ephemeraljob"
EphemeralContainerEnvKey = "KRUISE_EJOB_ID"
EphemeralContainerEnvKey = "KRUISE_EJOB_ID"
)

// EphemeralJobSpec defines the desired state of EphemeralJob
Expand Down
3 changes: 2 additions & 1 deletion apis/apps/v1alpha1/uniteddeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
"github.com/openkruise/kruise/apis/apps/v1beta1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -111,7 +112,7 @@ type AdvancedStatefulSetTemplateSpec struct {
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec StatefulSetSpec `json:"spec"`
Spec v1beta1.StatefulSetSpec `json:"spec"`
}

// CloneSetTemplateSpec defines the subset template of CloneSet.
Expand Down
32 changes: 31 additions & 1 deletion apis/apps/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions config/crd/bases/apps.kruise.io_uniteddeployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,37 @@ spec:
description: StatefulSetSpec defines the desired state of
StatefulSet
properties:
lifecycle:
description: Lifecycle defines the lifecycle hooks for
Pods pre-delete, in-place update.
properties:
inPlaceUpdate:
description: InPlaceUpdate is the hook before Pod
to update and after Pod has been updated.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
preDelete:
description: PreDelete is the hook before Pod to be
deleted.
properties:
finalizersHandler:
items:
type: string
type: array
labelsHandler:
additionalProperties:
type: string
type: object
type: object
type: object
podManagementPolicy:
description: podManagementPolicy controls how pods are
created during initial scale up, when replacing pods
Expand All @@ -150,6 +181,21 @@ spec:
of this field.'
format: int32
type: integer
reserveOrdinals:
description: 'reserveOrdinals controls the ordinal numbers
that should be reserved, and the replicas will always
be the expectation number of running Pods. For a sts
with replicas=3 and its Pods in [0, 1, 2]: - If you
want to migrate Pod-1 and reserve this ordinal, just
set spec.reserveOrdinal to [1]. Then controller will
delete Pod-1 and create Pod-3 (existing Pods will be
[0, 2, 3]) - If you just want to delete Pod-1, you should
set spec.reserveOrdinal to [1] and spec.replicas to
2. Then controller will delete Pod-1 (existing Pods
will be [0, 2])'
items:
type: integer
type: array
revisionHistoryLimit:
description: revisionHistoryLimit is the maximum number
of revisions that will be maintained in the StatefulSet's
Expand All @@ -158,6 +204,22 @@ spec:
version. The default value is 10.
format: int32
type: integer
scaleStrategy:
description: scaleStrategy indicates the StatefulSetScaleStrategy
that will be employed to scale Pods in the StatefulSet.
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of pods that can
be unavailable during scaling. Value can be an absolute
number (ex: 5) or a percentage of desired pods (ex:
10%). Absolute number is calculated from percentage
by rounding down. It can just be allowed to work
with Parallel podManagementPolicy.'
x-kubernetes-int-or-string: true
type: object
selector:
description: 'selector is a label query over pods that
should match the replica count. It must match the pod
Expand Down
7 changes: 7 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ metadata:
control-plane: controller-manager
name: system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: manager
namespace: system
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -50,6 +56,7 @@ spec:
cpu: 100m
memory: 200Mi
terminationGracePeriodSeconds: 10
serviceAccountName: kruise-manager
---
apiVersion: v1
kind: Secret
Expand Down
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ rules:
- pods/ephemeralcontainers
verbs:
- get
- patch
- update
- apiGroups:
- ""
Expand Down
2 changes: 1 addition & 1 deletion config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ roleRef:
name: manager-role
subjects:
- kind: ServiceAccount
name: default
name: manager
namespace: system
Loading

0 comments on commit 7722528

Please sign in to comment.