feat: Adds Nextcloud pre-install hook and ArgoCD ignore rules
Introduces a `before-starting` hook that creates a `CAN_INSTALL` file, signaling Nextcloud to proceed with its installation process. Configures ArgoCD to ignore differences in `batch/Job` resources' `spec.selector` and `spec.template.metadata.labels`. This prevents spurious out-of-sync states caused by Kubernetes mutating these fields on job creation, improving application synchronization stability.
This commit is contained in:
parent
1b57f76543
commit
c85ee51590
|
|
@ -0,0 +1,16 @@
|
|||
#@ load("@ytt:overlay", "overlay")
|
||||
|
||||
#@overlay/match by=overlay.all, expects="1+"
|
||||
---
|
||||
#@overlay/match-child-defaults missing_ok=True
|
||||
spec:
|
||||
ignoreDifferences:
|
||||
- group: batch
|
||||
kind: Job
|
||||
jsonPointers:
|
||||
- /spec/selector
|
||||
- /spec/template/metadata/labels
|
||||
syncPolicy:
|
||||
syncOptions:
|
||||
#@overlay/append
|
||||
- RespectIgnoreDifferences=true
|
||||
|
|
@ -53,6 +53,9 @@ nextcloud:
|
|||
opcache.save_comments=1
|
||||
opcache.revalidate_freq=60
|
||||
|
||||
hooks:
|
||||
before-starting: touch /var/www/html/config/CAN_INSTALL
|
||||
|
||||
extraSidecarContainers:
|
||||
- name: caddy
|
||||
image: caddy:2-alpine
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@ spec:
|
|||
destination:
|
||||
namespace: nextcloud
|
||||
server: https://kubernetes.default.svc
|
||||
ignoreDifferences:
|
||||
- group: batch
|
||||
jsonPointers:
|
||||
- /spec/selector
|
||||
- /spec/template/metadata/labels
|
||||
kind: Job
|
||||
project: env-production
|
||||
source:
|
||||
path: rendered/envs/production/nextcloud
|
||||
|
|
@ -23,3 +29,4 @@ spec:
|
|||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
- ServerSideApply=true
|
||||
- RespectIgnoreDifferences=true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
data:
|
||||
before-starting.sh: touch /var/www/html/config/CAN_INSTALL
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
annotations:
|
||||
a8r.io/repository: ssh://git@git.tr1ceracop.de:222/gitea_admin/k8s-and-chill.git
|
||||
labels:
|
||||
app.kubernetes.io/instance: nextcloud
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: nextcloud
|
||||
app.kubernetes.io/version: 33.0.0
|
||||
helm.sh/chart: nextcloud-9.0.4
|
||||
name: nextcloud-hooks
|
||||
namespace: nextcloud
|
||||
|
|
@ -27,7 +27,7 @@ spec:
|
|||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
hooks-hash: 9525c2748a6c7cd0e28ec740623d0b3fa5a75c83b51ccfd136bc89c76737b204
|
||||
hooks-hash: 47a89ca9deff73131884ece615e1cabb1f600fec60aa8f20244ae3c5bb58f948
|
||||
nextcloud-config-hash: 0d229123637fe9f641f41261891a44b761ff32c52f973314650897e768f3456d
|
||||
php-config-hash: b638f66fd8d65de8364dbad6efc59a6524c7b2e2377b5623cf5e921e4d3d2400
|
||||
labels:
|
||||
|
|
@ -208,6 +208,10 @@ spec:
|
|||
- mountPath: /usr/local/etc/php/conf.d/uploadLimit.ini
|
||||
name: nextcloud-phpconfig
|
||||
subPath: uploadLimit.ini
|
||||
- mountPath: /docker-entrypoint-hooks.d/before-starting/helm.sh
|
||||
name: nextcloud-hooks
|
||||
readOnly: true
|
||||
subPath: before-starting.sh
|
||||
- command:
|
||||
- /cron.sh
|
||||
env:
|
||||
|
|
@ -416,6 +420,10 @@ spec:
|
|||
- configMap:
|
||||
name: nextcloud-phpconfig
|
||||
name: nextcloud-phpconfig
|
||||
- configMap:
|
||||
defaultMode: 493
|
||||
name: nextcloud-hooks
|
||||
name: nextcloud-hooks
|
||||
- configMap:
|
||||
name: nextcloud-caddy-config
|
||||
name: caddy-config
|
||||
|
|
|
|||
Loading…
Reference in a new issue