Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add minio. #90

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions charts/neon-minio/.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/
10 changes: 10 additions & 0 deletions charts/neon-minio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: neon-minio
description: Neon MinIO
type: application
version: 1.0.0
appVersion: "0.1.0"
kubeVersion: "^1.18.x-x"
home: https://neon.tech
sources:
- https://github.com/neondatabase/neon
62 changes: 62 additions & 0 deletions charts/neon-minio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "neon-minio.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 "neon-minio.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 "neon-minio.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "neon-minio.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "neon-minio.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
94 changes: 94 additions & 0 deletions charts/neon-minio/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "neon-minio.fullname" . }}
labels:
{{- include "neon-minio.labels" . | nindent 4 }}
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
replicas: 1
# Which pods the Deployment is managing (duplicates template.metadata.labels).
selector:
matchLabels:
{{- include "neon-minio.selectorLabels" . | nindent 6 }}
# Pod template.
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
# Labels set on created pods.
labels:
{{- include "neon-minio.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "neon-minio.serviceAccountName" . }}
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 }}
command: ["minio"]
args: ["server", "/data", "--address", ":{{ .Values.service.port }}", "--console-address", ":{{ .Values.service.httpPort }}"]
{{- if .Values.settings }}
env:
- name: MINIO_ROOT_PASSWORD
value: {{ .Values.settings.accessKey.rootPassword }}
- name: MINIO_ROOT_USER
value: {{ .Values.settings.accessKey.rootUser }}
{{- end }}
ports:
- name: minio
containerPort: {{ .Values.service.port }}
protocol: TCP
- name: console
containerPort: {{ .Values.service.httpPort }}
protocol: TCP
startupProbe:
httpGet:
path: /minio/health/live
port: minio
initialDelaySeconds: 10
timeoutSeconds: 5
periodSeconds: 10
failureThreshold: 30
livenessProbe:
httpGet:
path: /minio/health/live
port: minio
periodSeconds: 15
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /minio/health/ready
port: minio
periodSeconds: 15
timeoutSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/neon-minio/templates/extra-manifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraManifests }}
---
{{ tpl (toYaml .) $ }}
{{- end }}
26 changes: 26 additions & 0 deletions charts/neon-minio/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ printf "%s-%s" (include "neon-minio.fullname" .) "create-buckets" | trunc 63 | trimSuffix "-" }}
spec:
template:
spec:
containers:
- name: minio-mc
image: minio/mc
env:
- name: MINIO_ROOT_USER
value: {{ .Values.settings.accessKey.rootUser }}
- name: MINIO_ROOT_PASSWORD
value: {{ .Values.settings.accessKey.rootPassword }}
- name: MINIO_URL
value: {{ printf "http://%s:%d" ( include "neon-minio.fullname" .) (int .Values.service.port) }}
command:
- "/bin/sh"
- "-c"
- |
until (/usr/bin/mc alias set minio ${MINIO_URL} ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD}) do
echo 'Waiting to start minio...' && sleep 1;
done;
/usr/bin/mc mb minio/neon --region=eu-north-1;
restartPolicy: OnFailure
24 changes: 24 additions & 0 deletions charts/neon-minio/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "neon-minio.fullname" . }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "neon-minio.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
ports:
- port: {{ .Values.service.port }}
targetPort: minio
protocol: TCP
name: minio
- port: {{ .Values.service.httpPort }}
targetPort: console
protocol: TCP
name: console
selector:
{{- include "neon-minio.selectorLabels" . | nindent 4 }}
12 changes: 12 additions & 0 deletions charts/neon-minio/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "neon-minio.serviceAccountName" . }}
labels:
{{- include "neon-minio.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
95 changes: 95 additions & 0 deletions charts/neon-minio/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Default values for neon-minio.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

image:
# -- minio image repository
repository: quay.io/minio/minio
# -- image pull policy
pullPolicy: Always
# -- Overrides the image tag whose default is the chart appVersion.
tag: "RELEASE.2022-10-20T00-55-09Z"

# -- Specify docker-registry secret names as an array
imagePullSecrets: []

# -- String to partially override neon-minio.fullname template (will maintain the release name)
nameOverride: ""
# -- String to fully override neon-minio.fullname template
fullnameOverride: ""

# Neon broker settings
settings:
# -- Minio access key
accessKey:
rootUser: "minio"
rootPassword: "password"


serviceAccount:
# serviceAccount.create - Specifies whether a service account should be created
create: true
# serviceAccount.annotations -- Annotations to add to the service account
annotations: {}
# serviceAccount.name - The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

# -- Annotations for neon-storage-broker pods
podAnnotations: {}

# -- Additional labels for neon-storage-broker pods
podLabels: {}
# neon_service: minio
# neon_env: staging
# neon_region: us-west-1
# neon_region_slug: virginia

# -- neon-storage-broker's pods Security Context
podSecurityContext: {}
# fsGroup: 2000

# -- neon-storage-broker's containers Security Context
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
# service.annotations -- Annotations to add to the service
annotations: {}
type: ClusterIP
# service.port -- minio listen port
port: 9000
httpPort: 9001

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
#
# resources.limits -- The resources limits for the container
# resources.requests The requested resources for the container
#
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# -- Node labels for pod assignment.
nodeSelector: {}

# -- Tolerations for pod assignment.
tolerations: []

# -- Affinity for pod assignment
affinity: {}

# -- Additional manifests that are created with the chart
extraManifests: []