Skip to content

Commit

Permalink
helm chart for lakefs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyaug committed Aug 5, 2020
1 parent ef5e2f3 commit 12110b3
Show file tree
Hide file tree
Showing 11 changed files with 326 additions and 0 deletions.
14 changes: 14 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
entries:
lakefs:
- apiVersion: v2
appVersion: 0.8.1
created: "2020-08-03T15:01:27.62096147+03:00"
description: A Helm chart for Kubernetes
digest: a5ae050fa8e3a4aca8d577693519b4b7c7b3c1df91242e76c3f3739af08d3870
name: lakefs
type: application
urls:
- lakefs-0.1.0.tgz
version: 0.1.0
generated: "2020-08-03T15:01:27.620526915+03:00"
Binary file added lakefs-0.1.0.tgz
Binary file not shown.
23 changes: 23 additions & 0 deletions lakefs/.helmignore
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/
14 changes: 14 additions & 0 deletions lakefs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v2
name: lakefs
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: 0.8.1

home: https://lakefs.io
icon: https://lakefs.io/wp-content/uploads/2020/07/lake-fs-color-2.svg
sources:
- https://github.com/treeverse/lakefs
maintainers:
- name: Treeverse
email: [email protected]
31 changes: 31 additions & 0 deletions lakefs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# lakeFS Helm Chart

A Helm chart to deploy lakeFS on Kubernetes.

## Installing the Chart

To install the chart with Helm Release *my-release* run the following commands:

```bash
# Add the lakeFS repository
helm repo add lakefs https://chart.lakefes.io
# Deploy lakeFS
helm install lakefs/lakefs -f my-values.yaml --name my-release
```

You should give your Kubernetes nodes access to all S3 buckets you intend to use lakeFS with.
If you can't provide such access, you can use an AWS key-pair to authenticate (see configurations below).

## Configurations
| **Parameter** | **Description** | **Default** |
|---------------------------------------------|------------------------------------------------------------------------------------------------------------|-------------|
| `blockstore.type` | Type of storage to use: `s3`, `local`, `mem` | |
| `blockstore.s3.region` | AWS region where to use for storage | |
| `blockstore.s3.credentials.accessKeyId` | AWS Access Key to use when accessing S3. Leave empty if your Kuberenets nodes have access to your buckets. | |
| `blockstore.s3.credentials.secretAccessKey` | AWS Secret Key to use when accessing S3. Leave empty if your Kuberenets nodes have access to your buckets. | |
| `databaseConnectionString` | Connection string to your lakeFS database | |
| `authEncryptSecretKey` | A cryptographically secure random string | |
| `replicaCount` | Number of lakeFS pods | `1` |
| `resources` | Pod resource requests & limits | `{}` |
| `service.type` | Kuberenetes service type | ClusterIP |
| `service.port` | Kubernetes service external port | 80 |
4 changes: 4 additions & 0 deletions lakefs/ci/s3-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
blockstore:
type: s3
s3:
region: us-east-1
63 changes: 63 additions & 0 deletions lakefs/templates/_helpers.tpl
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 "lakefs.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 "lakefs.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 "lakefs.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "lakefs.labels" -}}
helm.sh/chart: {{ include "lakefs.chart" . }}
{{ include "lakefs.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "lakefs.selectorLabels" -}}
app.kubernetes.io/name: {{ include "lakefs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "lakefs.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "lakefs.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
81 changes: 81 additions & 0 deletions lakefs/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "lakefs.fullname" . }}
labels:
{{- include "lakefs.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "lakefs.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "lakefs.selectorLabels" . | nindent 8 }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: LAKEFS_AUTH_ENCRYPT_SECRET_KEY
value: {{ .Values.authEncryptSecretKey}}
- name: LAKEFS_DATABASE_CONNECTION_STRING
value: {{ .Values.databaseConnectionString }}
- name: LAKEFS_BLOCKSTORE_TYPE
value: {{ .Values.blockstore.type | default "local" }}
{{- if eq .Values.blockstore.type "local" }}
- name: LAKEFS_BLOCKSTORE_LOCAL_PATH
value: {{ .Values.blockstore.local.path | default "/home/lakefs" }}
{{- end }}
{{- if eq .Values.blockstore.type "s3" }}
- name: LAKEFS_BLOCKSTORE_S3_REGION
value: {{ .Values.blockstore.s3.region }}
{{- if .Values.blockstore.s3.credentials }}
- name: LAKEFS_BLOCKSTORE_S3_CREDENTIALS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .Values.blockstore.s3.credentials.secret }}
key: accessKeyId
- name: LAKEFS_BLOCKSTORE_S3_CREDENTIALS_ACCESS_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.blockstore.s3.credentials.secret }}
key: secretAccessKey
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
41 changes: 41 additions & 0 deletions lakefs/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "lakefs.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "lakefs.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions lakefs/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "lakefs.fullname" . }}
labels:
{{- include "lakefs.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "lakefs.selectorLabels" . | nindent 4 }}
40 changes: 40 additions & 0 deletions lakefs/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Default values for lakefs.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: treeverse/lakefs
pullPolicy: IfNotPresent

nameOverride: ""
fullnameOverride: ""

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local


podAnnotations: {}

service:
type: ClusterIP
port: 80

resources: {}

nodeSelector: {}

tolerations: []

affinity: {}

0 comments on commit 12110b3

Please sign in to comment.