Skip to content

Commit b76b7cd

Browse files
committed
support inplace update for runtime workers
Signed-off-by: xliuqq <xlzq1992@gmail.com> webhook cache the specific configmap and only inplace update worker pod has annotation Signed-off-by: xliuqq <xlzq1992@gmail.com> fix test Signed-off-by: xliuqq <xlzq1992@gmail.com> use crd instead of cm Signed-off-by: xliuqq <xlzq1992@gmail.com> run make gen-openapi Signed-off-by: xliuqq <xlzq1992@gmail.com> fix e2e test error Signed-off-by: xliuqq <xlzq1992@gmail.com>
1 parent a42f1d8 commit b76b7cd

29 files changed

Lines changed: 868 additions & 32 deletions

api/v1alpha1/constant.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,14 @@ const (
5656
// OnFuseChangedCleanPolicy cleans fuse pod when the fuse in runtime is updated and the fuse pod on some node is not needed
5757
OnFuseChangedCleanPolicy FuseCleanPolicy = "OnFuseChanged"
5858
)
59+
60+
type UpdateStrategy string
61+
62+
const (
63+
// ReCreate is the default update strategy.
64+
ReCreate UpdateStrategy = "ReCreate"
65+
66+
InPlace UpdateStrategy = "InPlace"
67+
68+
InPlaceIfPossible UpdateStrategy = "InPlaceIfPossible"
69+
)

api/v1alpha1/juicefsruntime_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ type JuiceFSRuntimeSpec struct {
8080
// RuntimeManagement defines policies when managing the runtime
8181
// +optional
8282
RuntimeManagement RuntimeManagement `json:"management,omitempty"`
83+
84+
// UpdateStrategy defines the update policy for worker pod.
85+
// +kubebuilder:validation:Enum=ReCreate;InPlace;InPlaceIfPossible
86+
// +kubebuilder:default=ReCreate
87+
// +optional
88+
UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`
8389
}
8490

8591
// JuiceFSCompTemplateSpec is a description of the JuiceFS components

api/v1alpha1/openapi_generated.go

Lines changed: 174 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
Copyright 2025 The Fluid Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// PersistentPodStateSpec defines the desired state of PersistentPodState
24+
type PersistentPodStateSpec struct {
25+
}
26+
27+
type PodState struct {
28+
NodeName string `json:"nodeName"`
29+
}
30+
31+
// PersistentPodStateStatus defines the observed state of PersistentPodState
32+
type PersistentPodStateStatus struct {
33+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
34+
// Important: Run "make" to regenerate code after modifying this file
35+
36+
// PodStates is the pod name mapping to state.
37+
PodStates map[string]PodState `json:"podStates,omitempty"`
38+
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
39+
}
40+
41+
// PersistentPodState is the Schema for the PersistentPodState API
42+
// +kubebuilder:object:root=true
43+
// +kubebuilder:subresource:status
44+
// +kubebuilder:resource:scope=Namespaced
45+
type PersistentPodState struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ObjectMeta `json:"metadata,omitempty"`
48+
49+
Spec PersistentPodStateSpec `json:"spec,omitempty"`
50+
Status PersistentPodStateStatus `json:"status,omitempty"`
51+
}
52+
53+
//+kubebuilder:object:root=true
54+
55+
// PersistentPodStateList contains a list of PersistentPodState
56+
type PersistentPodStateList struct {
57+
metav1.TypeMeta `json:",inline"`
58+
metav1.ListMeta `json:"metadata,omitempty"`
59+
Items []PersistentPodState `json:"items"`
60+
}
61+
62+
func init() {
63+
SchemeBuilder.Register(&PersistentPodState{}, &PersistentPodStateList{})
64+
}

0 commit comments

Comments
 (0)