Skip to content
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

cherry-pick juicefs for 0.8.3 #2487

Merged
10 changes: 10 additions & 0 deletions api/v1alpha1/juicefsruntime_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ type JuiceFSCompTemplateSpec struct {
// PodMetadata defines labels and annotations that will be propagated to JuiceFs's pods.
// +optional
PodMetadata PodMetadata `json:"podMetadata,omitempty"`

// Whether to use hostnetwork or not
// +kubebuilder:validation:Enum=HostNetwork;"";ContainerNetwork
// +optional
NetworkMode NetworkMode `json:"networkMode,omitempty"`
}

type JuiceFSFuseSpec struct {
Expand Down Expand Up @@ -158,6 +163,11 @@ type JuiceFSFuseSpec struct {
// PodMetadata defines labels and annotations that will be propagated to JuiceFs's pods.
// +optional
PodMetadata PodMetadata `json:"podMetadata,omitempty"`

// Whether to use hostnetwork or not
// +kubebuilder:validation:Enum=HostNetwork;"";ContainerNetwork
// +optional
NetworkMode NetworkMode `json:"networkMode,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
14 changes: 14 additions & 0 deletions api/v1alpha1/openapi_generated.go

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

2 changes: 0 additions & 2 deletions charts/fluid-dataloader/juicefs/templates/dataloader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ spec:
envFrom:
- configMapRef:
name: {{ required "targetDataset should be set" .Values.dataloader.targetDataset }}-juicefs-values
securityContext:
privileged: true
volumeMounts:
- mountPath: /scripts
name: data-load-script
Expand Down
28 changes: 28 additions & 0 deletions charts/fluid/fluid/crds/data.fluid.io_juicefsruntimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ spec:
imageTag:
description: Image for JuiceFS fuse
type: string
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -467,6 +474,13 @@ spec:
- name
type: object
type: array
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -735,6 +749,13 @@ spec:
- name
type: object
type: array
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -4170,6 +4191,13 @@ spec:
- name
type: object
type: array
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down
9 changes: 9 additions & 0 deletions charts/juicefs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ Support configurable tieredstore's volume type
0.2.6

- Make fuse tolerate any taint

0.2.7
- Change podManagementPolicy from OrderedReady to Parallel

0.2.8
- Add volumes and volumeMounts to worker and fuse

0.2.9
- Add updateStrategy for fuse
2 changes: 1 addition & 1 deletion charts/juicefs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: juicefs
apiVersion: v1
description: FileSystem aimed for data analytics and machine learning in any cloud.
version: 0.2.6
version: 0.2.9
appVersion: v1.0.0
home: https://juicefs.com/
maintainers:
Expand Down
13 changes: 12 additions & 1 deletion charts/juicefs/templates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ metadata:
uid: {{ .Values.owner.uid }}
{{- end }}
spec:
updateStrategy:
type: {{ .Values.fuse.updateStrategy.type }}
selector:
matchLabels:
app: {{ template "juicefs.name" . }}
Expand Down Expand Up @@ -49,7 +51,10 @@ spec:
{{- if .Values.fuse.criticalPod }}
priorityClassName: system-node-critical
{{- end }}
dnsPolicy: {{ .Values.fuse.dnsPolicy }}
{{- if .Values.fuse.hostNetwork }}
hostNetwork: {{ .Values.fuse.hostNetwork }}
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
nodeSelector:
{{- if .Values.fuse.nodeSelector }}
{{ toYaml .Values.fuse.nodeSelector | trim | indent 8 }}
Expand Down Expand Up @@ -140,6 +145,9 @@ spec:
- name: cache-dir-{{ $name }}
mountPath: "{{ $mount.path }}"
{{- end }}
{{- if .Values.fuse.volumeMounts }}
{{ toYaml .Values.fuse.volumeMounts | indent 12 }}
{{- end }}
restartPolicy: Always
volumes:
- name: juicefs-fuse-mount
Expand All @@ -162,6 +170,9 @@ spec:
configMap:
name: {{ template "juicefs.fullname" . }}-fuse-script
defaultMode: 0755
{{- if .Values.fuse.volumes }}
{{ toYaml .Values.fuse.volumes | indent 8 }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
23 changes: 12 additions & 11 deletions charts/juicefs/templates/worker/statefuleset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $hostNetwork := .Values.worker.hostNetwork }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -22,6 +23,7 @@ metadata:
spec:
replicas: {{ .Values.worker.replicas }}
serviceName: {{ template "juicefs.fullname" . }}-worker
podManagementPolicy: {{ .Values.worker.podManagementPolicy }}
selector:
matchLabels:
app: {{ template "juicefs.name" . }}
Expand Down Expand Up @@ -51,6 +53,10 @@ spec:
{{- end }}
{{- end }}
spec:
{{- if .Values.worker.hostNetwork }}
hostNetwork: {{ $hostNetwork }}
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
nodeSelector:
{{- if .Values.worker.nodeSelector }}
{{ toYaml .Values.worker.nodeSelector | trim | indent 8 }}
Expand Down Expand Up @@ -112,17 +118,6 @@ spec:
name: {{ .Values.configs.tokenSecret }}
key: token
{{- end }}
livenessProbe:
exec:
command:
- sh
- -c
- 'if [ x$({{ .Values.worker.statCmd }}) = x1 ]; then exit 0; else exit 1; fi '
failureThreshold: 3
initialDelaySeconds: 1
periodSeconds: 1
successThreshold: 1
timeoutSeconds: 1
lifecycle:
preStop:
exec:
Expand All @@ -134,6 +129,9 @@ spec:
- name: cache-dir-{{ $name }}
mountPath: "{{ $mount.path }}"
{{- end }}
{{- if .Values.worker.volumeMounts }}
{{ toYaml .Values.worker.volumeMounts | indent 12 }}
{{- end }}
restartPolicy: Always
volumes:
{{- range $name, $mount := .Values.cacheDirs }}
Expand All @@ -152,6 +150,9 @@ spec:
configMap:
name: {{ template "juicefs.fullname" . }}-worker-script
defaultMode: 0755
{{- if .Values.worker.volumes }}
{{ toYaml .Values.worker.volumes | indent 8 }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
12 changes: 9 additions & 3 deletions charts/juicefs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ imagePullPolicy: IfNotPresent

## WORKER ##
worker:
privileged: true
image: ""
imageTag: ""
imagePullPolicy: ""
Expand All @@ -43,6 +42,8 @@ worker:
command: ""
mountPath: /mnt/jfs
statCmd: "stat -c %i /mnt/jfs"
podManagementPolicy: Parallel
hostNetwork: false
resources:
requests:
# cpu: "0.5"
Expand All @@ -53,6 +54,8 @@ worker:
replicas: 0
labels: {}
annotations: {}
volumes: []
volumeMounts: []

configs:
name: ""
Expand All @@ -67,7 +70,7 @@ configs:
## FUSE ##

fuse:
privileged: true
hostNetwork: false
subPath: ""
criticalPod: false
enabled: true
Expand All @@ -76,13 +79,14 @@ fuse:
imagePullPolicy: IfNotPresent
envs: []
nodeSelector: {}
dnsPolicy: ClusterFirstWithHostNet
# Mount path in the host
mountPath: /mnt/jfs
cacheDir: ""
hostMountPath: /mnt/jfs
command: "/usr/local/bin/juicefs mount /mnt/jfs"
statCmd: "stat -c %i /mnt/jfs"
updateStrategy:
type: OnDelete
resources:
requests:
# cpu: "0.5"
Expand All @@ -92,6 +96,8 @@ fuse:
# memory: "4G"
labels: {}
annotations: {}
volumes: []
volumeMounts: []

runtimeIdentity:
namespace: default
Expand Down
28 changes: 28 additions & 0 deletions config/crd/bases/data.fluid.io_juicefsruntimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ spec:
imageTag:
description: Image for JuiceFS fuse
type: string
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -467,6 +474,13 @@ spec:
- name
type: object
type: array
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -735,6 +749,13 @@ spec:
- name
type: object
type: array
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down Expand Up @@ -4170,6 +4191,13 @@ spec:
- name
type: object
type: array
networkMode:
description: Whether to use hostnetwork or not
enum:
- HostNetwork
- ""
- ContainerNetwork
type: string
nodeSelector:
additionalProperties:
type: string
Expand Down
Loading