Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions charts/juicefs-s3-gateway/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
17 changes: 17 additions & 0 deletions charts/juicefs-s3-gateway/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
name: juicefs-s3-gateway
description: A Helm chart for JuiceFS S3 Gateway
type: application
version: 0.11.3
appVersion: "1.6.0"
home: https://github.com/juicedata/juicefs
sources:
- https://github.com/juicedata/juicefs
icon: https://s.juicefs.com/static/jfs/logo.svg
maintainers:
- email: team@juicedata.io
name: Juicedata Inc.
url: https://juicefs.com
keywords:
- juicefs
- s3 gateway
62 changes: 62 additions & 0 deletions charts/juicefs-s3-gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# juicefs-s3-gateway

![Version: 0.11.1](https://img.shields.io/badge/Version-0.11.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.6.0](https://img.shields.io/badge/AppVersion-1.6.0-informational?style=flat-square)

A Helm chart for JuiceFS S3 Gateway

**Homepage:** <https://github.com/juicedata/juicefs>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| Juicedata Inc. | <team@juicedata.io> | <https://juicefs.com> |

## Source Code

* <https://github.com/juicedata/juicefs>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| envs | list | `[]` | Environment variables for the gateway container Example: - name: JFSCHAN value: "gluster" |
| formatOptions | string | `""` | JuiceFS format options. Separated by spaces Example: "--inodes=1000000 --block-size=4M" Ref: https://juicefs.com/docs/community/command_reference#format |
| fullnameOverride | string | `""` | |
| hostNetwork | bool | `false` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"juicedata/mount"` | |
| image.tag | string | `"ce-v1.2.3"` | Overrides the image tag which defaults to the chart appVersion. For JuiceFS Community Edition, use ce-vx.x.x style tags For JuiceFS Enterprise Edition, use ee-vx.x.x style tags Find the latest built images in our docker image repo: https://hub.docker.com/r/juicedata/mount |
| imagePullSecrets | list | `[]` | |
| ingress.annotations | object | `{}` | |
| ingress.className | string | `"nginx"` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].host | string | `""` | |
| ingress.hosts[0].paths[0].path | string | `"/"` | |
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
| ingress.tls | list | `[]` | |
| initEnvs | list | `[]` | Environment variables for init containers Example: - name: GOOGLE_APPLICATION_CREDENTIALS value: "/root/.config/gcloud/application_default_credentials.json" |
| metricsPort | int | `9567` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| options | string | `""` | Gateway Options. Separated by spaces Example: "--get-timeout=60 --put-timeout=60" CE Ref: https://juicefs.com/docs/community/command_reference#gateway EE Ref: https://juicefs.com/docs/cloud/reference/command_reference/#gateway |
| podAnnotations | object | `{}` | |
| port | int | `9000` | |
| replicaCount | int | `1` | |
| resources.limits.cpu | string | `"5000m"` | |
| resources.limits.memory | string | `"5Gi"` | |
| resources.requests.cpu | string | `"1000m"` | |
| resources.requests.memory | string | `"1Gi"` | |
| secret.accessKey | string | `""` | Access key for object storage |
| secret.bucket | string | `""` | Object storage bucket or full endpoint CE Ref: https://juicefs.com/docs/community/how_to_setup_object_storage EE Ref (see --bucket): https://juicefs.com/docs/cloud/reference/command_reference/#auth |
| secret.metaurl | string | `""` | Connection URL for metadata engine (e.g. Redis) Ref: https://juicefs.com/docs/community/databases_for_metadata |
| secret.name | string | `""` | The JuiceFS file system name. |
| secret.secretKey | string | `""` | Secret key for object storage |
| secret.storage | string | `""` | Object storage type, such as `s3`, `gs`, `oss` Ref: https://juicefs.com/docs/community/how_to_setup_object_storage |
| secret.token | string | `""` | JuiceFS Enterprise Edition file system token, if this token is specified, this helm chart then assumes JuiceFS EE and neglect all CE configurations |
| service.type | string | `"ClusterIP"` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
20 changes: 20 additions & 0 deletions charts/juicefs-s3-gateway/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services juicefs-s3-gateway)
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w juicefs-s3-gateway
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} juicefs-s3-gateway --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export CLUSTER_IP=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.clusterIP}" services juicefs-s3-gateway)
echo http://$CLUSTER_IP:{{ .Values.port }}
{{- end }}
51 changes: 51 additions & 0 deletions charts/juicefs-s3-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "juicefs-s3-gateway.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "juicefs-s3-gateway.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "juicefs-s3-gateway.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "juicefs-s3-gateway.labels" -}}
helm.sh/chart: {{ include "juicefs-s3-gateway.chart" . }}
{{ include "juicefs-s3-gateway.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "juicefs-s3-gateway.selectorLabels" -}}
app.kubernetes.io/name: {{ include "juicefs-s3-gateway.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
163 changes: 163 additions & 0 deletions charts/juicefs-s3-gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "juicefs-s3-gateway.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "juicefs-s3-gateway.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "juicefs-s3-gateway.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "juicefs-s3-gateway.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: format
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
{{- if .Values.image.pullPolicy }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- end }}
command:
- sh
- -c
{{- if .Values.secret.token }}
- juicefs auth ${name} --token=${token} {{ if .Values.secret.bucket }}--bucket=${bucket}{{ end }} --access-key=${accesskey} --secret-key=${secretkey}
{{- else }}
- juicefs format ${metaurl} ${name} --storage=${storage} --bucket=${bucket} --access-key=${accesskey} --secret-key=${secretkey} {{ .Values.formatOptions }}
{{- end }}
envFrom:
- secretRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
env:
- name: accesskey
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: access-key
- name: secretkey
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: secret-key
{{- if .Values.initEnvs }}
{{ toYaml .Values.initEnvs | indent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.secret.token }}
- mountPath: /root/.juicefs
name: jfs-root-dir
{{- end }}
containers:
- name: gateway
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
{{- if .Values.image.pullPolicy }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- end }}
command:
- sh
- -c
{{- if .Values.secret.token }}
- juicefs gateway ${VOL_NAME} 0.0.0.0:{{ .Values.port }} {{ .Values.options }} {{ if .Values.secret.encrypt_rsa_key }}--rsa-key /root/encrypt_rsa_key.pem{{ end }}
{{- else }}
- juicefs gateway ${METAURL} 0.0.0.0:{{ .Values.port }} --metrics=0.0.0.0:{{ .Values.metricsPort }} {{ .Values.options }} {{ if .Values.secret.encrypt_rsa_key }}--rsa-key /root/encrypt_rsa_key.pem{{ end }}
{{- end }}
env:
{{- if .Values.secret.token }}
- name: TOKEN
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: token
- name: VOL_NAME
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: name
{{- else }}
- name: METAURL
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: metaurl
{{- end }}
- name: MINIO_ROOT_USER
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: access-key
- name: MINIO_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: secret-key
{{- if .Values.secret.JFS_RSA_PASSPHRASE }}
- name: JFS_RSA_PASSPHRASE
valueFrom:
secretKeyRef:
name: {{ include "juicefs-s3-gateway.fullname" . }}-secret
key: JFS_RSA_PASSPHRASE
{{- end }}
{{- if .Values.envs }}
{{ toYaml .Values.envs | indent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.port }}
- containerPort: {{ .Values.metricsPort }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
{{- if .Values.secret.token }}
- mountPath: /root/.juicefs
name: jfs-root-dir
{{- end }}
{{- if .Values.secret.encrypt_rsa_key }}
- name: rsa-key
mountPath: "/root"
readOnly: true
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.hostNetwork }}
hostNetwork: true
{{- end }}
volumes:
{{- if .Values.secret.token }}
- emptyDir: {}
name: jfs-root-dir
{{- end }}
{{- if .Values.secret.encrypt_rsa_key }}
- name: rsa-key
secret:
secretName: {{ include "juicefs-s3-gateway.fullname" . }}-secret
items:
- key: encrypt_rsa_key
path: encrypt_rsa_key.pem
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Loading
Loading