-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add helm chart to deploy on Kubernetes clusters
- Loading branch information
Letsplaybar
committed
Dec 17, 2023
1 parent
da133ca
commit 386d017
Showing
7 changed files
with
131 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Helm | ||
This project has a helm chart, in order to use it, the Docker image must first be built and loaded into a repo. | ||
|
||
After this is done, copy the file from `helm/values.yml` and fill it in. Here you can see a small example with fields that have to be filled in: | ||
|
||
````yml | ||
deployment: | ||
image: <url to image> | ||
files: | ||
# Location of .env file | ||
env: <path to .env file> | ||
# Location of storage folder | ||
storage: <path to storage folder> | ||
|
||
ingress: | ||
url: <url to reach shaark instance> | ||
#optional | ||
annotations: | ||
cert-manager.io/issuer: "<issuer name when used cert-manager>" | ||
```` | ||
if no cert-manager is used, the appropriate certificate must be stored under <name>-secret-tls as secret | ||
|
||
Once this has been done, you can install the helm chart as follows: `helm install <name> ./helm --values <edit-values-file>` | ||
|
||
The installation comes without mysql and redis if this is required, this must be installed externally by existing charts from the intenet and then the corresponding kubernetes-url must be stored in the .env as host |
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,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 |
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,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 }} |
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,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 |
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,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 |
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,7 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
|
||
{{- define "Shaark.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- 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,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: |