Skip to content

Commit

Permalink
Merge pull request #24 from strelok899/main
Browse files Browse the repository at this point in the history
ability to setup host using own postgress and ability to set custom storageclass and size
  • Loading branch information
nushkovg authored Jul 18, 2024
2 parents 991bb1a + f2d5f27 commit a963814
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/outline/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ maintainers:
url: https://kubito.dev
apiVersion: v2
appVersion: 0.78.0-0
version: 1.0.4
version: 1.0.5
description: Kubito Outline Wiki Helm Chart
home: https://github.com/kubitodev/helm/tree/main/charts/outline
icon: https://kubito.dev/images/kubito.svg
Expand Down
2 changes: 2 additions & 0 deletions charts/outline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ The command removes all the Kubernetes components associated with the chart and
| `outline.service.url` | The URL where the application will be accessible. | `https://app.outline.dev` |
| `outline.service.port` | The port on which the application will run. | `3000` |
| `outline.fileStorage.type` | Type of file storage to be used (e.g., local, s3). | `s3` |
| `outline.fileStorage.storageClassName` | The storageclass name to use | `""` |
| `outline.fileStorage.storageSize` | The storageclass size to use | `250Gi` |
| `outline.fileStorage.localRootDir` | Local directory path for storing files, if using local storage. | `/var/lib/outline/data` |
| `outline.fileStorage.uploadMaxSize` | Maximum file upload size limit. | `26214400` |
| `outline.optional.collaborationUrl` | URL for collaboration features, if any. | `""` |
Expand Down
45 changes: 38 additions & 7 deletions charts/outline/templates/001-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ spec:
app: {{ .Release.Name }}
release: {{ .Release.Name }}
spec:
{{- if eq .Values.outline.fileStorage.type "local" }}
securityContext:
fsGroup: 1001
runAsUser: 1001
runAsGroup: 1001
initContainers:
- name: storage-prepare
image: busybox
command:
- chown
- -R
- 1001:1001
- {{ .Values.outline.fileStorage.localRootDir }}
volumeMounts:
- name: {{ .Release.Name }}-data
mountPath: {{ .Values.outline.fileStorage.localRootDir }}
{{- end }}
containers:
- name: {{ .Release.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down Expand Up @@ -90,15 +107,29 @@ spec:
secretKeyRef:
name: "{{ .Values.postgresql.auth.existingSecret }}"
key: password
{{- if .Values.postgresql.auth.host }}
- name: DATABASE_URL
value: "postgres://{{ .Values.postgresql.auth.username }}:$(POSTGRES_PASSWORD)@{{ .Values.postgresql.auth.host }}:5432/{{ .Values.postgresql.auth.database }}"
- name: DATABASE_URL_TEST
value: "postgres://{{ .Values.postgresql.auth.username }}:$(POSTGRES_PASSWORD)@{{ .Values.postgresql.auth.host }}:5432/{{ .Values.postgresql.auth.database }}_test"
{{- else }}
- name: DATABASE_URL
value: "postgres://{{ .Values.postgresql.auth.username }}:$(POSTGRES_PASSWORD)@{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.auth.database }}"
- name: DATABASE_URL_TEST
value: "postgres://{{ .Values.postgresql.auth.username }}:$(POSTGRES_PASSWORD)@{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.auth.database }}_test"
{{- end }}
{{- else }}
{{- if .Values.postgresql.auth.host }}
- name: DATABASE_URL
value: "postgres://{{ .Values.postgresql.auth.username }}:$(POSTGRES_PASSWORD)@postgresql.postgresql.svc.cluster.local:5432/{{ .Values.postgresql.auth.database }}"
value: "postgres://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Values.postgresql.auth.host }}:5432/{{ .Values.postgresql.auth.database }}"
- name: DATABASE_URL_TEST
value: "postgres://{{ .Values.postgresql.auth.username }}:$(POSTGRES_PASSWORD)@postgresql.postgresql.svc.cluster.local:5432/{{ .Values.postgresql.auth.database }}_test"
value: "postgres://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Values.postgresql.auth.host }}:5432/{{ .Values.postgresql.auth.database }}_test"
{{- else }}
- name: DATABASE_URL
value: "postgres://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@postgresql.postgresql.svc.cluster.local:5432/{{ .Values.postgresql.auth.database }}"
value: "postgres://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.auth.database }}"
- name: DATABASE_URL_TEST
value: "postgres://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@postgresql.postgresql.svc.cluster.local:5432/{{ .Values.postgresql.auth.database }}_test"
value: "postgres://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.auth.database }}_test"
{{- end }}
{{- end }}
{{- end }}

Expand Down Expand Up @@ -143,14 +174,14 @@ spec:
- name: AWS_S3_ACL
value: "{{ .Values.minio.s3Config.acl }}"
- name: FILE_STORAGE_UPLOAD_MAX_SIZE
value: "{{ .Values.minio.s3Config.uploadMaxSize }}"
value: "{{ .Values.minio.s3Config.uploadMaxSize | quote }}"
{{- else if eq .Values.outline.fileStorage.type "local" }}
- name: FILE_STORAGE
value: "{{ .Values.outline.fileStorage.type }}"
- name: FILE_STORAGE_LOCAL_ROOT_DIR
value: "{{ .Values.outline.fileStorage.localRootDir }}"
- name: FILE_STORAGE_UPLOAD_MAX_SIZE
value: "{{ .Values.outline.fileStorage.uploadMaxSize }}"
value: "{{ .Values.outline.fileStorage.uploadMaxSize | quote }}"
{{- end }}

- name: COLLABORATION_URL
Expand All @@ -162,7 +193,7 @@ spec:
- name: WEB_CONCURRENCY
value: "{{ .Values.outline.optional.webConcurrency }}"
- name: FILE_STORAGE_IMPORT_MAX_SIZE
value: "{{ .Values.outline.optional.fileStorageImportMaxSize }}"
value: "{{ .Values.outline.optional.fileStorageImportMaxSize | quote }}"
- name: LOG_LEVEL
value: "{{ .Values.outline.optional.logLevel }}"
- name: GOOGLE_ANALYTICS_ID
Expand Down
3 changes: 2 additions & 1 deletion charts/outline/templates/004-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ metadata:
labels:
app: {{ .Release.Name }}
spec:
storageClassName: {{ .Values.outline.fileStorage.storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 250Gi
storage: {{ .Values.outline.fileStorage.storageSize }}
{{- end }}
9 changes: 7 additions & 2 deletions charts/outline/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ replicaCount: 1
## @param outline.service.url The URL where the application will be accessible.
## @param outline.service.port The port on which the application will run.
## @param outline.fileStorage.type Type of file storage to be used (e.g., local, s3).
## @param outline.fileStorage.storageClassName The storageclass name to use default "".
## @param outline.fileStorage.storageSize The storageclass size to use default 250Gi.
## @param outline.fileStorage.localRootDir Local directory path for storing files, if using local storage.
## @param outline.fileStorage.uploadMaxSize Maximum file upload size limit.
## @param outline.optional.collaborationUrl URL for collaboration features, if any.
Expand Down Expand Up @@ -86,14 +88,17 @@ outline:
port: 3000
fileStorage:
type: s3 # set to local|s3
storageClassName: ""
storageSize: 250Gi
localRootDir: /var/lib/outline/data
uploadMaxSize: 26214400
uploadMaxSize: "26214400"

optional:
collaborationUrl: ""
forceHttps: false
enableUpdates: false
webConcurrency: 1
fileStorageImportMaxSize: 5120000
fileStorageImportMaxSize: "5120000"
logLevel: info
googleAnalyticsId: ""
sentry:
Expand Down

0 comments on commit a963814

Please sign in to comment.