diff --git a/charts/rook-nfs-server/v0.1.0/.helmignore b/charts/rook-nfs-server/v0.1.0/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/.helmignore @@ -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/ diff --git a/charts/rook-nfs-server/v0.1.0/Chart.yaml b/charts/rook-nfs-server/v0.1.0/Chart.yaml new file mode 100644 index 0000000..c07d451 --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: rook-nfs-server +description: Manage a Rook NFS Server instance. To be used with rook-nfs-operator chart. + +type: application + +version: 0.1.0 + +appVersion: "v1.7.3" diff --git a/charts/rook-nfs-server/v0.1.0/templates/NOTES.txt b/charts/rook-nfs-server/v0.1.0/templates/NOTES.txt new file mode 100644 index 0000000..56647c9 --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/templates/NOTES.txt @@ -0,0 +1,13 @@ +The NFS Server was configured with the following exports: +{{- range .Values.exports }} + - name: {{ .name }} + server: + accessMode: {{ .server.accessMode }} + squash: {{ .server.squash | quote }} + {{- with .server.allowedClients }} + allowedClients: + {{- toYaml . | nindent 8 }} + {{- end }} + persistentVolumeClaim: + claimName: {{ .persistentVolumeClaim.claimName }} +{{ end }} \ No newline at end of file diff --git a/charts/rook-nfs-server/v0.1.0/templates/_helpers.tpl b/charts/rook-nfs-server/v0.1.0/templates/_helpers.tpl new file mode 100644 index 0000000..aa33901 --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/templates/_helpers.tpl @@ -0,0 +1,51 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "rook-nfs-server.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 "rook-nfs-server.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 "rook-nfs-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "rook-nfs-server.labels" -}} +helm.sh/chart: {{ include "rook-nfs-server.chart" . }} +{{ include "rook-nfs-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "rook-nfs-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "rook-nfs-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} \ No newline at end of file diff --git a/charts/rook-nfs-server/v0.1.0/templates/nfsserver.yaml b/charts/rook-nfs-server/v0.1.0/templates/nfsserver.yaml new file mode 100644 index 0000000..b20ed16 --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/templates/nfsserver.yaml @@ -0,0 +1,25 @@ +apiVersion: nfs.rook.io/v1alpha1 +kind: NFSServer +metadata: + name: {{ include "rook-nfs-server.fullname" . }} + labels: + {{- include "rook-nfs-server.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + exports: +{{- range .Values.exports }} + - name: {{ .name }} + server: + accessMode: {{ .server.accessMode }} + squash: {{ .server.squash | quote }} + {{- with .server.allowedClients }} + allowedClients: + {{- toYaml . | nindent 8 }} + {{- end }} + persistentVolumeClaim: + claimName: {{ $.Release.Name }}-{{ .name }}-pvc +{{ end }} + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} \ No newline at end of file diff --git a/charts/rook-nfs-server/v0.1.0/templates/pvc.yaml b/charts/rook-nfs-server/v0.1.0/templates/pvc.yaml new file mode 100644 index 0000000..81330fe --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/templates/pvc.yaml @@ -0,0 +1,22 @@ +{{- range .Values.exports }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ $.Release.Name }}-{{ .name }}-pvc + labels: + {{- include "rook-nfs-server.labels" $ | nindent 4 }} +spec: + accessModes: + - {{ .persistentVolumeClaim.accessMode | quote }} + resources: + requests: + storage: {{ .persistentVolumeClaim.size | quote }} +{{- if .persistentVolumeClaim.storageClass }} +{{- if (eq "-" .persistentVolumeClaim.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .persistentVolumeClaim.storageClass }}" +{{- end }} +{{- end }} +{{ end }} \ No newline at end of file diff --git a/charts/rook-nfs-server/v0.1.0/templates/rbac.yaml b/charts/rook-nfs-server/v0.1.0/templates/rbac.yaml new file mode 100644 index 0000000..1fce863 --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/templates/rbac.yaml @@ -0,0 +1,15 @@ +{{ if .Values.rbac.create }} +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ .Release.Name }}-provisioner-runner +subjects: + - kind: ServiceAccount + name: rook-nfs-server + # replace with namespace where provisioner is deployed + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: rook-nfs-provisioner-runner + apiGroup: rbac.authorization.k8s.io +{{ end }} \ No newline at end of file diff --git a/charts/rook-nfs-server/v0.1.0/templates/serviceaccount.yaml b/charts/rook-nfs-server/v0.1.0/templates/serviceaccount.yaml new file mode 100644 index 0000000..b435323 --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + # Account name is hardcoded in nfs-operator for nfs-server statefulset + name: rook-nfs-server + labels: + {{- include "rook-nfs-server.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/rook-nfs-server/v0.1.0/values.yaml b/charts/rook-nfs-server/v0.1.0/values.yaml new file mode 100644 index 0000000..c02a750 --- /dev/null +++ b/charts/rook-nfs-server/v0.1.0/values.yaml @@ -0,0 +1,30 @@ +# Default values for rook-nfs-server. + +replicaCount: 1 + +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + +rbac: + create: true + +exports: [] +# - name: share1 +# server: +# accessMode: ReadWrite +# squash: "none" +# allowedClients: [] +# persistentVolumeClaim: +# size: 1Gi +# # Leave empty to use the default storageclass +# storageClass: "" +# accessMode: ReadWriteOnce + +# NFS Server annotations +annotations: {} \ No newline at end of file