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
e88f516f
Commit
e88f516f
authored
Jan 30, 2021
by
Waqar Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update nextcloud deployment to use library chart
parent
0651c9fc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
73 deletions
+26
-73
test/nextcloud/1.1.0/templates/deployment.yaml
test/nextcloud/1.1.0/templates/deployment.yaml
+24
-67
test/nextcloud/1.1.0/templates/secrets.yaml
test/nextcloud/1.1.0/templates/secrets.yaml
+2
-6
No files found.
test/nextcloud/1.1.0/templates/deployment.yaml
View file @
e88f516f
apiVersion
:
apps/v1
{{
$postgres_values
:
= .
}}
{{
$_
:
= set $postgres_values "nameSuffix" "postgres"
}}
apiVersion
:
{{
include "common.capabilities.deployment.apiVersion" .
}}
kind
:
Deployment
metadata
:
name
:
{{
template "nextcloud.fullname" .
}}
labels
:
app.kubernetes.io/name
:
{{
include "nextcloud.name" .
}}
helm.sh/chart
:
{{
include "nextcloud.chart" .
}}
app.kubernetes.io/instance
:
{{
.Release.Name
}}
app.kubernetes.io/managed-by
:
{{
.Release.Service
}}
app.kubernetes.io/component
:
app
{{
- if .Values.deploymentAnnotations
}}
annotations
:
{{
toYaml .Values.deploymentAnnotations | indent 4
}}
{{
- end
}}
name
:
{{
template "common.names.fullname" .
}}
labels
:
{{
include "common.labels" . | nindent 4
}}
annotations
:
{{
include "common.annotations" . | nindent 4
}}
spec
:
replicas
:
1
strategy
:
type
:
{{
.Values.nextcloud.strategy
}}
selector
:
matchLabels
:
app.kubernetes.io/name
:
{{
include "nextcloud.name" .
}}
app.kubernetes.io/instance
:
{{
.Release.Name
}}
app.kubernetes.io/component
:
app
matchLabels
:
{{
include "common.labels.selectorLabels" . | nindent 6
}}
template
:
metadata
:
labels
:
app.kubernetes.io/name
:
{{
include "nextcloud.name" .
}}
app.kubernetes.io/instance
:
{{
.Release.Name
}}
app.kubernetes.io/component
:
app
annotations
:
rollme
:
{{
randAlphaNum 5 | quote
}}
labels
:
{{
include "common.labels.selectorLabels" . | nindent 8
}}
annotations
:
{{
include "common.annotations" . | nindent 8
}}
spec
:
{{
- if .Values.image.pullSecrets
}}
imagePullSecrets
:
{{
- range .Values.image.pullSecrets
}}
-
name
:
{{
.
}}
{{
- end
}}
{{
- end
}}
initContainers
:
-
name
:
init-postgresdb
image
:
{{
template "postgres.imageName" .
}}
command
:
[
'
sh'
,
'
-c'
,
"
until
pg_isready
-h
{{
template
"
nextcloud.fullname" .
}}
-postgres
; do echo waiting for postgres; sleep 2; done"
]
command
:
[
'
sh'
,
'
-c'
,
"
until
pg_isready
-h
{{
template
"
common.names.fullname" $postgres_values
}}
; do echo waiting for postgres; sleep 2; done"
]
imagePullPolicy
:
{{
.Values.image.pullPolicy
}}
containers
:
-
name
:
{{
.Chart.Name
}}
image
:
"
{{
.Values.image.repository
}}:{{
.Values.image.tag
}}"
imagePullPolicy
:
{{
.Values.image.pullPolicy
}}
env
:
-
name
:
POSTGRES_HOST
value
:
{{
template "nextcloud.fullname" .
}}
-postgres:5432
-
name
:
POSTGRES_DB
value
:
{{
template "postgres.DatabaseName" .
}}
-
name
:
POSTGRES_USER
valueFrom
:
secretKeyRef
:
name
:
db-details
key
:
db-user
-
name
:
POSTGRES_PASSWORD
valueFrom
:
secretKeyRef
:
name
:
db-details
key
:
db-password
-
name
:
NEXTCLOUD_ADMIN_USER
valueFrom
:
secretKeyRef
:
name
:
{{
template "nextcloud.fullname" .
}}
key
:
nextcloud-username
-
name
:
NEXTCLOUD_ADMIN_PASSWORD
valueFrom
:
secretKeyRef
:
name
:
{{
template "nextcloud.fullname" .
}}
key
:
nextcloud-password
-
name
:
NEXTCLOUD_TRUSTED_DOMAINS
value
:
{{
.Values.nextcloud.host
}}
-
name
:
NEXTCLOUD_DATA_DIR
value
:
{{
.Values.nextcloud.datadir | quote
}}
{{
include "common.containers.imageConfig" .Values.image | nindent 8
}}
env
:
{{
include "postgres.envVariableConfiguration" $postgres_values | nindent 10
}}
{{
$envList
:
= list
}}
{{
$secretName
:
= (include "common.names.fullname" .)
}}
{{
$envList = mustAppend $envList (dict "name" "POSTGRES_HOST" "value" (printf "%s
:
5432" (include "common.names.fullname" $postgres_values)))
}}
{{
$envList = mustAppend $envList (dict "name" "POSTGRES_DB" "value" (include "postgres.DatabaseName" .))
}}
{{
$envList = mustAppend $envList (dict "name" "NEXTCLOUD_DATA_DIR" "value" .Values.nextcloud.datadir)
}}
{{
$envList = mustAppend $envList (dict "name" "NEXTCLOUD_TRUSTED_DOMAINS" "value" .Values.nextcloud.host)
}}
{{
$envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-username")
}}
{{
$envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-password")
}}
{{
include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 10
}}
ports
:
-
name
:
http
containerPort
:
80
...
...
@@ -101,13 +62,9 @@ spec:
mountPath
:
/var/www/html/themes
subPath
:
"
themes"
volumes
:
-
name
:
nextcloud-data
{{
- if ne (include "configuredHostPath" .) ""
}}
hostPath
:
path
:
{{
template "configuredHostPath" .
}}
{{
- else
}}
emptyDir
:
{}
{{
- end
}}
{{
$vols
:
= list
}}
{{
$vols = mustAppend $vols (dict "name" "nextcloud-data" "emptyDirVolumes" .Values.emptyDirVolumes "hostPathEnabled" .Values.nextcloudDataHostPathEnabled "pathField" .Values.nextcloudHostPath "datasetName" (.Values.nextcloudDataVolume | default dict).datasetName )
}}
{{
include "common.storage.volumesConfiguration" (dict "ixVolumes" .Values.ixVolumes "volumes" $vols) | nindent 8
}}
# Will mount configuration files as www-data (id: 33) for nextcloud
securityContext
:
fsGroup
:
33
test/nextcloud/1.1.0/templates/secrets.yaml
View file @
e88f516f
apiVersion
:
v1
kind
:
Secret
metadata
:
name
:
{{
template "nextcloud.fullname" .
}}
labels
:
app.kubernetes.io/name
:
{{
include "nextcloud.name" .
}}
helm.sh/chart
:
{{
include "nextcloud.chart" .
}}
app.kubernetes.io/instance
:
{{
.Release.Name
}}
app.kubernetes.io/managed-by
:
{{
.Release.Service
}}
name
:
{{
template "common.names.fullname" .
}}
labels
:
{{
include "common.labels" . | nindent 4
}}
type
:
Opaque
data
:
nextcloud-username
:
{{
.Values.nextcloud.username | b64enc | quote
}}
...
...
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