Add generic app to deploy extra resources

This commit is contained in:
dvirlabs 2025-07-17 02:57:34 +03:00
parent 30c5313532
commit 26fa6c70a2
5 changed files with 87 additions and 1 deletions

View File

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-apps-extra-resources
namespace: argocd
spec:
project: infra
source:
repoURL: https://git.dvirlabs.com/dvirlabs/my-apps.git
targetRevision: HEAD
path: manifests/extra-resources
destination:
server: https://kubernetes.default.svc
namespace: my-apps
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@ -0,0 +1,21 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: keycloak-client-secret
namespace: my-apps
spec:
refreshInterval: 1h
secretStoreRef:
name: my-secret-store
kind: ClusterSecretStore
target:
name: keycloak-client-secret
template:
engineVersion: v2
data:
keycloak-client-secret: "{{ .client_secret }}"
data:
- secretKey: client_secret
remoteRef:
key: oidc-clients/nextcloud-oidc
property: client_secret

View File

@ -0,0 +1,20 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nextcloud-post-install
namespace: my-apps
data:
keycloak-post-install.sh: |
#!/bin/bash
echo "🔐 Enabling sociallogin app..."
occ app:install sociallogin || true
occ app:enable sociallogin
echo "🔐 Configuring Keycloak OIDC provider..."
occ sociallogin:custom_oidc keycloak \
--client-id="nextcloud" \
--client-secret="$(cat /secrets/keycloak-client-secret)" \
--issuer-uri="https://keycloak.dvirlabs.com/realms/dvirlabs" \
--auto-provision 1 \
--hide-login-form 0 \
--scope="openid profile email"

View File

@ -0,0 +1,13 @@
#!/bin/bash
echo "🔐 Enabling sociallogin app..."
occ app:install sociallogin || true
occ app:enable sociallogin
echo "🔐 Configuring Keycloak OIDC provider..."
occ sociallogin:custom_oidc keycloak \
--client-id="nextcloud" \
--client-secret="$(cat /secrets/keycloak-client-secret)" \
--issuer-uri="https://keycloak.dvirlabs.com/realms/dvirlabs" \
--auto-provision 1 \
--hide-login-form 0 \
--scope="openid profile email"

View File

@ -24,6 +24,20 @@ nextcloud:
- name: OVERWRITEPROTOCOL - name: OVERWRITEPROTOCOL
value: https value: https
extraVolumes:
- name: keycloak-post-install
configMap:
name: nextcloud-post-install
- name: keycloak-secret
secret:
secretName: keycloak-client-secret
extraVolumeMounts:
- name: keycloak-post-install
mountPath: /docker-entrypoint-hooks.d/post-installation
- name: keycloak-secret
mountPath: /secrets
internalDatabase: internalDatabase:
enabled: false enabled: false
@ -39,7 +53,7 @@ persistence:
enabled: true enabled: true
storageClass: nfs-client storageClass: nfs-client
accessMode: ReadWriteOnce accessMode: ReadWriteOnce
size: 500Gi size: 1000Gi
mariadb: mariadb:
enabled: true enabled: true