Skip to content

Commit

Permalink
add helm chart to deploy on Kubernetes clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
Letsplaybar committed Dec 17, 2023
1 parent da133ca commit cffe965
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2

name: Shaark
description: "Shaark is a self-hosted platform to keep and share your content: web links, posts, passwords and pictures."

type: application
version: 2.0.0-alpha

appVersion: 2.0.0-alpha
34 changes: 34 additions & 0 deletions helm/templates/Deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "Shaark.name" . }}-deployment
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ include "Shaark.name" . }}
template:
metadata:
labels:
app: {{ include "Shaark.name" . }}
spec:
containers:
- name: shaark
image: {{.Values.deployment.image}}
imagePullPolicy: Always
ports:
- containerPort: 80
volumeMounts:
- name: env
mountPath: /var/www/laravel/.env
subPath: .env
- name: storage
mountPath: /var/www/laravel/storage
volumes:
- name: env
hostPath:
path: {{ .Values.deployment.files.env }}
- name: storage
hostPath:
path: {{ .Values.deployment.files.storage }}
25 changes: 25 additions & 0 deletions helm/templates/Ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "Shaark.name" . }}-ingress
namespace: {{ .Release.Namespace }}
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 1G
nginx.org/client-max-body-size: 1G
{{- .Values.ingress.annotations | toYaml | indent 4}}
spec:
tls:
- hosts:
- {{ .Values.ingress.url }}
secretName: {{ include "Shaark.name" . }}-secret-tls
rules:
- host: {{ .Values.ingress.url }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "Shaark.name" . }}-service
port:
number: 80
14 changes: 14 additions & 0 deletions helm/templates/Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "Shaark.name" . }}-service
labels:
app: {{ include "Shaark.name" . }}
namespace: {{ .Release.Namespace }}
spec:
selector:
app: {{ include "Shaark.name" . }}
ports:
- protocol: TCP
port: 80
targetPort: 80
7 changes: 7 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{/*
Expand the name of the chart.
*/}}

{{- define "Shaark.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
17 changes: 17 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
nameOverride:

deployment:
image:
files:
# Location of .env file
env:
# Location of storage folder
storage:

ingress:
url:
#Example
# annotations:
# cert-manager.io/issuer: "letsencrypt-prod"
# nginx.ingress.kubernetes.io/ssl-redirect: true
annotations:

0 comments on commit cffe965

Please sign in to comment.