Added Helm Chart

This commit is contained in:
Kirill Demchenko 2023-05-12 20:36:45 +04:00
parent 31e466eff5
commit 57c2264c59
8 changed files with 155 additions and 0 deletions

View File

@ -65,6 +65,10 @@ docker run -d \
If you are looking for MinIO + Notea docker
configuration [check this](https://www.reddit.com/r/selfhosted/comments/n0jacf/notea_selfhosted_notetaking_app_stored_on_s3_aka/gw89iyo?utm_source=share&utm_medium=web2x&context=3)
### Kubernetes Helm Chart
Use [helm chart](/helm) to deploy to Kubernetes via Helm.
## Storage
Configure environment variables according to storage service.

4
helm/Chart.yaml Normal file
View File

@ -0,0 +1,4 @@
apiVersion: v1
appVersion: 0.0.1
version: 0.0.1
name: notea

5
helm/README.md Normal file
View File

@ -0,0 +1,5 @@
### Just simple Helm Chart
Use this command to insall notea to kubernetes:
`helm upgrade --install notea -n notea -f values.yaml .`

3
helm/templates/NOTES.txt Normal file
View File

@ -0,0 +1,3 @@
🎉 Notea has been installed!
📎 Please check the service at https://{{ .Values.host }}

View File

@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-deployment
labels:
app: {{ .Release.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: {{ .Release.Name }}
image: "{{ .Values.image }}"
env:
- name: PASSWORD
value: "{{ .Values.application.password }}"
- name: STORE_ACCESS_KEY
value: "{{ .Values.application.store_access_key }}"
- name: STORE_SECRET_KEY
value: "{{ .Values.application.store_secret_key }}"
- name: STORE_BUCKET
value: "{{ .Values.application.store_bucket }}"
{{- if .Values.application.store_end_point }}
- name: STORE_END_POINT
value: "{{ .Values.application.store_end_point }}"
{{- end}}
{{- if .Values.application.store_force_path_style }}
- name: STORE_FORCE_PATH_STYLE
value: "{{ .Values.application.store_force_path_style }}"
{{- end}}
{{- if .Values.application.store_prefix }}
- name: STORE_PREFIX
value: "{{ .Values.application.store_prefix }}"
{{- end}}
{{- if .Values.application.cookie_secure }}
- name: COOKIE_SECURE
value: "{{ .Values.application.cookie_secure }}"
{{- end}}
{{- if .Values.application.base_url }}
- name: BASE_URL
value: "{{ .Values.application.base_url }}"
{{- end}}
{{- if .Values.application.disable_password }}
- name: DISABLE_PASSWORD
value: "{{ .Values.application.disable_password }}"
{{- end}}
{{- if .Values.application.direct_response_attachment }}
- name: DIRECT_RESPONSE_ATTACHMENT
value: "{{ .Values.application.direct_response_attachment }}"
{{- end}}
ports:
- containerPort: {{ .Values.service.port }}

View File

@ -0,0 +1,24 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
name: {{ .Release.Name }}-ingress
spec:
rules:
- host: "{{ .Values.ingress.host }}"
http:
paths:
- backend:
service:
name: {{ .Release.Name }}-service
port:
number: {{ .Values.service.port }}
path: /
pathType: Prefix
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end }}

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-service
spec:
type: {{ .Values.service.type }}
selector:
app: {{ .Release.Name }}
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}

45
helm/values.yaml Normal file
View File

@ -0,0 +1,45 @@
# docker image
image: cinwell/notea
service:
# service port
port: 3000
# service type
type: NodePort
application:
# Required parameters:
# Password to login to the app
password: "<your-password>"
# AccessKey
store_access_key: "<your-s3-access-key>"
# SecretKey
store_secret_key: "<your-s3-secret-key>"
# Bucket
store_bucket: "<your-s3-bucket>"
# Optional parameters:
# Host name or an IP address.
store_end_point: "<your-s3-end-point>"
# region
store_region: ""
# Whether to force path style URLs for S3 objects
store_force_path_style: ""
# Storage path prefix
store_prefix: ""
# Only works under https: scheme If the website is not https, you may not be able to log in, and you need to set it to false
cookie_secure: ""
# The domain of the website, used for SEO
base_url: ""
# Disable password protection. This means that you need to implement authentication on the server yourself,
# but the route /share/:id needs to be accessible anonymously, if you need share page. #31
disable_password: ""
# By default, requesting attachment links will redirect to S3 URL, Set to true to directly output attachments from the notea services. #28
direct_response_attachment: ""
ingress:
enabled: false
host: hotea.example.com
tls:
- hosts:
- hotea.example.com
secretName: example-ca