diff --git a/charts/ipfs/1.0.0/.helmignore b/charts/ipfs/1.0.0/.helmignore new file mode 100644 index 0000000000..a9fe727881 --- /dev/null +++ b/charts/ipfs/1.0.0/.helmignore @@ -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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +# OWNERS file for Kubernetes +OWNERS \ No newline at end of file diff --git a/charts/ipfs/1.0.0/Chart.yaml b/charts/ipfs/1.0.0/Chart.yaml new file mode 100644 index 0000000000..9cbe207526 --- /dev/null +++ b/charts/ipfs/1.0.0/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +description: Global, Versioned, peer-to-peer filesystem. +name: ipfs +version: 1.0.0 +appVersion: master +keywords: +- storage +- p2p +home: https://ipfs.io +icon: https://ipfs.io/ipfs/QmVk7srrwahXLNmcDYvyUEJptyoxpndnRa57YJ11L4jV26/ipfs.go.png +sources: +- https://github.com/ipfs/go-ipfs +- https://hub.docker.com/r/ipfs/go-ipfs +upstream_version: 0.8.0-rc1 diff --git a/charts/ipfs/1.0.0/README.md b/charts/ipfs/1.0.0/README.md new file mode 100755 index 0000000000..8b158db531 --- /dev/null +++ b/charts/ipfs/1.0.0/README.md @@ -0,0 +1,28 @@ +IPFS +===== + +[IPFS](https://ipfs.io) is a global, versioned, peer-to-peer filesystem. It combines good ideas from previous systems such Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single bittorrent swarm, exchanging git objects. IPFS provides an interface as simple as the HTTP web, but with permanence built in. You can also mount the world at /ipfs. + +Introduction +------------ + +This chart bootstraps IPFS deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + + +Configuration +------------- + +The following table lists the configurable parameters of the IPFS chart and their default values. + +| Parameter | Description | Default | +|:-------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------| +| `image.repository` | Image repository | `ipfs/go-ipfs` | +| `image.tag` | MinIO image tag. Possible values listed [here](https://hub.docker.com/r/ipfs/go-ipfs/tags). | `v0.8.0-rc1` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `extraArgs` | Additional command line arguments to pass to the IPFS server | `[]` | +| `persistence.enabled` | Use persistent volume to store data | `true` | +| `persistence.size` | Size of persistent volume claim | `500Gi` | +| `persistence.existingClaim` | Use an existing PVC to persist data | `nil` | +| `persistence.storageClass` | Storage class name of PVC | `nil` | +| `persistence.accessMode` | ReadWriteOnce or ReadOnly | `ReadWriteOnce` | +| `persistence.subPath` | Mount a sub directory of the persistent volume if set | `""` | diff --git a/charts/ipfs/1.0.0/app-readme.md b/charts/ipfs/1.0.0/app-readme.md new file mode 100644 index 0000000000..dc481d47c8 --- /dev/null +++ b/charts/ipfs/1.0.0/app-readme.md @@ -0,0 +1 @@ +[IPFS](https://ipfs.io) is a global, versioned, peer-to-peer filesystem. It combines good ideas from previous systems such Git, BitTorrent, Kademlia, SFS, and the Web. It is like a single bittorrent swarm, exchanging git objects. IPFS provides an interface as simple as the HTTP web, but with permanence built in. You can also mount the world at /ipfs. diff --git a/charts/ipfs/1.0.0/questions.yaml b/charts/ipfs/1.0.0/questions.yaml new file mode 100644 index 0000000000..329a32ae1e --- /dev/null +++ b/charts/ipfs/1.0.0/questions.yaml @@ -0,0 +1,160 @@ +groups: + - name: "Container Images" + description: "Image to be used for container" + - name: "Storage" + description: "Configure Storage for IPFS" + +portals: + web_portal: + protocols: + - "http" + host: + - "$node_ip" + ports: + - "$variable-service.nodePort" + +questions: + # Image related + - variable: image + description: "Docker Image Details" + label: "Docker Image" + group: "Container Images" + schema: + type: dict + required: true + attrs: + - variable: repository + description: "Docker image repository" + label: "Image repository" + schema: + type: string + default: "ipfs/go-ipfs" + required: true + - variable: tag + description: "Tag to use for specified image" + label: "Image Tag" + schema: + type: string + default: "v0.8.0-rc1" + - variable: pullPolicy + description: "Docker Image Pull Policy" + label: "Image Pull Policy" + schema: + type: string + default: "IfNotPresent" + enum: + - value: "IfNotPresent" + description: "Only pull image if not present on host" + - value: "Always" + description: "Always pull image even if present on host" + - value: "Never" + description: "Never pull image even if it's not present on host" + + - variable: updateStrategy + label: "IPFS update strategy" + group: "Workload Configuration" + schema: + type: string + default: "RollingUpdate" + enum: + - value: "RollingUpdate" + description: "Create new pods and then kill old ones" + - value: "Recreate" + description: "Kill existing pods before creating new ones" + + - variable: environment + label: "IPFS image environment" + group: "IPFS Configuration" + schema: + type: dict + additional_attrs: true + attrs: [] + + - variable: service + description: "IPFS Service Configuration" + label: "IPFS Service Configuration" + group: "IPFS Configuration" + schema: + type: dict + required: true + attrs: + - variable: nodePort + label: "Node Port to use for IPFS" + schema: + type: int + min: 9000 + max: 65535 + default: 9080 + required: true + + - variable: ipfsDataHostPathEnabled + label: "Configure Host Path for IPFS data" + group: "Storage" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: ipfsDataHostPath + label: "Specify HostPath for IPFS data" + schema: + type: hostpath + + - variable: ipfsDataVolume + label: "Configure iXVolume" + group: "Storage" + schema: + type: dict + $ref: + - "normalize/ixVolume" + show_if: [["ipfsDataHostPathEnabled", "=", false]] + attrs: + - variable: mountPath + label: "Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + editable: false + default: "/data/ipfs" + - variable: datasetName + label: "Dataset Name" + schema: + type: string + default: "ix-ipfs-data" + editable: false + + - variable: ipfsStagingHostPathEnabled + label: "Configure Host Path for IPFS staging" + group: "Storage" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: ipfsStagingHostPath + label: "Specify HostPath for IPFS staging" + schema: + type: hostpath + + - variable: ipfsStagingVolume + label: "Configure iXVolume" + group: "Storage" + schema: + type: dict + $ref: + - "normalize/ixVolume" + show_if: [["ipfsStagingHostPathEnabled", "=", false]] + attrs: + - variable: mountPath + label: "Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + editable: false + default: "/export" + - variable: datasetName + label: "Dataset Name" + schema: + type: string + default: "ix-ipfs-staging" + editable: false diff --git a/charts/ipfs/1.0.0/templates/NOTES.txt b/charts/ipfs/1.0.0/templates/NOTES.txt new file mode 100644 index 0000000000..88e8e93ef8 --- /dev/null +++ b/charts/ipfs/1.0.0/templates/NOTES.txt @@ -0,0 +1,2 @@ +Minio can be accessed from the following URL: +http://$node_ip:{{ .Values.service.nodePort }}/ diff --git a/charts/ipfs/1.0.0/templates/_helpers.tpl b/charts/ipfs/1.0.0/templates/_helpers.tpl new file mode 100644 index 0000000000..800e260911 --- /dev/null +++ b/charts/ipfs/1.0.0/templates/_helpers.tpl @@ -0,0 +1,84 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "ipfs.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 "ipfs.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 "ipfs.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for deployment. +*/}} +{{- define "ipfs.deployment.apiVersion" -}} +{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.Version -}} +{{- print "apps/v1beta2" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for statefulset. +*/}} +{{- define "ipfs.statefulset.apiVersion" -}} +{{- if semverCompare "<1.17-0" .Capabilities.KubeVersion.Version -}} +{{- print "apps/v1beta2" -}} +{{- else -}} +{{- print "apps/v1" -}} +{{- end -}} +{{- end -}} + +{{/* +Determine secret name. +*/}} +{{- define "ipfs.secretName" -}} +{{- include "ipfs.fullname" . -}} +{{- end -}} + +{{/* +Determine service account name for deployment or statefulset. +*/}} +{{- define "ipfs.serviceAccountName" -}} +{{- (include "ipfs.fullname" .) | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Determine name for scc role and rolebinding +*/}} +{{- define "ipfs.sccRoleName" -}} +{{- printf "%s-%s" "scc" (include "ipfs.fullname" .) | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Properly format optional additional arguments to IPFS binary +*/}} +{{- define "ipfs.extraArgs" -}} +{{- range .Values.extraArgs -}} +{{ " " }}{{ . }} +{{- end -}} +{{- end -}} diff --git a/charts/ipfs/1.0.0/templates/_storage.tpl b/charts/ipfs/1.0.0/templates/_storage.tpl new file mode 100644 index 0000000000..a29ec5a4ad --- /dev/null +++ b/charts/ipfs/1.0.0/templates/_storage.tpl @@ -0,0 +1,35 @@ +{{/* +Retrieve host path from ix volumes based on dataset name +*/}} +{{- define "retrieveDataPathFromiXVolume" -}} +{{- range $index, $hostPathConfiguration := $.ixVolumes }} +{{- $dsName := base $hostPathConfiguration.hostPath -}} +{{- if eq $.datasetName $dsName -}} +{{- $hostPathConfiguration.hostPath -}} +{{- end -}} +{{- end }} +{{- end -}} + +{{/* +Retrieve host path for ipfs +*/}} +{{- define "configuredDataHostPath" -}} +{{- if .Values.ipfsDataHostPathEnabled -}} +{{- .Values.ipfsDataHostPath -}} +{{- else -}} +{{- $volDict := dict "datasetName" $.Values.ipfsDataVolume.datasetName "ixVolumes" $.Values.ixVolumes -}} +{{- include "retrieveHostPathFromiXVolume" $volDict -}} +{{- end -}} +{{- end -}} + +{{/* +Retrieve host path for ipfs +*/}} +{{- define "configuredStagingHostPath" -}} +{{- if .Values.ipfsStagingHostPathEnabled -}} +{{- .Values.ipfsStagingHostPath -}} +{{- else -}} +{{- $volDict := dict "datasetName" $.Values.ipfsStagingVolume.datasetName "ixVolumes" $.Values.ixVolumes -}} +{{- include "retrieveHostPathFromiXVolume" $volDict -}} +{{- end -}} +{{- end -}} diff --git a/charts/ipfs/1.0.0/templates/deployment.yaml b/charts/ipfs/1.0.0/templates/deployment.yaml new file mode 100644 index 0000000000..df04c5118d --- /dev/null +++ b/charts/ipfs/1.0.0/templates/deployment.yaml @@ -0,0 +1,57 @@ +{{ $scheme := "http" }} +apiVersion: {{ template "ipfs.deployment.apiVersion" . }} +kind: Deployment +metadata: + name: {{ template "ipfs.fullname" . }} + labels: + app: {{ template "ipfs.name" . }} + chart: {{ template "ipfs.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + strategy: + type: {{ .Values.updateStrategy }} + selector: + matchLabels: + app: {{ template "ipfs.name" . }} + release: {{ .Release.Name }} + template: + metadata: + name: {{ template "ipfs.fullname" . }} + labels: + app: {{ template "ipfs.name" . }} + release: {{ .Release.Name }} + spec: + serviceAccountName: {{ include "ipfs.serviceAccountName" . | quote }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + - name: data + mountPath: /data/ipfs + volumeMounts: + - name: staging + mountPath: /export + ports: + - name: {{ $scheme }} + containerPort: 9080 + {{- range $key, $val := .Values.environment }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end}} + volumes: + - name: data + {{- if .Values.emptyDirVolumes }} + emptyDir: {} + {{- else }} + hostPath: + path: {{ template "configuredDataHostPath" . }} + {{- end }} + - name: staging + {{- if .Values.emptyDirVolumes }} + emptyDir: {} + {{- else }} + hostPath: + path: {{ template "configuredStagingHostPath" . }} + {{- end }} diff --git a/charts/ipfs/1.0.0/templates/service.yaml b/charts/ipfs/1.0.0/templates/service.yaml new file mode 100644 index 0000000000..9039bbb7a5 --- /dev/null +++ b/charts/ipfs/1.0.0/templates/service.yaml @@ -0,0 +1,21 @@ +{{ $scheme := "http" }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "ipfs.fullname" . }} + labels: + app: {{ template "ipfs.name" . }} + chart: {{ template "ipfs.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: "NodePort" + ports: + - name: {{ $scheme }} + port: {{ .Values.service.nodePort }} + protocol: TCP + nodePort: {{ .Values.service.nodePort }} + targetPort: 9080 + selector: + app: {{ template "ipfs.name" . }} + release: {{ .Release.Name }} diff --git a/charts/ipfs/1.0.0/templates/serviceaccount.yaml b/charts/ipfs/1.0.0/templates/serviceaccount.yaml new file mode 100644 index 0000000000..05d1db5bbe --- /dev/null +++ b/charts/ipfs/1.0.0/templates/serviceaccount.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "ipfs.serviceAccountName" . | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + app: {{ template "ipfs.name" . }} + chart: {{ template "ipfs.chart" . }} + release: "{{ .Release.Name }}" diff --git a/charts/ipfs/1.0.0/test_values.yaml b/charts/ipfs/1.0.0/test_values.yaml new file mode 100644 index 0000000000..4239f4bdb1 --- /dev/null +++ b/charts/ipfs/1.0.0/test_values.yaml @@ -0,0 +1,18 @@ +## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the +## +image: + repository: ipfs/go-ipfs + tag: v0.8.0-rc1 + pullPolicy: IfNotPresent + +## Additional arguments to pass to minio binary +extraArgs: [] + +updateStrategy: RollingUpdate + +service: + nodePort: 9080 + +environment: + +emptyDirVolumes: true diff --git a/charts/ipfs/1.0.0/values.yaml b/charts/ipfs/1.0.0/values.yaml new file mode 100644 index 0000000000..e30aa32195 --- /dev/null +++ b/charts/ipfs/1.0.0/values.yaml @@ -0,0 +1,16 @@ +## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the +## +image: + repository: ipfs/go-ipfs + tag: v0.8.0-rc1 + pullPolicy: IfNotPresent + +## Additional arguments to pass to ipfs binary +extraArgs: [] + +updateStrategy: RollingUpdate + +service: + nodePort: 9080 + +environment: diff --git a/charts/ipfs/item.yaml b/charts/ipfs/item.yaml new file mode 100644 index 0000000000..725026bfb1 --- /dev/null +++ b/charts/ipfs/item.yaml @@ -0,0 +1,3 @@ +categories: + - storage +icon_url: https://ipfs.io/ipfs/QmVk7srrwahXLNmcDYvyUEJptyoxpndnRa57YJ11L4jV26/ipfs.go.png