Skip to content

Commit 471ec24

Browse files
committed
Add helm chart files
1 parent dd6d29a commit 471ec24

File tree

25 files changed

+535
-47
lines changed

25 files changed

+535
-47
lines changed

CHANGELOG-0.x.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# v0.1.0
2+
3+

all-push

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
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/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Helm chart
2+
3+
# v1.0.0
4+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v2
2+
appVersion: "1.0.0"
3+
name: aws-file-cache-csi-driver
4+
description: A Helm chart for Amazon File Cache CSI Driver
5+
version: 0.1.0
6+
kubeVersion: ">=1.17.0-0"
7+
home: https://github.com/jacobwolfaws/aws-file-cache-csi-driver
8+
sources:
9+
- https://github.com/jacobwolfaws/aws-file-cache-csi-driver
10+
keywords:
11+
- aws
12+
- file
13+
- cache
14+
- csi
15+
maintainers:
16+
- name: Kubernetes Authors
17+
url: https://github.com/kubernetes-sigs/aws-file-cache-csi-driver/
18+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "aws-file-cache-csi-driver.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "aws-file-cache-csi-driver.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "aws-file-cache-csi-driver.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "aws-file-cache-csi-driver.labels" -}}
38+
{{ include "aws-file-cache-csi-driver.selectorLabels" . }}
39+
{{- if ne .Release.Name "kustomize" }}
40+
helm.sh/chart: {{ include "aws-file-cache-csi-driver.chart" . }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
app.kubernetes.io/managed-by: {{ .Release.Service }}
45+
{{- end }}
46+
{{- end -}}
47+
48+
{{/*
49+
Common selector labels
50+
*/}}
51+
{{- define "aws-file-cache-csi-driver.selectorLabels" -}}
52+
app.kubernetes.io/name: {{ include "aws-file-cache-csi-driver.name" . }}
53+
{{- if ne .Release.Name "kustomize" }}
54+
app.kubernetes.io/instance: {{ .Release.Name }}
55+
{{- end }}
56+
{{- end -}}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: file-cache-csi-controller
5+
labels:
6+
{{- include "aws-file-cache-csi-driver.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.controller.replicaCount }}
9+
selector:
10+
matchLabels:
11+
app: file-cache-csi-controller
12+
{{- include "aws-file-cache-csi-driver.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
{{- with .Values.controller.podAnnotations }}
16+
annotations:
17+
{{- toYaml . | nindent 8 }}
18+
{{- end }}
19+
labels:
20+
app: file-cache-csi-controller
21+
{{- include "aws-file-cache-csi-driver.labels" . | nindent 8 }}
22+
spec:
23+
{{- if .Values.imagePullSecrets }}
24+
imagePullSecrets:
25+
{{- range .Values.imagePullSecrets }}
26+
- name: {{ . }}
27+
{{- end }}
28+
{{- end }}
29+
nodeSelector:
30+
kubernetes.io/os: linux
31+
{{- with .Values.controller.nodeSelector }}
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
34+
hostNetwork: true
35+
serviceAccountName: {{ .Values.controller.serviceAccount.name }}
36+
priorityClassName: system-cluster-critical
37+
tolerations:
38+
- key: CriticalAddonsOnly
39+
operator: Exists
40+
- operator: Exists
41+
effect: NoExecute
42+
tolerationSeconds: 300
43+
{{- with .Values.controller.tolerations }}
44+
{{- toYaml . | nindent 8 }}
45+
{{- end }}
46+
containers:
47+
- name: file-cache-plugin
48+
image: {{ printf "%s:%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) (toString .Values.image.tag)) }}
49+
imagePullPolicy: {{ .Values.image.pullPolicy }}
50+
args:
51+
- --endpoint=$(CSI_ENDPOINT)
52+
- --v=5
53+
env:
54+
- name: CSI_ENDPOINT
55+
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
56+
volumeMounts:
57+
- name: socket-dir
58+
mountPath: /var/lib/csi/sockets/pluginproxy/
59+
ports:
60+
- name: healthz
61+
containerPort: 9910
62+
protocol: TCP
63+
livenessProbe:
64+
httpGet:
65+
path: /healthz
66+
port: healthz
67+
initialDelaySeconds: 10
68+
timeoutSeconds: 3
69+
periodSeconds: 2
70+
failureThreshold: 5
71+
{{- with .Values.controller.resources }}
72+
resources:
73+
{{- toYaml . | nindent 12 }}
74+
{{- end }}
75+
- name: csi-provisioner
76+
image: {{ printf "%s:%s" .Values.sidecars.provisioner.image.repository .Values.sidecars.provisioner.image.tag }}
77+
args:
78+
- --csi-address=$(ADDRESS)
79+
- --timeout=5m
80+
- --extra-create-metadata
81+
- --leader-election=true
82+
env:
83+
- name: ADDRESS
84+
value: /var/lib/csi/sockets/pluginproxy/csi.sock
85+
volumeMounts:
86+
- name: socket-dir
87+
mountPath: /var/lib/csi/sockets/pluginproxy/
88+
{{- with default .Values.controller.resources .Values.sidecars.provisioner.resources }}
89+
resources:
90+
{{- toYaml . | nindent 12 }}
91+
{{- end }}
92+
- name: liveness-probe
93+
image: {{ printf "%s:%s" .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }}
94+
args:
95+
- --csi-address=/csi/csi.sock
96+
- --health-port=9910
97+
volumeMounts:
98+
- name: socket-dir
99+
mountPath: /csi
100+
{{- with default .Values.controller.resources .Values.sidecars.livenessProbe.resources }}
101+
resources:
102+
{{- toYaml . | nindent 12 }}
103+
{{- end }}
104+
volumes:
105+
- name: socket-dir
106+
emptyDir: {}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{{- if .Values.controller.serviceAccount.create }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ .Values.controller.serviceAccount.name }}
6+
labels:
7+
{{- include "aws-file-cache-csi-driver.labels" . | nindent 4 }}
8+
{{- with .Values.controller.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- else }}
13+
{{- $exists := (lookup "v1" "ServiceAccount" .Release.Namespace .Values.controller.serviceAccount.name) }}
14+
{{- if not $exists }}
15+
{{- fail (printf "create serviceaccount %s/%s or set .controller.serviceaccount.create true" .Release.Namespace .Values.controller.serviceAccount.name) }}
16+
{{- end }}
17+
{{- end }}
18+
---
19+
20+
kind: ClusterRole
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
metadata:
23+
name: file-cache-csi-external-provisioner-role
24+
labels:
25+
{{- include "aws-file-cache-csi-driver.labels" . | nindent 4 }}
26+
rules:
27+
- apiGroups: [""]
28+
resources: ["persistentvolumes"]
29+
verbs: ["get", "list", "watch", "create", "delete"]
30+
- apiGroups: [""]
31+
resources: ["persistentvolumeclaims"]
32+
verbs: ["get", "list", "watch", "update"]
33+
- apiGroups: ["storage.k8s.io"]
34+
resources: ["storageclasses"]
35+
verbs: ["get", "list", "watch"]
36+
- apiGroups: [""]
37+
resources: ["events"]
38+
verbs: ["list", "watch", "create", "update", "patch"]
39+
- apiGroups: ["storage.k8s.io"]
40+
resources: ["csinodes"]
41+
verbs: ["get", "list", "watch"]
42+
- apiGroups: [""]
43+
resources: ["nodes"]
44+
verbs: ["get", "list", "watch"]
45+
- apiGroups: ["coordination.k8s.io"]
46+
resources: ["leases"]
47+
verbs: ["get", "watch", "list", "delete", "update", "create"]
48+
---
49+
50+
kind: ClusterRoleBinding
51+
apiVersion: rbac.authorization.k8s.io/v1
52+
metadata:
53+
name: file-cache-csi-external-provisioner-binding
54+
labels:
55+
{{- include "aws-file-cache-csi-driver.labels" . | nindent 4 }}
56+
subjects:
57+
- kind: ServiceAccount
58+
name: {{ .Values.controller.serviceAccount.name }}
59+
namespace: {{ .Release.Namespace }}
60+
roleRef:
61+
kind: ClusterRole
62+
name: file-cache-csi-external-provisioner-role
63+
apiGroup: rbac.authorization.k8s.io
64+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: {{ ternary "storage.k8s.io/v1" "storage.k8s.io/v1beta1" (semverCompare ">=1.18.0-0" .Capabilities.KubeVersion.Version) }}
2+
kind: CSIDriver
3+
metadata:
4+
name: filecache.csi.aws.com
5+
spec:
6+
attachRequired: false
7+
fsGroupPolicy: {{ .Values.csidriver.fsGroupPolicy }}

0 commit comments

Comments
 (0)