why _?111git statuskubectl apply -n kube-system -f descheduler-cronjob.yaml
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2024-09-13 20:09:41 +02:00
parent d1247a3b02
commit c6a8464bb2
65 changed files with 0 additions and 0 deletions

9
apps/piwigo/Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM cr.lan/debian-stable
#RUN echo 'Acquire::http::proxy "http://172.23.255.1:3142";' >/etc/apt/apt.conf.d/proxy
RUN apt-get update && apt-get install -y \
libwww-perl && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apt/* /tmp/* /var/tmp/*
COPY remote_sync.pl /

154
apps/piwigo/deployment.yaml Normal file
View File

@@ -0,0 +1,154 @@
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: piwigo
labels:
app: piwigo
spec:
selector:
matchLabels:
app: piwigo
strategy:
type: Recreate
template:
metadata:
labels:
app: piwigo
spec:
containers:
- image: linuxserver/piwigo:latest
name: piwigo
env:
# Use secret in real usage
- name: TZ
value: Europe/Berlin
livenessProbe:
failureThreshold: 10
httpGet:
path: /index.php
port: http
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
ports:
- containerPort: 80
name: http
- containerPort: 443
name: https
volumeMounts:
- name: piwigo-persistent-storage
mountPath: /config/www/gallery/galleries
- name: piwigo-config
mountPath: /config
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "1500Mi"
cpu: "2000m"
volumes:
- name: piwigo-persistent-storage
persistentVolumeClaim:
claimName: piwigo-pv-claim
- name: piwigo-config
persistentVolumeClaim:
claimName: piwigo-config
---
apiVersion: v1
kind: Service
metadata:
name: piwigo
labels:
app: piwigo
spec:
ports:
- name: http
port: 80
- name: https
port: 443
selector:
app: piwigo
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: piwigo
labels:
app: piwigo
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: foto.lan
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: piwigo
port:
name: http
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: piwigo-quicksync
labels:
app: piwigo
spec:
schedule: '23 */1 * * *'
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
containers:
- name: piwigo-quicksync
image: docker-registry.lan/piwigo-sync:arm64
imagePullPolicy: Always
args:
- /remote_sync.pl
- --base_url=http://piwigo.default.svc.cluster.local/
- --username=api
- --password=D8Gt4P36q3457Yt
resources:
requests:
memory: "24Mi"
cpu: "20m"
limits:
memory: "100Mi"
cpu: "500m"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: piwigo-pv-claim
labels:
app: piwigo
spec:
storageClassName: nfs-ssd
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 60Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: piwigo-config
labels:
app: piwigo
spec:
storageClassName: nfs-ssd
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi

59
apps/piwigo/remote_sync.pl Executable file
View File

@@ -0,0 +1,59 @@
#!/usr/bin/perl
# perl remote_sync.pl --base_url=http://localhost/piwigo/dev/branches/2.0 --username=plg --password=plg
use strict;
use warnings;
use LWP::UserAgent;
use Getopt::Long;
my %opt = ();
GetOptions(
\%opt,
qw/
base_url=s
username=s
password=s
/
);
our $ua = LWP::UserAgent->new;
$ua->agent('Mozilla/remote_sync.pl');
$ua->cookie_jar({});
$ua->default_headers->authorization_basic(
$opt{username},
$opt{password}
);
my $form = {
method => 'pwg.session.login',
username => $opt{username},
password => $opt{password},
};
my $result = $ua->post(
$opt{base_url}.'/ws.php?format=json',
$form
);
# perform the synchronization
$form = {
'sync' => 'files',
'display_info' => 1,
'add_to_caddie' => 1,
'privacy_level' => 0,
'sync_meta' => 1, # remove this parameter, turning to 0 is not enough
'simulate' => 0,
'subcats-included' => 1,
'submit' => 1,
};
$result = $ua->post(
$opt{base_url}.'/admin.php?page=site_update&site=1',
$form
);
use Data::Dumper;
print Dumper($result);