Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Charts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏国强
Charts
Commits
43ab3e05
Commit
43ab3e05
authored
Dec 05, 2020
by
Waqar Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add postgresql deployment
parent
eb3c7a6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
0 deletions
+79
-0
test/nextcloud/2.3.2/templates/_helpers.tpl
test/nextcloud/2.3.2/templates/_helpers.tpl
+16
-0
test/nextcloud/2.3.2/templates/postgres-deployment.yaml
test/nextcloud/2.3.2/templates/postgres-deployment.yaml
+51
-0
test/nextcloud/2.3.2/templates/postgres-secret.yaml
test/nextcloud/2.3.2/templates/postgres-secret.yaml
+12
-0
No files found.
test/nextcloud/2.3.2/templates/_helpers.tpl
View file @
43ab3e05
...
...
@@ -62,6 +62,22 @@ Retrieve host path defined in volume
{{- end -}}
{{- end -}}
{
{
/*
Retrieve
backup
postgresql
host
path
defined
in
volume
*/
}
}
{{- define "configuredBackupPostgresHostPath" -}}
{{- $backupVolDict := first .Values.postgresql.backupVolume -}}
{{- $backupVolDict.hostPath -}}
{{- end -}}
{
{
/*
Retrieve
postgresql
data
host
path
defined
in
volume
*/
}
}
{{- define "configuredPostgresHostPath" -}}
{{- $dataVolDict := first .Values.postgresql.dataVolume -}}
{{- $dataVolDict.hostPath -}}
{{- end -}}
{
{
/*
Selector
labels
*/
}
}
...
...
test/nextcloud/2.3.2/templates/postgres-deployment.yaml
0 → 100644
View file @
43ab3e05
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
{{
template "nextcloud.fullname" .
}}
-postgres
labels
:
helm.sh/chart
:
{{
include "nextcloud.chart" .
}}
{{
- include "nextcloud.postgres.selectorLabels" . | nindent 4
}}
app.kubernetes.io/managed-by
:
{{
.Release.Service
}}
app.kubernetes.io/component
:
database
spec
:
replicas
:
1
strategy
:
type
:
{{
.Values.nextcloud.strategy
}}
selector
:
matchLabels
:
{{
- include "nextcloud.postgres.selectorLabels" . | nindent 6
}}
app.kubernetes.io/component
:
database
template
:
metadata
:
labels
:
{{
- include "nextcloud.postgres.selectorLabels" . | nindent 8
}}
app.kubernetes.io/component
:
database
annotations
:
rollme
:
{{
randAlphaNum 5 | quote
}}
spec
:
containers
:
-
name
:
{{
.Chart.Name
}}
-postgres
image
:
"
postgres:13.1"
imagePullPolicy
:
{{
.Values.image.pullPolicy
}}
env
:
-
name
:
POSTGRES_PASSWORD
valueFrom
:
secretKeyRef
:
name
:
db-details
key
:
db-password
volumeMounts
:
-
name
:
postgres-data
mountPath
:
/var/lib/postgresql/data
-
name
:
postgres-backup
mountPath
:
/postgres_backups
ports
:
-
name
:
postgres-tcp
containerPort
:
5432
protocol
:
TCP
volumes
:
-
name
:
postgres-data
hostPath
:
path
:
{{
template "configuredPostgresHostPath" .
}}
-
name
:
postgres-backup
hostPath
:
path
:
{{
template "configuredBackupPostgresHostPath" .
}}
test/nextcloud/2.3.2/templates/postgres-secret.yaml
0 → 100644
View file @
43ab3e05
apiVersion
:
v1
kind
:
Secret
metadata
:
name
:
db-details
data
:
{{
- if .Release.IsInstall
}}
db-password
:
{{
randAlphaNum 15 | b64enc | quote
}}
{{
else
}}
# `index` function is necessary because the property name contains a dash.
# Otherwise (...).data.db_password would have worked too.
db-password
:
{{
index (lookup "v1" "Secret" .Release.Namespace "db-details").data "db-password"
}}
{{
end
}}
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