add imaginary service
This commit is contained in:
parent
abebc8a94e
commit
0c0cd2b291
|
@ -0,0 +1,29 @@
|
|||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: server-autoscaler
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: server
|
||||
minReplicas: 2
|
||||
maxReplicas: 4
|
||||
metrics:
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: 60
|
||||
behavior:
|
||||
scaleUp:
|
||||
policies:
|
||||
- type: Pods
|
||||
value: 100
|
||||
periodSeconds: 10
|
||||
scaleDown:
|
||||
policies:
|
||||
- type: Pods
|
||||
value: 1
|
||||
periodSeconds: 300
|
|
@ -0,0 +1,43 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: server
|
||||
labels:
|
||||
app.kubernetes.io/name: imaginary
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: imaginary
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: imaginary
|
||||
spec:
|
||||
containers:
|
||||
- image: nextcloud/aio-imaginary
|
||||
name: imaginary
|
||||
args: ["-enable-url-source", "-cpus", "1"]
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 9000
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1000m
|
||||
memory: 1Gi
|
||||
limits:
|
||||
cpu: 1500m
|
||||
memory: 1Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: server
|
||||
labels:
|
||||
app.kubernetes.io/name: imaginary
|
||||
spec:
|
||||
selector:
|
||||
app.kubernetes.io/name: imaginary
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: http
|
|
@ -0,0 +1,8 @@
|
|||
resources:
|
||||
- imaginary-deployment.yaml
|
||||
- imaginary-autoscaler.yaml
|
||||
|
||||
namePrefix: imaginary-
|
||||
|
||||
commonLabels:
|
||||
app.kubernetes.io/name: imaginary
|
|
@ -16,9 +16,6 @@ configMapGenerator:
|
|||
files:
|
||||
- php-user.ini=configurations/php-user.ini
|
||||
- apache-user.cfg=configurations/apache-user.conf
|
||||
- name: cron-scripts
|
||||
files:
|
||||
- cron-previewgenerator.sh=scripts/cron-previewgenerator.sh
|
||||
- name: kustomize-generated-config
|
||||
literals:
|
||||
- NEXTCLOUD_EXTERNAL_HOST=cloud.badjware.dev
|
||||
|
|
|
@ -98,9 +98,6 @@ spec:
|
|||
mountPath: /etc/apache2/conf-enabled/apache-user.conf
|
||||
subPath: apache-user.conf
|
||||
readOnly: true
|
||||
- name: cron-scripts
|
||||
mountPath: /scripts
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: nextcloud-pv
|
||||
persistentVolumeClaim:
|
||||
|
@ -108,9 +105,6 @@ spec:
|
|||
- name: server-config
|
||||
configMap:
|
||||
name: server-config
|
||||
- name: cron-scripts
|
||||
configMap:
|
||||
name: cron-scripts
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
|
|
|
@ -32,4 +32,4 @@ spec:
|
|||
command: ["/bin/bash"]
|
||||
args:
|
||||
- -xc
|
||||
- kubectl exec "$(kubectl get pods -l 'app.kubernetes.io/component=server' -o name)" -- /bin/bash -c '( if ! which sudo &>/dev/null; then apt update && apt install sudo; fi ) && sudo -u www-data bash -x /scripts/cron-previewgenerator.sh'
|
||||
- kubectl exec "$(kubectl get pods -l 'app.kubernetes.io/component=server' -o name)" -- /bin/bash -c '( if ! which sudo &>/dev/null; then apt update && apt install sudo; fi ) && sudo -u www-data php -f /var/www/html/occ preview:pre-generate'
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
php -f /var/www/html/occ config:app:set --value="32 64 256 1024 1920" previewgenerator squareSizes &&
|
||||
php -f /var/www/html/occ config:app:set --value="64 128 1024 1080 2030" previewgenerator widthSizes &&
|
||||
php -f /var/www/html/occ config:app:set --value="64 256 1024 1080 1920" previewgenerator heightSizes &&
|
||||
php -f /var/www/html/occ preview:pre-generate -vvv
|
|
@ -41,10 +41,10 @@ spec:
|
|||
containerPort: 5432
|
||||
resources:
|
||||
requests:
|
||||
cpu: 750m
|
||||
cpu: 1000m
|
||||
memory: 1Gi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
cpu: 2000m
|
||||
memory: 1Gi
|
||||
volumeMounts:
|
||||
- name: postgres-pvc
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
resources:
|
||||
- namespace.yaml
|
||||
- ../../bases/nextcloud
|
||||
- ../../bases/imaginary
|
||||
|
||||
namespace: nextcloud
|
||||
|
|
Loading…
Reference in New Issue