Fábio Kaiser Rauber
3 years ago
9 changed files with 201 additions and 0 deletions
@ -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/ |
@ -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" |
@ -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 }} |
@ -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 }} |
@ -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 }} |
@ -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 }} |
@ -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 }} |
@ -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 }} |
@ -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: {} |
Loading…
Reference in new issue