Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
indiehost
tech
infrastructure
charts
Commits
a1ecf472
Verified
Commit
a1ecf472
authored
Sep 29, 2021
by
Hugo
Browse files
add autoMigrateDomain
parent
726854e5
Changes
4
Hide whitespace changes
Inline
Side-by-side
hedgedoc/templates/configfile.yaml
0 → 100644
View file @
a1ecf472
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
name
:
{{
tpl .Values.fqdn .
}}
-file
data
:
config.json
:
|-
{
"production": {
"use_env_variable": "CMD_DB_URL",
"dialect": "postgres",
"protocol": "postgres",
"dialectOptions": {
"ssl": {
"require": true,
"rejectUnauthorized": false
}
},
"db": {
"dialect": "postgres",
"protocol": "postgres",
"dialectOptions": {
"ssl": {
"require": true,
"rejectUnauthorized": false
}
}
}
}
}
.sequelizerc
:
|-
var path = require('path');
module.exports = {
'config': path.resolve('config.json'),
'migrations-path': path.resolve('lib', 'migrations'),
'models-path': path.resolve('lib', 'models')
}
hedgedoc/templates/deployment.yaml
View file @
a1ecf472
...
...
@@ -17,6 +17,10 @@ spec:
app.kubernetes.io/part-of
:
hedgedoc
template
:
metadata
:
annotations
:
checksum/config
:
{{
include (print $.Template.BasePath "/configmap.yaml") . | sha256sum
}}
checksum/configfile
:
{{
include (print $.Template.BasePath "/configfile.yaml") . | sha256sum
}}
checksum/secret
:
{{
include (print $.Template.BasePath "/secret.yaml") . | sha256sum
}}
labels
:
app.kubernetes.io/component
:
app
app.kubernetes.io/instance
:
{{
tpl .Values.fqdn .
}}
...
...
@@ -24,6 +28,9 @@ spec:
app.kubernetes.io/part-of
:
hedgedoc
spec
:
volumes
:
-
name
:
config
configMap
:
name
:
{{
tpl .Values.fqdn .
}}
-file
containers
:
-
env
:
-
name
:
CMD_MINIO_ACCESS_KEY
...
...
@@ -53,10 +60,17 @@ spec:
name
:
{{
template "configName" .
}}
-
secretRef
:
name
:
{{
template "secretName" .
}}
volumeMounts
:
-
mountPath
:
/files
name
:
config
-
mountPath
:
/hedgedoc/.sequelizerc
name
:
config
subPath
:
.sequelizerc
image
:
"
{{
.Values.image.repository
}}:{{
.Values.image.tag
|
default
.Chart.AppVersion
}}"
imagePullPolicy
:
IfNotPresent
name
:
hedgedoc
ports
:
-
containerPort
:
3000
name
:
http
protocol
:
TCP
\ No newline at end of file
protocol
:
TCP
\ No newline at end of file
hedgedoc/templates/migrate-domain-job.yaml
0 → 100644
View file @
a1ecf472
{{
$config
:
= lookup "v1" "ConfigMap" .Release.Namespace (include "configName" .)
}}
{{
- if and .Values.autoMigrateDomain $config.data
}}
{{
$oldDomain
:
= $config.data.CMD_DOMAIN
}}
{{
$newDomain
:
= (tpl .Values.domain .)
}}
{{
- if ne $oldDomain $newDomain
}}
apiVersion
:
batch/v1
kind
:
Job
metadata
:
name
:
{{
tpl .Values.fqdn .
}}
-migrate-domain
spec
:
template
:
spec
:
containers
:
-
name
:
postgres
image
:
postgres:12
command
:
-
psql
-
-c
-
UPDATE "Notes" SET content = replace(content, '{{ $oldDomain }}', '{{ $newDomain }}');
env
:
-
name
:
PGHOST
value
:
pg-{{ .Release.Namespace }}
-
name
:
PGDATABASE
value
:
hedgedoc
-
name
:
PGPORT
value
:
"
5432"
-
name
:
PGUSER
valueFrom
:
secretKeyRef
:
key
:
username
name
:
"
hedgedoc.pg-{{
.Release.Namespace
}}{{
.Values.pgCredentialsSuffix
}}"
-
name
:
PGPASSWORD
valueFrom
:
secretKeyRef
:
key
:
password
name
:
"
hedgedoc.pg-{{
.Release.Namespace
}}{{
.Values.pgCredentialsSuffix
}}"
restartPolicy
:
Never
backoffLimit
:
3
ttlSecondsAfterFinished
:
120
{{
- end
}}
{{
- end
}}
\ No newline at end of file
hedgedoc/values.yaml
View file @
a1ecf472
...
...
@@ -20,3 +20,4 @@ oauth:
email
:
email
pgCredentialsSuffix
:
"
.credentials"
autoMigrateDomain
:
true
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment