Skip to content

Commit

Permalink
update metaurl in encryptOption (#24)
Browse files Browse the repository at this point in the history
--signoff
  • Loading branch information
zwwhdls authored Nov 19, 2021
1 parent d1ffd5a commit 6ae9345
Show file tree
Hide file tree
Showing 15 changed files with 655 additions and 50 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/juicefsruntime_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ type JuiceFSRuntimeSpec struct {
// The spec of init users
InitUsers InitUsersSpec `json:"initUsers,omitempty"`

// The component spec of JuiceFS worker
Master JuiceFSCompTemplateSpec `json:"master,omitempty"`

// The component spec of JuiceFS worker
Worker JuiceFSCompTemplateSpec `json:"worker,omitempty"`

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

226 changes: 225 additions & 1 deletion charts/fluid/fluid/crds/data.fluid.io_juicefsruntimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,193 @@ spec:
description: Image tag (e.g. 2.3.0-SNAPSHOT)
type: string
type: object
master:
description: The component spec of JuiceFS worker
properties:
enabled:
description: Enabled or Disabled for the components.
type: boolean
env:
description: Environment variables that will be used by JuiceFS
component.
items:
description: EnvVar represents an environment variable present
in a Container.
properties:
name:
description: Name of the environment variable. Must be a C_IDENTIFIER.
type: string
value:
description: 'Variable references $(VAR_NAME) are expanded
using the previous defined environment variables in the
container and any service environment variables. If a variable
cannot be resolved, the reference in the input string will
be unchanged. The $(VAR_NAME) syntax can be escaped with
a double $$, ie: $$(VAR_NAME). Escaped references will never
be expanded, regardless of whether the variable exists or
not. Defaults to "".'
type: string
valueFrom:
description: Source for the environment variable's value.
Cannot be used if value is not empty.
properties:
configMapKeyRef:
description: Selects a key of a ConfigMap.
properties:
key:
description: The key to select.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the ConfigMap or its
key must be defined
type: boolean
required:
- key
type: object
fieldRef:
description: 'Selects a field of the pod: supports metadata.name,
metadata.namespace, metadata.labels, metadata.annotations,
spec.nodeName, spec.serviceAccountName, status.hostIP,
status.podIP, status.podIPs.'
properties:
apiVersion:
description: Version of the schema the FieldPath is
written in terms of, defaults to "v1".
type: string
fieldPath:
description: Path of the field to select in the specified
API version.
type: string
required:
- fieldPath
type: object
resourceFieldRef:
description: 'Selects a resource of the container: only
resources limits and requests (limits.cpu, limits.memory,
limits.ephemeral-storage, requests.cpu, requests.memory
and requests.ephemeral-storage) are currently supported.'
properties:
containerName:
description: 'Container name: required for volumes,
optional for env vars'
type: string
divisor:
anyOf:
- type: integer
- type: string
description: Specifies the output format of the exposed
resources, defaults to "1"
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
resource:
description: 'Required: resource to select'
type: string
required:
- resource
type: object
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
type: object
required:
- name
type: object
type: array
nodeSelector:
additionalProperties:
type: string
description: NodeSelector is a selector
type: object
ports:
description: Ports used by JuiceFS
items:
description: ContainerPort represents a network port in a single
container.
properties:
containerPort:
description: Number of port to expose on the pod's IP address.
This must be a valid port number, 0 < x < 65536.
format: int32
type: integer
hostIP:
description: What host IP to bind the external port to.
type: string
hostPort:
description: Number of port to expose on the host. If specified,
this must be a valid port number, 0 < x < 65536. If HostNetwork
is specified, this must match ContainerPort. Most containers
do not need this.
format: int32
type: integer
name:
description: If specified, this must be an IANA_SVC_NAME and
unique within the pod. Each named port in a pod must have
a unique name. Name for the port that can be referred to
by services.
type: string
protocol:
description: Protocol for port. Must be UDP, TCP, or SCTP.
Defaults to "TCP".
type: string
required:
- containerPort
type: object
type: array
replicas:
description: Replicas is the desired number of replicas of the given
template. If unspecified, defaults to 1. replicas is the min replicas
of dataset in the cluster
format: int32
minimum: 1
type: integer
resources:
description: Resources that will be requested by the JuiceFS component.
properties:
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute
resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
type: object
type: object
replicas:
description: The replicas of the worker, need to be specified
format: int32
Expand Down Expand Up @@ -751,8 +938,15 @@ spec:
type: object
type: object
status:
description: RuntimeStatus defines the observed state of JuiceFSRuntime
description: RuntimeStatus defines the observed state of Runtime
properties:
apiGateway:
description: APIGatewayStatus represents rest api gateway status
properties:
endpoint:
description: Endpoint for accessing
type: string
type: object
cacheStates:
additionalProperties:
type: string
Expand Down Expand Up @@ -797,6 +991,11 @@ spec:
Fuse pod (including nodes correctly running the runtime Fuse pod).
format: int32
type: integer
currentMasterNumberScheduled:
description: The total number of nodes that should be running the runtime
pod (including nodes correctly running the runtime master pod).
format: int32
type: integer
currentWorkerNumberScheduled:
description: The total number of nodes that can be running the runtime
worker pod (including nodes correctly running the runtime worker pod).
Expand All @@ -807,6 +1006,11 @@ spec:
Fuse pod (including nodes correctly running the runtime Fuse pod).
format: int32
type: integer
desiredMasterNumberScheduled:
description: The total number of nodes that should be running the runtime
pod (including nodes correctly running the runtime master pod).
format: int32
type: integer
desiredWorkerNumberScheduled:
description: The total number of nodes that should be running the runtime
worker pod (including nodes correctly running the runtime worker pod).
Expand Down Expand Up @@ -836,13 +1040,28 @@ spec:
fuseReason:
description: Reason for the condition's last transition.
type: string
masterNumberReady:
description: The number of nodes that should be running the runtime
worker pod and have zero or more of the runtime master pod running
and ready.
format: int32
type: integer
masterPhase:
description: MasterPhase is the master running phase
type: string
masterReason:
description: Reason for Master's condition transition
type: string
selector:
description: Selector is used for auto-scaling
type: string
setupDuration:
description: Duration tell user how much time was spent to setup the
runtime
type: string
valueFile:
description: config map used to set configurations
type: string
workerNumberAvailable:
description: The number of nodes that should be running the runtime
worker pod and have one or more of the runtime worker pod running
Expand All @@ -869,11 +1088,16 @@ spec:
type: string
required:
- currentFuseNumberScheduled
- currentMasterNumberScheduled
- currentWorkerNumberScheduled
- desiredFuseNumberScheduled
- desiredMasterNumberScheduled
- desiredWorkerNumberScheduled
- fuseNumberReady
- fusePhase
- masterNumberReady
- masterPhase
- valueFile
- workerNumberReady
- workerPhase
type: object
Expand Down
19 changes: 15 additions & 4 deletions charts/juicefs/templates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,27 @@ spec:
{{- if .Values.fuse.envs }}
{{ toYaml .Values.fuse.envs | trim | indent 10 }}
{{- end }}
{{- if .Values.fuse.prepare.metaurlSecret }}
- name: METAURL
valueFrom:
secretKeyRef:
name: {{ .Values.fuse.prepare.metaurlSecret }}
key: metaurl
{{- end }}
{{- if .Values.fuse.prepare.accesskeySecret }}
- name: ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.fuse.prepare.accesskeySecret }}
key: access-key
{{- end }}
{{- if .Values.fuse.prepare.secretkeySecret }}
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.fuse.prepare.secretkeySecret }}
key: secret-key
{{- end }}
volumeMounts:
- mountPath: /root/.juicefs
mountPropagation: Bidirectional
Expand Down Expand Up @@ -160,13 +171,13 @@ data:
prepare-subpath.sh: |
#!/bin/bash
{{- if and .Values.fuse.prepare.storage .Values.fuse.prepare.bucket }}
/usr/local/bin/juicefs format --storage={{ .Values.fuse.prepare.storage }} --bucket={{ .Values.fuse.prepare.bucket }} --access-key=${ACCESS_KEY} --secret-key=${SECRET_KEY} {{ .Values.fuse.prepare.metaurl }} {{ .Values.fuse.prepare.name }}
{{- if and .Values.fuse.prepare.storage .Values.fuse.prepare.bucket .Values.fuse.prepare.accesskeySecret .Values.fuse.prepare.secretkeySecret }}
/usr/local/bin/juicefs format --storage={{ .Values.fuse.prepare.storage }} --bucket={{ .Values.fuse.prepare.bucket }} --access-key=${ACCESS_KEY} --secret-key=${SECRET_KEY} ${METAURL} {{ .Values.fuse.prepare.name }}
{{- else }}
/usr/local/bin/juicefs format {{ .Values.fuse.prepare.metaurl }} {{ .Values.fuse.prepare.name }} --no-update
/usr/local/bin/juicefs format ${METAURL} {{ .Values.fuse.prepare.name }} --no-update
{{- end }}
/usr/local/bin/juicefs mount -d {{ .Values.fuse.prepare.metaurl }} /mnt/jfs
/usr/local/bin/juicefs mount -d ${METAURL} /mnt/jfs
if [ ! -d /mnt/jfs{{ .Values.fuse.prepare.subPath }} ]; then
mkdir /mnt/jfs{{ .Values.fuse.prepare.subPath }}
fi;
Expand Down
14 changes: 7 additions & 7 deletions charts/juicefs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ worker:

fuse:
prepare:
name: jfs-secret
accesskeySecret: jfs-secret
secretkeySecret: jfs-secret
bucket: jfs-secret
metaurl: jfs-secret
storage: jfs-secret
subPath: /mnt/jfs
name: ""
accesskeySecret: ""
secretkeySecret: ""
bucket: ""
metaurlSecret: ""
storage: ""
subPath: ""
criticalPod: false
enabled: true
image: juicedata/juicefs-csi-driver
Expand Down
Loading

0 comments on commit 6ae9345

Please sign in to comment.