Merge pull request #80 from mayankshah1607/mayank/helm-fix
helm: Update charts, initialize repository and add docs
This commit is contained in:
commit
929eefca79
2
Makefile
2
Makefile
@ -90,7 +90,7 @@ install-helm:
|
||||
.PHONY: e2e-bootstrap
|
||||
e2e-bootstrap: install-helm
|
||||
docker pull $(IMAGE_TAG) || make container push
|
||||
helm install csi-driver-nfs ./charts/csi-driver-nfs --namespace kube-system --wait --timeout=15m -v=5 --debug \
|
||||
helm install csi-driver-nfs ./charts/latest/csi-driver-nfs --namespace kube-system --wait --timeout=15m -v=5 --debug \
|
||||
--set image.nfs.repository=$(REGISTRY)/$(IMAGE_NAME) \
|
||||
--set image.nfs.tag=$(IMAGE_VERSION)
|
||||
|
||||
|
||||
63
charts/README.md
Normal file
63
charts/README.md
Normal file
@ -0,0 +1,63 @@
|
||||
# Installation with Helm 3
|
||||
|
||||
Follow this guide to install the NFS Driver for Kubernetes.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Install Helm 3](https://helm.sh/docs/intro/quickstart/#install-helm)
|
||||
|
||||
## Install via `helm install`
|
||||
|
||||
```
|
||||
$ cd charts/latest
|
||||
$ helm install csi-driver-nfs ./csi-driver-nfs -n kube-system
|
||||
```
|
||||
## Install via Helm repository
|
||||
|
||||
```
|
||||
$ helm repo add csi-driver-nfs https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
|
||||
$ helm install --name csi-driver-nfs csi-driver-nfs/csi-driver-nfs --namespace kube-system
|
||||
```
|
||||
|
||||
### Search for available versions
|
||||
|
||||
```
|
||||
$ helm search repo -l csi-driver-nfs
|
||||
```
|
||||
|
||||
### Install a specific verison
|
||||
|
||||
```
|
||||
https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts --version v2.0.0
|
||||
```
|
||||
|
||||
## Chart configuration
|
||||
|
||||
The following table lists the configurable parameters of the latest NFS CSI Driver chart and their default values.
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|------------------------------------------------------------|-------------------------------------------------------------------|
|
||||
| `image.nfs.repository` | csi-driver-nfs docker image | mcr.microsoft.com/k8s/csi/nfs-csi |
|
||||
| `image.nfs.tag` | csi-driver-nfs docker image tag | latest |
|
||||
| `image.nfs.pullPolicy` | csi-driver-nfs image pull policy | IfNotPresent |
|
||||
| `image.csiProvisioner.repository` | csi-provisioner docker image | mcr.microsoft.com/oss/kubernetes-csi/csi-provisioner |
|
||||
| `image.csiProvisioner.tag` | csi-provisioner docker image tag | v1.4.0 |
|
||||
| `image.csiProvisioner.pullPolicy` | csi-provisioner image pull policy | IfNotPresent |
|
||||
| `image.livenessProbe.repository` | liveness-probe docker image | mcr.microsoft.com/oss/kubernetes-csi/livenessprobe |
|
||||
| `image.livenessProbe.tag` | liveness-probe docker image tag | v1.1.0 |
|
||||
| `image.livenessProbe.pullPolicy` | liveness-probe image pull policy | IfNotPresent |
|
||||
| `image.nodeDriverRegistrar.repository` | csi-node-driver-registrar docker image | mcr.microsoft.com/oss/kubernetes-csi/csi-node-driver-registrar |
|
||||
| `image.nodeDriverRegistrar.tag` | csi-node-driver-registrar docker image tag | v1.2.0 |
|
||||
| `image.nodeDriverRegistrar.pullPolicy` | csi-node-driver-registrar image pull policy | IfNotPresent |
|
||||
| `serviceAccount.create` | whether create service account of csi-nfs-controller | true |
|
||||
| `rbac.create` | whether create rbac of csi-nfs-controller | true |
|
||||
| `controller.replicas` | the replicas of csi-nfs-controller | 2 |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If there are some errors when using helm to install, follow the steps to debug:
|
||||
|
||||
1. Add `--wait -v=5 --debug` in `helm install` command.
|
||||
2. Then the error pods can be located.
|
||||
3. Use `kubectl describe` to acquire more info.
|
||||
4. Check the related resource of the pod, such as serviceaacount, rbac, etc.
|
||||
@ -1,5 +0,0 @@
|
||||
apiVersion: v1
|
||||
appVersion: "1.0"
|
||||
description: A Helm chart for Kubernetes
|
||||
name: csi-driver-nfs
|
||||
version: 0.1.0
|
||||
22
charts/index.yaml
Normal file
22
charts/index.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
entries:
|
||||
csi-driver-nfs:
|
||||
- apiVersion: v1
|
||||
appVersion: v2.0.0
|
||||
created: "2020-11-13T16:06:53.1675609+05:30"
|
||||
description: CSI NFS Driver for Kubernetes
|
||||
digest: 0a2a89ad91485b277e53bdf41a58c07dbc0f8910cb63494411e46bf17c4a7196
|
||||
name: csi-driver-nfs
|
||||
urls:
|
||||
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/v2.0.0/csi-driver-nfs-v2.0.0.tgz
|
||||
version: v2.0.0
|
||||
- apiVersion: v1
|
||||
appVersion: latest
|
||||
created: "2020-11-13T16:06:53.1671254+05:30"
|
||||
description: CSI NFS Driver for Kubernetes
|
||||
digest: 0e85c143ff5bc783089d2439e6b533949916657d50e9267d10b8add3dff027eb
|
||||
name: csi-driver-nfs
|
||||
urls:
|
||||
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts/latest/csi-driver-nfs-latest.tgz
|
||||
version: latest
|
||||
generated: "2020-11-13T16:06:53.1665574+05:30"
|
||||
BIN
charts/latest/csi-driver-nfs-latest.tgz
Normal file
BIN
charts/latest/csi-driver-nfs-latest.tgz
Normal file
Binary file not shown.
5
charts/latest/csi-driver-nfs/Chart.yaml
Normal file
5
charts/latest/csi-driver-nfs/Chart.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
appVersion: latest
|
||||
description: CSI NFS Driver for Kubernetes
|
||||
name: csi-driver-nfs
|
||||
version: latest
|
||||
@ -30,8 +30,7 @@ spec:
|
||||
args:
|
||||
- "-v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--enable-leader-election"
|
||||
- "--leader-election-type=leases"
|
||||
- "--leader-election"
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
23
charts/latest/csi-driver-nfs/values.yaml
Normal file
23
charts/latest/csi-driver-nfs/values.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
image:
|
||||
nfs:
|
||||
repository: gcr.io/k8s-staging-sig-storage/nfsplugin
|
||||
tag: amd64-linux-canary
|
||||
pullPolicy: IfNotPresent
|
||||
csiProvisioner:
|
||||
repository: k8s.gcr.io/sig-storage/csi-provisioner
|
||||
tag: v2.0.4
|
||||
pullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
repository: k8s.gcr.io/sig-storage/livenessprobe
|
||||
tag: v2.1.0
|
||||
pullPolicy: IfNotPresent
|
||||
nodeDriverRegistrar:
|
||||
repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar
|
||||
tag: v2.0.1
|
||||
pullPolicy: IfNotPresent
|
||||
serviceAccount:
|
||||
create: true
|
||||
rbac:
|
||||
create: true
|
||||
controller:
|
||||
replicas: 2
|
||||
BIN
charts/v2.0.0/csi-driver-nfs-v2.0.0.tgz
Normal file
BIN
charts/v2.0.0/csi-driver-nfs-v2.0.0.tgz
Normal file
Binary file not shown.
22
charts/v2.0.0/csi-driver-nfs/.helmignore
Normal file
22
charts/v2.0.0/csi-driver-nfs/.helmignore
Normal file
@ -0,0 +1,22 @@
|
||||
# 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
|
||||
.vscode/
|
||||
5
charts/v2.0.0/csi-driver-nfs/Chart.yaml
Normal file
5
charts/v2.0.0/csi-driver-nfs/Chart.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
appVersion: v2.0.0
|
||||
description: CSI NFS Driver for Kubernetes
|
||||
name: csi-driver-nfs
|
||||
version: v2.0.0
|
||||
5
charts/v2.0.0/csi-driver-nfs/templates/NOTES.txt
Normal file
5
charts/v2.0.0/csi-driver-nfs/templates/NOTES.txt
Normal file
@ -0,0 +1,5 @@
|
||||
The CSI NFS Driver is getting deployed to your cluster.
|
||||
|
||||
To check CSI NFS Driver pods status, please run:
|
||||
|
||||
kubectl --namespace={{ .Release.Namespace }} get pods --selector="release={{ .Release.Name }}" --watch
|
||||
11
charts/v2.0.0/csi-driver-nfs/templates/_helpers.tpl
Normal file
11
charts/v2.0.0/csi-driver-nfs/templates/_helpers.tpl
Normal file
@ -0,0 +1,11 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/* labels for helm resources */}}
|
||||
{{- define "nfs.labels" -}}
|
||||
labels:
|
||||
heritage: "{{ .Release.Service }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
revision: "{{ .Release.Revision }}"
|
||||
chart: "{{ .Chart.Name }}"
|
||||
chartVersion: "{{ .Chart.Version }}"
|
||||
{{- end -}}
|
||||
110
charts/v2.0.0/csi-driver-nfs/templates/csi-nfs-controller.yaml
Normal file
110
charts/v2.0.0/csi-driver-nfs/templates/csi-nfs-controller.yaml
Normal file
@ -0,0 +1,110 @@
|
||||
---
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: csi-nfs-controller
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{ include "nfs.labels" . | indent 2 }}
|
||||
spec:
|
||||
replicas: {{ .Values.controller.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: csi-nfs-controller
|
||||
template:
|
||||
metadata:
|
||||
{{ include "nfs.labels" . | indent 6 }}
|
||||
app: csi-nfs-controller
|
||||
spec:
|
||||
serviceAccountName: csi-nfs-controller-sa
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
priorityClassName: system-cluster-critical
|
||||
tolerations:
|
||||
- key: "node-role.kubernetes.io/master"
|
||||
operator: "Equal"
|
||||
value: "true"
|
||||
effect: "NoSchedule"
|
||||
containers:
|
||||
- name: csi-provisioner
|
||||
image: "{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}"
|
||||
args:
|
||||
- "-v=5"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--leader-election"
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi.sock
|
||||
imagePullPolicy: {{ .Values.image.csiProvisioner.pullPolicy }}
|
||||
volumeMounts:
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 20Mi
|
||||
- name: liveness-probe
|
||||
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
|
||||
args:
|
||||
- --csi-address=/csi/csi.sock
|
||||
- --probe-timeout=3s
|
||||
- --health-port=29642
|
||||
- --v=5
|
||||
imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /csi
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 20Mi
|
||||
- name: nfs
|
||||
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add: ["SYS_ADMIN"]
|
||||
allowPrivilegeEscalation: true
|
||||
imagePullPolicy: {{ .Values.image.nfs.pullPolicy }}
|
||||
args:
|
||||
- "-v=5"
|
||||
- "--nodeid=$(NODE_ID)"
|
||||
- "--endpoint=$(CSI_ENDPOINT)"
|
||||
env:
|
||||
- name: NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CSI_ENDPOINT
|
||||
value: unix:///csi/csi.sock
|
||||
volumeMounts:
|
||||
- name: plugin-dir
|
||||
mountPath: /plugin
|
||||
- name: pods-mount-dir
|
||||
mountPath: /var/lib/kubelet/pods
|
||||
mountPropagation: "Bidirectional"
|
||||
- mountPath: /csi
|
||||
name: socket-dir
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 200Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 20Mi
|
||||
volumes:
|
||||
- name: plugin-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/plugins/csi-nfsplugin
|
||||
type: DirectoryOrCreate
|
||||
- name: pods-mount-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/pods
|
||||
type: Directory
|
||||
- name: socket-dir
|
||||
emptyDir: {}
|
||||
@ -0,0 +1,9 @@
|
||||
apiVersion: storage.k8s.io/v1beta1
|
||||
kind: CSIDriver
|
||||
metadata:
|
||||
name: nfs.csi.k8s.io
|
||||
spec:
|
||||
attachRequired: false
|
||||
volumeLifecycleModes:
|
||||
- Persistent
|
||||
podInfoOnMount: true
|
||||
79
charts/v2.0.0/csi-driver-nfs/templates/csi-nfs-node.yaml
Normal file
79
charts/v2.0.0/csi-driver-nfs/templates/csi-nfs-node.yaml
Normal file
@ -0,0 +1,79 @@
|
||||
# This YAML file contains driver-registrar & csi driver nodeplugin API objects
|
||||
# that are necessary to run CSI nodeplugin for nfs
|
||||
kind: DaemonSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: csi-nfs-node
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{ include "nfs.labels" . | indent 2 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: csi-nfs-node
|
||||
template:
|
||||
metadata:
|
||||
{{ include "nfs.labels" . | indent 6 }}
|
||||
app: csi-nfs-node
|
||||
spec:
|
||||
hostNetwork: true # original nfs connection would be broken without hostNetwork setting
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
containers:
|
||||
- name: node-driver-registrar
|
||||
image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}"
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command: ["/bin/sh", "-c", "rm -rf /registration/csi-nfsplugin /registration/csi-nfsplugin-reg.sock"]
|
||||
args:
|
||||
- --v=5
|
||||
- --csi-address=/plugin/csi.sock
|
||||
- --kubelet-registration-path=/var/lib/kubelet/plugins/csi-nfsplugin/csi.sock
|
||||
env:
|
||||
- name: KUBE_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
imagePullPolicy: {{ .Values.image.nodeDriverRegistrar.pullPolicy }}
|
||||
volumeMounts:
|
||||
- name: plugin-dir
|
||||
mountPath: /plugin
|
||||
- name: registration-dir
|
||||
mountPath: /registration
|
||||
- name: nfs
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add: ["SYS_ADMIN"]
|
||||
allowPrivilegeEscalation: true
|
||||
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
|
||||
args :
|
||||
- "-v=5"
|
||||
- "--nodeid=$(NODE_ID)"
|
||||
- "--endpoint=$(CSI_ENDPOINT)"
|
||||
env:
|
||||
- name: NODE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: CSI_ENDPOINT
|
||||
value: unix://plugin/csi.sock
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
volumeMounts:
|
||||
- name: plugin-dir
|
||||
mountPath: /plugin
|
||||
- name: pods-mount-dir
|
||||
mountPath: /var/lib/kubelet/pods
|
||||
mountPropagation: "Bidirectional"
|
||||
volumes:
|
||||
- name: plugin-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/plugins/csi-nfsplugin
|
||||
type: DirectoryOrCreate
|
||||
- name: pods-mount-dir
|
||||
hostPath:
|
||||
path: /var/lib/kubelet/pods
|
||||
type: Directory
|
||||
- hostPath:
|
||||
path: /var/lib/kubelet/plugins_registry
|
||||
type: Directory
|
||||
name: registration-dir
|
||||
@ -0,0 +1,54 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: csi-nfs-controller-sa
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{ include "nfs.labels" . | indent 2 }}
|
||||
---
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Values.rbac.create -}}
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: nfs-external-provisioner-role
|
||||
{{ include "nfs.labels" . | indent 2 }}
|
||||
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: ["get", "list", "watch", "create", "update", "patch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["csinodes"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leases"]
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: nfs-csi-provisioner-binding
|
||||
{{ include "nfs.labels" . | indent 2 }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: csi-nfs-controller-sa
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: nfs-external-provisioner-role
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
{{- end -}}
|
||||
@ -4,23 +4,20 @@ image:
|
||||
tag: v2.0.0
|
||||
pullPolicy: IfNotPresent
|
||||
csiProvisioner:
|
||||
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-provisioner
|
||||
tag: v1.4.0
|
||||
repository: k8s.gcr.io/sig-storage/csi-provisioner
|
||||
tag: v2.0.4
|
||||
pullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
repository: mcr.microsoft.com/oss/kubernetes-csi/livenessprobe
|
||||
tag: v2.0.0
|
||||
repository: k8s.gcr.io/sig-storage/livenessprobe
|
||||
tag: v2.1.0
|
||||
pullPolicy: IfNotPresent
|
||||
nodeDriverRegistrar:
|
||||
repository: mcr.microsoft.com/oss/kubernetes-csi/csi-node-driver-registrar
|
||||
tag: v1.2.0
|
||||
repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar
|
||||
tag: v2.0.1
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
serviceAccount:
|
||||
create: true
|
||||
|
||||
rbac:
|
||||
create: true
|
||||
|
||||
controller:
|
||||
replicas: 2
|
||||
Loading…
x
Reference in New Issue
Block a user