Skip to content

Commit 37d09ce

Browse files
committed
chart for csi dashboard
1 parent 47d5fed commit 37d09ce

11 files changed

+459
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
# vendor/
1616
.idea/
1717
.DS_Store
18+
values-*.yaml
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
name: juicefs-csi-dashboard
3+
description: A Helm chart for JuiceFS CSI Dashboard
4+
type: application
5+
version: 0.0.1
6+
appVersion: "0.0.1"
7+
home: https://github.com/juicedata/juicefs
8+
sources:
9+
- https://github.com/juicedata/juicefs
10+
icon: https://s.juicefs.com/static/jfs/logo.svg
11+
maintainers:
12+
- email: team@juicedata.io
13+
name: Juicedata Inc.
14+
url: https://juicefs.com
15+
keywords:
16+
- juicefs
17+
- kubernetes
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# juicefs-csi-dashboard
2+
3+
A Helm chart for JuiceFS CSI Dashboard
4+
5+
**Homepage:** <https://github.com/juicedata/juicefs>
6+
7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| Juicedata Inc. | <team@juicedata.io> | <https://juicefs.com> |
12+
13+
## Source Code
14+
15+
* <https://github.com/juicedata/juicefs>
16+
17+
## Values
18+
19+
| Key | Type | Default | Description |
20+
|-----|------|---------|-------------|
21+
| affinity | object | `{}` | |
22+
| envs | list | `[]` | Environment variables for the dashboard container Example: - name: JFSCHAN value: "gluster" |
23+
| formatOptions | string | `""` | JuiceFS format options. Separated by spaces Example: "--inodes=1000000 --block-size=4M" Ref: https://juicefs.com/docs/community/command_reference#format |
24+
| fullnameOverride | string | `""` | |
25+
| hostNetwork | bool | `false` | |
26+
| image.pullPolicy | string | `"IfNotPresent"` | |
27+
| image.repository | string | `"juicedata/mount"` | |
28+
| image.tag | string | `"ce-v1.1.0"` | 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 |
29+
| imagePullSecrets | list | `[]` | |
30+
| ingress.annotations | object | `{}` | |
31+
| ingress.className | string | `"nginx"` | |
32+
| ingress.enabled | bool | `false` | |
33+
| ingress.hosts[0].host | string | `""` | |
34+
| ingress.hosts[0].paths[0].path | string | `"/"` | |
35+
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
36+
| ingress.tls | list | `[]` | |
37+
| nameOverride | string | `""` | |
38+
| nodeSelector | object | `{}` | |
39+
| podAnnotations | object | `{}` | |
40+
| port | int | `9000` | |
41+
| replicaCount | int | `1` | |
42+
| resources.limits.cpu | string | `"5000m"` | |
43+
| resources.limits.memory | string | `"5Gi"` | |
44+
| resources.requests.cpu | string | `"1000m"` | |
45+
| resources.requests.memory | string | `"1Gi"` | |
46+
| service.type | string | `"ClusterIP"` | |
47+
| tolerations | list | `[]` | |
48+
49+
----------------------------------------------
50+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services juicefs-csi-dashboard)
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w juicefs-csi-dashboard
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} juicefs-csi-dashboard --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export CLUSTER_IP=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.clusterIP}" services juicefs-csi-dashboard)
19+
echo http://$CLUSTER_IP:{{ .Values.port }}
20+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "juicefs-csi-dashboard.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{- define "juicefs-csi-dashboard.serviceaccount" -}}
9+
{{- default "juicefs-csi-dashboard-sa" .Values.serviceAccountName }}
10+
{{- end }}
11+
12+
{{/*
13+
Create a default fully qualified app name.
14+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
15+
If release name contains chart name it will be used as a full name.
16+
*/}}
17+
{{- define "juicefs-csi-dashboard.fullname" -}}
18+
{{- if .Values.fullnameOverride }}
19+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- $name := default .Chart.Name .Values.nameOverride }}
22+
{{- if contains $name .Release.Name }}
23+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
24+
{{- else }}
25+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
26+
{{- end }}
27+
{{- end }}
28+
{{- end }}
29+
30+
{{/*
31+
Create chart name and version as used by the chart label.
32+
*/}}
33+
{{- define "juicefs-csi-dashboard.chart" -}}
34+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
35+
{{- end }}
36+
37+
{{/*
38+
Common labels
39+
*/}}
40+
{{- define "juicefs-csi-dashboard.labels" -}}
41+
helm.sh/chart: {{ include "juicefs-csi-dashboard.chart" . }}
42+
{{ include "juicefs-csi-dashboard.selectorLabels" . }}
43+
{{- if .Chart.AppVersion }}
44+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
45+
{{- end }}
46+
app.kubernetes.io/managed-by: {{ .Release.Service }}
47+
{{- end }}
48+
49+
{{/*
50+
Selector labels
51+
*/}}
52+
{{- define "juicefs-csi-dashboard.selectorLabels" -}}
53+
app.kubernetes.io/name: {{ include "juicefs-csi-dashboard.name" . }}
54+
app.kubernetes.io/instance: {{ .Release.Name }}
55+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: juicefs-csi-dashboard
5+
namespace: {{ .Release.Namespace | quote }}
6+
labels:
7+
{{- include "juicefs-csi-dashboard.labels" . | nindent 4 }}
8+
spec:
9+
replicas: {{ .Values.replicaCount }}
10+
selector:
11+
matchLabels:
12+
{{- include "juicefs-csi-dashboard.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
{{- with .Values.podAnnotations }}
16+
annotations:
17+
{{- toYaml . | nindent 8 }}
18+
{{- end }}
19+
labels:
20+
{{- include "juicefs-csi-dashboard.selectorLabels" . | nindent 8 }}
21+
spec:
22+
serviceAccountName: {{ include "juicefs-csi-dashboard.serviceaccount" . }}
23+
{{- with .Values.imagePullSecrets }}
24+
imagePullSecrets:
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
27+
containers:
28+
- name: dashboard
29+
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
30+
{{- if .Values.image.pullPolicy }}
31+
imagePullPolicy: {{ .Values.image.pullPolicy }}
32+
{{- end }}
33+
args:
34+
- --static-dir=/dist
35+
env:
36+
- name: SYS_NAMESPACE
37+
valueFrom:
38+
fieldRef:
39+
fieldPath: metadata.namespace
40+
{{- if .Values.envs }}
41+
{{ toYaml .Values.envs | indent 12 }}
42+
{{- end }}
43+
ports:
44+
- containerPort: {{ .Values.port }}
45+
resources:
46+
{{- toYaml .Values.resources | nindent 12 }}
47+
volumeMounts:
48+
{{- with .Values.extraVolumeMounts }}
49+
{{- toYaml . | nindent 12 }}
50+
{{- end }}
51+
{{- with .Values.nodeSelector }}
52+
nodeSelector:
53+
{{- toYaml . | nindent 8 }}
54+
{{- end }}
55+
{{- with .Values.affinity }}
56+
affinity:
57+
{{- toYaml . | nindent 8 }}
58+
{{- end }}
59+
{{- with .Values.tolerations }}
60+
tolerations:
61+
{{- toYaml . | nindent 8 }}
62+
{{- end }}
63+
{{- if .Values.hostNetwork }}
64+
hostNetwork: true
65+
{{- end }}
66+
volumes:
67+
{{- with .Values.extraVolumes }}
68+
{{- toYaml . | nindent 8 }}
69+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $port := .Values.port -}}
3+
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
4+
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
5+
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
6+
{{- end }}
7+
{{- end }}
8+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
9+
apiVersion: networking.k8s.io/v1
10+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
11+
apiVersion: networking.k8s.io/v1beta1
12+
{{- else -}}
13+
apiVersion: extensions/v1beta1
14+
{{- end }}
15+
kind: Ingress
16+
metadata:
17+
name: juicefs-csi-dashboard
18+
namespace: {{ .Release.Namespace | quote }}
19+
labels:
20+
{{- include "juicefs-csi-dashboard.labels" . | nindent 4 }}
21+
{{- with .Values.ingress.annotations }}
22+
annotations:
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
25+
spec:
26+
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27+
ingressClassName: {{ .Values.ingress.className }}
28+
{{- end }}
29+
{{- if .Values.ingress.tls }}
30+
tls:
31+
{{- range .Values.ingress.tls }}
32+
- hosts:
33+
{{- range .hosts }}
34+
- {{ . | quote }}
35+
{{- end }}
36+
secretName: {{ .secretName }}
37+
{{- end }}
38+
{{- end }}
39+
rules:
40+
{{- range .Values.ingress.hosts }}
41+
- http:
42+
paths:
43+
{{- range .paths }}
44+
- path: {{ .path }}
45+
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
46+
pathType: {{ .pathType }}
47+
{{- end }}
48+
backend:
49+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
50+
service:
51+
name: juicefs-csi-dashboard
52+
port:
53+
number: {{ $port }}
54+
{{- else }}
55+
serviceName: juicefs-csi-dashboard
56+
servicePort: {{ $port }}
57+
{{- end }}
58+
{{- end }}
59+
{{- if .host }}
60+
host: {{ .host | quote }}
61+
{{- end }}
62+
{{- end }}
63+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: juicefs-csi-dashboard
5+
namespace: {{ .Release.Namespace | quote }}
6+
labels:
7+
{{- include "juicefs-csi-dashboard.labels" . | nindent 4 }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
ports:
11+
- port: {{ .Values.port }}
12+
targetPort: {{ .Values.port }}
13+
protocol: TCP
14+
name: http
15+
selector:
16+
{{- include "juicefs-csi-dashboard.selectorLabels" . | nindent 4 }}

0 commit comments

Comments
 (0)