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

ability to setup host using own postgress and ability to set custom storageclass and size #24

Merged
merged 10 commits into from
Jul 18, 2024
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
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:
securityContext:
fsGroup: 1001
runAsUser: 1001
runAsGroup: 1001
Comment on lines +20 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the deployment face any issues without these permissions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes no permissions to write to local storage

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this optional? Only when it's local storage. The other stuff looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nushkovg done

{{- if eq .Values.outline.fileStorage.type "local" }}
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.
Comment on lines +42 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you use the bitnami-helm-readme-generator for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no with hands its 2 rows

## @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
Loading