Publish portable nextcloud-notify-push chart
Validate, publish and promote nextcloud-notify-push chart / chart (push) Successful in 33s
Validate, publish and promote nextcloud-notify-push chart / chart (push) Successful in 33s
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: nextcloud-notify-push
|
||||
description: Service, Ingress, and monitoring for the Nextcloud notify-push sidecar
|
||||
type: application
|
||||
version: 0.0.0
|
||||
appVersion: "20260825_084538"
|
||||
@@ -0,0 +1,62 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
labels:
|
||||
app.kubernetes.io/name: nextcloud-notify-push
|
||||
app.kubernetes.io/instance: {{ .Values.nextcloudReleaseName }}
|
||||
spec:
|
||||
selector:
|
||||
app.kubernetes.io/name: nextcloud
|
||||
app.kubernetes.io/instance: {{ .Values.nextcloudReleaseName }}
|
||||
app.kubernetes.io/component: app
|
||||
ports:
|
||||
- name: http
|
||||
port: 7867
|
||||
targetPort: notify-push
|
||||
- name: metrics
|
||||
port: 7868
|
||||
targetPort: push-metrics
|
||||
---
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
annotations:
|
||||
{{- toYaml .Values.ingress.annotations | nindent 4 }}
|
||||
spec:
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
rules:
|
||||
- host: {{ .Values.ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
- path: /push
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ .Release.Name }}
|
||||
port:
|
||||
name: http
|
||||
{{- end }}
|
||||
---
|
||||
{{- if .Values.monitoring.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ .Release.Name }}
|
||||
labels:
|
||||
release: {{ .Values.monitoring.releaseLabel }}
|
||||
spec:
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: nextcloud-notify-push
|
||||
app.kubernetes.io/instance: {{ .Values.nextcloudReleaseName }}
|
||||
endpoints:
|
||||
- port: metrics
|
||||
interval: 60s
|
||||
scrapeTimeout: 15s
|
||||
{{- end }}
|
||||
@@ -0,0 +1,9 @@
|
||||
nextcloudReleaseName: nextcloud
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
host: nextcloud.example.org
|
||||
annotations: {}
|
||||
monitoring:
|
||||
enabled: false
|
||||
releaseLabel: prometheus
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
chart_name=$(basename "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/nextcloud-notify-push" && pwd)")
|
||||
chart_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/nextcloud-notify-push" && pwd)
|
||||
helm lint "$chart_dir" --strict
|
||||
python3 - "$chart_dir" "$chart_name" <<'PY'
|
||||
import subprocess,sys,yaml
|
||||
chart,name=sys.argv[1:]
|
||||
with open(chart+'/Chart.yaml') as f: metadata=yaml.safe_load(f)
|
||||
def render(*args):
|
||||
output=subprocess.check_output(['helm','template',name,chart,'--namespace','nextcloud',*args],text=True)
|
||||
return {(x['kind'],x['metadata']['name']):x for x in yaml.safe_load_all(output) if x}
|
||||
default=render()
|
||||
enabled=render('--set','ingress.enabled=true','--set','monitoring.enabled=true')
|
||||
assert ('Service',name) in default
|
||||
assert ('Ingress',name) not in default
|
||||
if name!='nextcloud-clamav':
|
||||
assert ('Ingress',name) in enabled
|
||||
if name=='nextcloud-notify-push':
|
||||
assert ('ServiceMonitor',name) in enabled
|
||||
else:
|
||||
assert ('Deployment',name) in default
|
||||
images=[c['image'] for c in default['Deployment',name]['spec']['template']['spec'].get('initContainers',[])+default['Deployment',name]['spec']['template']['spec']['containers']]
|
||||
assert all(image.endswith(':'+metadata['appVersion']) for image in images)
|
||||
if name=='nextcloud-clamav':
|
||||
assert ('PersistentVolumeClaim',name) in default
|
||||
assert not any(kind=='Secret' for kind,_ in enabled)
|
||||
PY
|
||||
Reference in New Issue
Block a user