Commit 653e7915 by Guangbo Chen

added proposed nfs chart

parent 927e8c2c
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
apiVersion: v1
description: nfs provisioner
name: nfs
version: 0.1.0
icon: https://cdn1.iconfinder.com/data/icons/bnw/128x128/devices/nfs_mount.png
# nfs-provisioner
nfs-provisioner is an out-of-tree dynamic provisioner for Kubernetes. You can use it to quickly & easily deploy shared storage that works almost anywhere.
Or it can help you write your own out-of-tree dynamic provisioner by serving as an example implementation of the requirements detailed in the proposal.
## Introduction
It works just like in-tree dynamic provisioners: a `StorageClass` object can specify an instance of nfs-provisioner to be its `provisioner` like it specifies in-tree provisioners such as GCE or AWS. Then, the instance of nfs-provisioner will watch for `PersistentVolumeClaims` that ask for the `StorageClass` and automatically create NFS-backed `PersistentVolumes` for them. For more information on how dynamic provisioning works, see [the docs](http://kubernetes.io/docs/user-guide/persistent-volumes/) or [this blog post](http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html).
## Prerequisites
- Kubernetes 1.5+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure
## Uninstalling the Chart
If you have chart using this storageClass as dynamic provisioner, please backup the data and remove all the relevant chart before uninstall the nfs chart.
Lastly click `Delete` from the Catalog page will removes all the Kubernetes components associated with the nfs chart and deletes the release.
---
Please see [this example](https://github.com/kubernetes-incubator/external-storage/tree/master/nfs)
for more information.
questions:
- variable: persistence.defaultClass
default: "true"
description: "set as default Storage Class"
type: enum
options:
- "true"
- "false"
required: true
label: Default Storage Class
- variable: persistence.hostPath
default: "/home/srv"
description: "nfs host path (read and write permission to the configured path is required)"
type: string
label: NFS Host Path
1. Get the storageClass URL by running these commands:
kubeclt get storageClass
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "nfs.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).
*/}}
{{- define "nfs.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "nfs.apiversion" -}}
{{- if .Capabilities.APIVersions.Has "apps/v1" -}}
{{- "apps/v1" -}}
{{- else if .Capabilities.APIVersions.Has "extensions/v1beta2" -}}
{{- "extensions/v1beta2" -}}
{{- else if .Capabilities.APIVersions.Has "extensions/v1beta1" -}}
{{- "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "nfs.fullname" . }}-runner
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["services", "endpoints"]
verbs: ["get"]
- apiGroups: ["extensions"]
resources: ["podsecuritypolicies"]
resourceNames: [{{ template "nfs.fullname" . }}]
verbs: ["use"]
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "nfs.fullname" . }}-run
subjects:
- kind: ServiceAccount
name: {{ template "nfs.fullname" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ template "nfs.fullname" . }}-runner
apiGroup: rbac.authorization.k8s.io
apiVersion: {{ template "nfs.apiversion" . }}
kind: DaemonSet
metadata:
name: {{ template "nfs.fullname" . }}
labels:
app: {{ template "nfs.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
template:
metadata:
labels:
app: {{ template "nfs.name" . }}
release: {{ .Release.Name }}
spec:
serviceAccount: {{ template "nfs.fullname" . }}
containers:
- name: nfs-provisioner
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: nfs
containerPort: 2049
hostPort: 2049
- name: mountd
containerPort: 20048
- name: rpcbind
containerPort: 111
- name: rpcbind-udp
containerPort: 111
protocol: UDP
securityContext:
capabilities:
add:
- DAC_READ_SEARCH
- SYS_RESOURCE
args:
- "-provisioner=rancher.io/nfs"
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: export-volume
mountPath: /export
volumes:
- name: export-volume
hostPath:
path: {{ .Values.persistence.hostPath }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "nfs.fullname" . }}
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: rancher-nfs
{{- if .Values.persistence.defaultClass }}
annotations:
storageclass.beta.kubernetes.io/is-default-class: "true"
{{- else }}
annotations:
storageclass.beta.kubernetes.io/is-default-class: "false"
{{- end }}
labels:
kubernetes.io/cluster-service: "true"
provisioner: rancher.io/nfs
# Default values for nfs.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
repository: quay.io/kubernetes_incubator/nfs-provisioner
tag: v1.0.8
pullPolicy: IfNotPresent
persistence:
defaultClass: true
hostPath: /srv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment