-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add chart eks-local-disk-provisioner (#7)
* Add chart eks-local-disk-provisioner * Update README * Fix trailing spaces
- Loading branch information
Svetomir Smiljkovic
authored
Mar 31, 2020
1 parent
31bfb4f
commit 4d1ae3c
Showing
9 changed files
with
341 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
appVersion: 0.1.0 | ||
name: eks-local-disk-provisioner | ||
version: 0.1.0 | ||
description: AWS eks-local-disk-provisioner Helm chart for Kubernetes | ||
home: https://swarm.ethereum.org | ||
icon: https://swarm-guide.readthedocs.io/en/latest/_images/swarm.png | ||
keywords: | ||
- aws | ||
- kubernetes | ||
- eks | ||
- local disk provisioner | ||
- local persistent volume | ||
- sig-storage-local-static-provisioner | ||
maintainers: | ||
- name: svetomir | ||
email: [email protected] | ||
sources: | ||
- https://github.com/ethersphere/eks-local-disk-provisioner | ||
type: application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# AWS EKS local-disk-provisioner Helm Chart | ||
|
||
## QuickStart | ||
|
||
```bash | ||
$ helm install --generate-name ethersphere/eks-local-disk-provisioner | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart deploys a [eks-local-disk-provisioner](https://github.com/ethersphere/eks-local-disk-provisioner) onto a Kubernetes cluster using the Helm package manager. It creates DaemonSet Kubernetes object, while ServiceAccount is optional. | ||
|
||
## Prerequisites | ||
|
||
* Kubernetes 1.15 | ||
* Helm 3.0 | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```bash | ||
$ helm install --name my-release ethersphere/eks-local-disk-provisioner | ||
``` | ||
|
||
The command deploys eks-local-disk-provisioner on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `my-release` deployment: | ||
|
||
```bash | ||
$ helm delete my-release | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The default configuration values for this chart are listed in **values.yaml**. | ||
|
||
eks-local-disk-provisioner specific configuration parameters can be configured in **provisionerConfig** section. | ||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, | ||
|
||
```bash | ||
$ helm install --name my-release \ | ||
--set serviceAccount.create=true \ | ||
ethersphere/eks-local-disk-provisioner | ||
``` | ||
|
||
The above command creates ServiceAccount for the DaemonSet. | ||
|
||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, | ||
|
||
```bash | ||
$ helm install --name my-release -f values.yaml ethersphere/eks-local-disk-provisioner | ||
``` | ||
|
||
## Helmsman Usage | ||
|
||
### Prerequisites | ||
|
||
* Kubernetes 1.15 | ||
* Helm 3.0 | ||
* Helmsman 3.0 | ||
|
||
### Installing | ||
|
||
Create eks-local-disk-provisioner.yaml file as shown bellow: | ||
|
||
```yaml | ||
namespaces: | ||
kube-system: | ||
|
||
helmRepos: | ||
ethersphere: "https://ethersphere.github.io/helm" | ||
|
||
apps: | ||
eks-local-disk-provisioner: | ||
name: eks-local-disk-provisioner | ||
namespace: kube-system | ||
description: "AWS EKS Local Disk Provisioner" | ||
chart: "ethersphere/eks-local-disk-provisioner" | ||
version: "0.1.0" | ||
enabled: true | ||
wait: true | ||
timeout: 120 | ||
|
||
``` | ||
|
||
Execute following command: | ||
```bash | ||
$ helmsman -apply -f eks-local-disk-provisioner.yaml | ||
``` | ||
|
||
### Uninstalling | ||
|
||
Execute following command: | ||
```bash | ||
$ helmsman -destroy -f eks-local-disk-provisioner.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eks-local-disk-provisioner installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "eks-local-disk-provisioner.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 "eks-local-disk-provisioner.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 "eks-local-disk-provisioner.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "eks-local-disk-provisioner.labels" -}} | ||
helm.sh/chart: {{ include "eks-local-disk-provisioner.chart" . }} | ||
{{ include "eks-local-disk-provisioner.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "eks-local-disk-provisioner.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "eks-local-disk-provisioner.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "eks-local-disk-provisioner.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "eks-local-disk-provisioner.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
71 changes: 71 additions & 0 deletions
71
charts/eks-local-disk-provisioner/templates/daemonset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: {{ include "eks-local-disk-provisioner.fullname" . }} | ||
labels: | ||
{{- include "eks-local-disk-provisioner.labels" . | nindent 4 }} | ||
namespace: {{ .Values.namespace }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "eks-local-disk-provisioner.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "eks-local-disk-provisioner.selectorLabels" . | nindent 8 }} | ||
{{- if .Values.podAnnotations }} | ||
annotations: | ||
{{ toYaml .Values.podAnnotations | indent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} | ||
priorityClassName: {{ .Values.priorityClassName }} | ||
serviceAccountName: {{ include "eks-local-disk-provisioner.serviceAccountName" . }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
env: | ||
- name: PARTED_SCRIPT | ||
value: "{{ .Values.provisionerConfig.parted_script }}" | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
volumeMounts: | ||
- name: host-dev | ||
mountPath: /dev | ||
mountPropagation: "Bidirectional" | ||
- name: host-disks | ||
mountPath: /mnt/disks | ||
mountPropagation: "Bidirectional" | ||
- name: host-etc-fstab | ||
mountPath: /etc/fstab | ||
subPath: fstab | ||
mountPropagation: "Bidirectional" | ||
volumes: | ||
- name: host-dev | ||
hostPath: | ||
path: /dev | ||
- name: host-disks | ||
hostPath: | ||
path: /mnt/disks | ||
- name: host-etc-fstab | ||
hostPath: | ||
path: /etc |
8 changes: 8 additions & 0 deletions
8
charts/eks-local-disk-provisioner/templates/serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "eks-local-disk-provisioner.serviceAccountName" . }} | ||
labels: | ||
{{- include "eks-local-disk-provisioner.labels" . | nindent 4 }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Default values for eks-local-disk-provisioner. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
image: | ||
repository: ethersphere/eks-local-disk-provisioner | ||
tag: latest | ||
pullPolicy: IfNotPresent | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
namespace: kube-system | ||
|
||
serviceAccount: | ||
# Specifies whether a service account should be created | ||
create: false | ||
# The name of the service account to use. | ||
# If not set and create is true, a name is generated using the fullname template | ||
name: | ||
|
||
automountServiceAccountToken: false | ||
priorityClassName: system-node-critical | ||
|
||
securityContext: | ||
privileged: true | ||
|
||
resources: {} | ||
# If you do want to specify resources, uncomment the following lines, | ||
# adjust them as necessary, and remove the curly braces after 'resources:'. | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
podAnnotations: {} | ||
|
||
nodeSelector: {} | ||
|
||
affinity: {} | ||
|
||
tolerations: [] | ||
|
||
provisionerConfig: | ||
# Parted script for disk partitioning. For more info, see: https://www.gnu.org/software/parted/ | ||
# Variable will be passed to the command 'parted --script <parted_script>' for every NVME SSD disk. | ||
# Example: "mklabel gpt mkpart logical 0% 50% mkpart logical 50% 100%" | ||
parted_script: "" |