-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stephan Feurer
committed
Aug 26, 2023
1 parent
400ecdd
commit 4b432c2
Showing
11 changed files
with
367 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,61 @@ | ||
parameters: | ||
nextcloud: | ||
=_metadata: {} | ||
|
||
namespace: syn-nextcloud | ||
|
||
charts: | ||
nextcloud: | ||
source: https://nextcloud.github.io/helm | ||
version: v4.1.0 | ||
|
||
admin: | ||
user: admin | ||
password: changeme | ||
|
||
ingress: | ||
host: nextcloud.kube.home | ||
|
||
mail: | ||
enabled: false | ||
fromAddress: user | ||
domain: domain.com | ||
smtp: | ||
host: domain.com | ||
secure: ssl | ||
port: 465 | ||
authtype: LOGIN | ||
name: user | ||
password: pass | ||
|
||
storage: | ||
enabled: true | ||
storageClass: null | ||
accessMode: ReadWriteOnce | ||
size: 10Gi | ||
nextcloudData: | ||
enabled: true | ||
size: 50Gi | ||
|
||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi | ||
|
||
helmValues: | ||
nextcloud: | ||
host: ${nextcloud:ingress:host} | ||
username: ${nextcloud:admin:user} | ||
passowrd: ${nextcloud:admin:password} | ||
mail: ${nextcloud:mail} | ||
cronjob: | ||
enabled: true | ||
persistence: ${nextcloud:storage} | ||
resources: ${nextcloud:resources} | ||
metrics: | ||
enabled: false | ||
serviceMonitor: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
// main template for nextcloud | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local prom = import 'lib/prometheus.libsonnet'; | ||
local inv = kap.inventory(); | ||
// The hiera parameters for the component | ||
local params = inv.parameters.nextcloud; | ||
local hasPrometheus = std.member(inv.applications, 'prometheus'); | ||
|
||
local namespace = kube.Namespace(params.namespace) { | ||
// metadata+: { | ||
// labels+: { | ||
// 'pod-security.kubernetes.io/enforce': 'restricted', | ||
// }, | ||
// }, | ||
}; | ||
|
||
// Define outputs below | ||
{ | ||
'00_namespace': if hasPrometheus then prom.RegisterNamespace(namespace) else namespace, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
local com = import 'lib/commodore.libjsonnet'; | ||
local inv = com.inventory(); | ||
// The hiera parameters for the component | ||
local params = inv.parameters.nextcloud; | ||
|
||
local metadataPatch = { | ||
metadata+: { | ||
labels+: { | ||
'app.kubernetes.io/managed-by': 'commodore', | ||
}, | ||
}, | ||
}; | ||
|
||
local listTemplates = [ | ||
{ | ||
name: std.strReplace(name, '.yaml', ''), | ||
manifest: com.yaml_load_all(std.extVar('output_path') + '/' + name), | ||
} | ||
for name in com.list_dir(std.extVar('output_path'), basename=true) | ||
]; | ||
|
||
local patchTemplate(manifest) = [ | ||
content + metadataPatch | ||
for content in manifest | ||
]; | ||
|
||
{ | ||
[template.name]: patchTemplate(template.manifest) | ||
for template in listTemplates | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
# Overwrite parameters here | ||
applications: | ||
- prometheus | ||
|
||
# parameters: {...} | ||
parameters: | ||
kapitan: | ||
dependencies: | ||
- type: https | ||
source: https://raw.githubusercontent.com/projectsyn/component-prometheus/master/lib/prometheus.libsonnet | ||
output_path: vendor/lib/prometheus.libsonnet | ||
|
||
prometheus: | ||
defaultInstance: system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
annotations: {} | ||
labels: | ||
monitoring.syn.tools/system: 'true' | ||
name: syn-nextcloud | ||
name: syn-nextcloud |
161 changes: 161 additions & 0 deletions
161
tests/golden/defaults/nextcloud/nextcloud/10_helmchart/nextcloud/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: app | ||
app.kubernetes.io/instance: nextcloud | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: nextcloud | ||
helm.sh/chart: nextcloud-4.1.0 | ||
name: nextcloud | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/component: app | ||
app.kubernetes.io/instance: nextcloud | ||
app.kubernetes.io/name: nextcloud | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
annotations: | ||
nextcloud-config-hash: a5aae02b1b8278a9c8a2dc143e82d3737fc295f62c34afd617207f37d1b2b438 | ||
php-config-hash: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a | ||
labels: | ||
app.kubernetes.io/component: app | ||
app.kubernetes.io/instance: nextcloud | ||
app.kubernetes.io/name: nextcloud | ||
spec: | ||
containers: | ||
- env: | ||
- name: SQLITE_DATABASE | ||
value: nextcloud | ||
- name: NEXTCLOUD_ADMIN_USER | ||
valueFrom: | ||
secretKeyRef: | ||
key: nextcloud-username | ||
name: nextcloud | ||
- name: NEXTCLOUD_ADMIN_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
key: nextcloud-password | ||
name: nextcloud | ||
- name: NEXTCLOUD_TRUSTED_DOMAINS | ||
value: nextcloud.kube.home | ||
- name: NEXTCLOUD_DATA_DIR | ||
value: /var/www/html/data | ||
image: nextcloud:27.0.2-apache | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
httpHeaders: | ||
- name: Host | ||
value: nextcloud.kube.home | ||
path: /status.php | ||
port: 80 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 5 | ||
name: nextcloud | ||
ports: | ||
- containerPort: 80 | ||
name: http | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
httpHeaders: | ||
- name: Host | ||
value: nextcloud.kube.home | ||
path: /status.php | ||
port: 80 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 5 | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
volumeMounts: | ||
- mountPath: /var/www/ | ||
name: nextcloud-main | ||
subPath: root | ||
- mountPath: /var/www/html | ||
name: nextcloud-main | ||
subPath: html | ||
- mountPath: /var/www/html/data | ||
name: nextcloud-data | ||
subPath: data | ||
- mountPath: /var/www/html/config | ||
name: nextcloud-main | ||
subPath: config | ||
- mountPath: /var/www/html/custom_apps | ||
name: nextcloud-main | ||
subPath: custom_apps | ||
- mountPath: /var/www/tmp | ||
name: nextcloud-main | ||
subPath: tmp | ||
- mountPath: /var/www/html/themes | ||
name: nextcloud-main | ||
subPath: themes | ||
- command: | ||
- /cron.sh | ||
env: | ||
- name: SQLITE_DATABASE | ||
value: nextcloud | ||
- name: NEXTCLOUD_ADMIN_USER | ||
valueFrom: | ||
secretKeyRef: | ||
key: nextcloud-username | ||
name: nextcloud | ||
- name: NEXTCLOUD_ADMIN_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
key: nextcloud-password | ||
name: nextcloud | ||
- name: NEXTCLOUD_TRUSTED_DOMAINS | ||
value: nextcloud.kube.home | ||
- name: NEXTCLOUD_DATA_DIR | ||
value: /var/www/html/data | ||
image: nextcloud:27.0.2-apache | ||
imagePullPolicy: IfNotPresent | ||
name: nextcloud-cron | ||
resources: {} | ||
volumeMounts: | ||
- mountPath: /var/www/ | ||
name: nextcloud-main | ||
subPath: root | ||
- mountPath: /var/www/html | ||
name: nextcloud-main | ||
subPath: html | ||
- mountPath: /var/www/html/data | ||
name: nextcloud-data | ||
subPath: data | ||
- mountPath: /var/www/html/config | ||
name: nextcloud-main | ||
subPath: config | ||
- mountPath: /var/www/html/custom_apps | ||
name: nextcloud-main | ||
subPath: custom_apps | ||
- mountPath: /var/www/tmp | ||
name: nextcloud-main | ||
subPath: tmp | ||
- mountPath: /var/www/html/themes | ||
name: nextcloud-main | ||
subPath: themes | ||
securityContext: | ||
fsGroup: 33 | ||
volumes: | ||
- name: nextcloud-main | ||
persistentVolumeClaim: | ||
claimName: nextcloud-nextcloud | ||
- name: nextcloud-data | ||
persistentVolumeClaim: | ||
claimName: nextcloud-nextcloud-data |
16 changes: 16 additions & 0 deletions
16
...den/defaults/nextcloud/nextcloud/10_helmchart/nextcloud/templates/nextcloud-data-pvc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: app | ||
app.kubernetes.io/instance: nextcloud | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: nextcloud | ||
helm.sh/chart: nextcloud-4.1.0 | ||
name: nextcloud-nextcloud-data | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 50Gi |
16 changes: 16 additions & 0 deletions
16
...s/golden/defaults/nextcloud/nextcloud/10_helmchart/nextcloud/templates/nextcloud-pvc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: app | ||
app.kubernetes.io/instance: nextcloud | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: nextcloud | ||
helm.sh/chart: nextcloud-4.1.0 | ||
name: nextcloud-nextcloud | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi |
14 changes: 14 additions & 0 deletions
14
tests/golden/defaults/nextcloud/nextcloud/10_helmchart/nextcloud/templates/secrets.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
data: | ||
nextcloud-password: Y2hhbmdlbWU= | ||
nextcloud-token: aVFOQnhpVFQzdg== | ||
nextcloud-username: YWRtaW4= | ||
kind: Secret | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: nextcloud | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: nextcloud | ||
helm.sh/chart: nextcloud-4.1.0 | ||
name: nextcloud | ||
type: Opaque |
Oops, something went wrong.