diff --git a/apps/outline-app.yaml b/apps/outline-app.yaml new file mode 100644 index 0000000..b617a71 --- /dev/null +++ b/apps/outline-app.yaml @@ -0,0 +1,22 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: outline + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "5" +spec: + project: default + source: + repoURL: https://git.cloud-infra.prod.openmailserver.de/stabify/gitops.git + targetRevision: HEAD + path: apps/outline + destination: + server: https://kubernetes.default.svc + namespace: outline + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/apps/outline/Chart.yaml b/apps/outline/Chart.yaml new file mode 100644 index 0000000..dd805a2 --- /dev/null +++ b/apps/outline/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: outline-wrapper +description: Wrapper chart for Outline Wiki +type: application +version: 1.0.0 +appVersion: "1.0.0" +dependencies: + - name: outline + repository: https://runxs-charts.github.io/community-charts + version: 0.5.4 # Prüfen ob das die aktuelle stabile Version ist, ich nehme eine gängige. diff --git a/apps/outline/VAULT_SETUP.md b/apps/outline/VAULT_SETUP.md new file mode 100644 index 0000000..bca2f0e --- /dev/null +++ b/apps/outline/VAULT_SETUP.md @@ -0,0 +1,54 @@ +# Vault Secrets für Outline anlegen + +Outline benötigt viele Secrets für DB, Redis, S3 und OIDC. +Hier sind die Befehle, um diese in Vault anzulegen. + +**Wichtig:** Du musst die Platzhalter (S3 Keys, OIDC Daten) mit deinen echten Daten ersetzen! + +```bash +# Umgebungsvariablen für Vault setzen +export VAULT_ADDR='https://10.100.30.11:8200' +export VAULT_TOKEN='DeinRootToken' +export VAULT_CACERT='./vault-ca.crt' # Pfad anpassen + +# 1. Passwörter und Keys generieren +POSTGRES_PASS=$(openssl rand -hex 16) +REDIS_PASS=$(openssl rand -hex 16) +SECRET_KEY=$(openssl rand -hex 32) +UTILS_SECRET=$(openssl rand -hex 32) + +# 2. Connection Strings bauen (Interner Cluster DNS) +# Hostnames basieren auf dem Release Namen 'outline' +DB_URL="postgres://postgres:$POSTGRES_PASS@outline-postgresql.outline.svc.cluster.local:5432/outline" +REDIS_URL="redis://:$REDIS_PASS@outline-redis-master.outline.svc.cluster.local:6379" + +# 3. Externe Credentials (BITTE ANPASSEN!) +# Beispiel für MinIO oder AWS S3 +AWS_ACCESS_KEY="dein-access-key" +AWS_SECRET_KEY="dein-secret-key" + +# Beispiel für Google/OIDC +OIDC_CLIENT_ID="deine-client-id" +OIDC_CLIENT_SECRET="dein-client-secret" +OIDC_AUTH_URI="https://accounts.google.com/o/oauth2/v2/auth" +OIDC_TOKEN_URI="https://oauth2.googleapis.com/token" +OIDC_USERINFO_URI="https://openidconnect.googleapis.com/v1/userinfo" + +# 4. Alles in Vault schreiben +vault kv put secret/apps/outline \ + secret_key="$SECRET_KEY" \ + utils_secret="$UTILS_SECRET" \ + database_url="$DB_URL" \ + redis_url="$REDIS_URL" \ + postgres_password="$POSTGRES_PASS" \ + redis_password="$REDIS_PASS" \ + aws_access_key_id="$AWS_ACCESS_KEY" \ + aws_secret_access_key="$AWS_SECRET_KEY" \ + oidc_client_id="$OIDC_CLIENT_ID" \ + oidc_client_secret="$OIDC_CLIENT_SECRET" \ + oidc_auth_uri="$OIDC_AUTH_URI" \ + oidc_token_uri="$OIDC_TOKEN_URI" \ + oidc_userinfo_uri="$OIDC_USERINFO_URI" +``` + +Nachdem du das ausgeführt hast, synchronisiert ArgoCD/ExternalSecrets diese Daten in den Cluster. diff --git a/apps/outline/external-secret.yaml b/apps/outline/external-secret.yaml new file mode 100644 index 0000000..aeee8e2 --- /dev/null +++ b/apps/outline/external-secret.yaml @@ -0,0 +1,83 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: outline-secrets + namespace: outline +spec: + refreshInterval: 1m + secretStoreRef: + name: vault-backend + kind: ClusterSecretStore + target: + name: outline-secrets + creationPolicy: Owner + data: + # Generelle Outline Secrets + - secretKey: SECRET_KEY + remoteRef: + key: secret/apps/outline + property: secret_key + - secretKey: UTILS_SECRET + remoteRef: + key: secret/apps/outline + property: utils_secret + + # Datenbank URLs (muss zusammengebaut werden oder direkt in Vault liegen) + # Wir bauen die URL im Vault zusammen oder hier? + # Outline erwartet DATABASE_URL als kompletten String. + # Format: postgres://user:password@host:5432/dbname + # Host für internes Postgres: outline-postgresql + - secretKey: DATABASE_URL + remoteRef: + key: secret/apps/outline + property: database_url + + # Redis URL + # Format: redis://:password@host:6379 + # Host für internes Redis: outline-redis-master + - secretKey: REDIS_URL + remoteRef: + key: secret/apps/outline + property: redis_url + + # Passwörter für die Subcharts (damit die Pods starten können) + - secretKey: postgres-password + remoteRef: + key: secret/apps/outline + property: postgres_password + - secretKey: redis-password + remoteRef: + key: secret/apps/outline + property: redis_password + + # S3 Storage Credentials + - secretKey: AWS_ACCESS_KEY_ID + remoteRef: + key: secret/apps/outline + property: aws_access_key_id + - secretKey: AWS_SECRET_ACCESS_KEY + remoteRef: + key: secret/apps/outline + property: aws_secret_access_key + + # OIDC Credentials + - secretKey: OIDC_CLIENT_ID + remoteRef: + key: secret/apps/outline + property: oidc_client_id + - secretKey: OIDC_CLIENT_SECRET + remoteRef: + key: secret/apps/outline + property: oidc_client_secret + - secretKey: OIDC_AUTH_URI + remoteRef: + key: secret/apps/outline + property: oidc_auth_uri + - secretKey: OIDC_TOKEN_URI + remoteRef: + key: secret/apps/outline + property: oidc_token_uri + - secretKey: OIDC_USERINFO_URI + remoteRef: + key: secret/apps/outline + property: oidc_userinfo_uri diff --git a/apps/outline/values.yaml b/apps/outline/values.yaml new file mode 100644 index 0000000..0529567 --- /dev/null +++ b/apps/outline/values.yaml @@ -0,0 +1,66 @@ +outline: + image: + repository: outlinewiki/outline + tag: latest + + # URL Configuration + url: https://kb.apps.k3s.stabify.de + + # Secrets (werden via ExternalSecrets injected) + secret: + existingSecret: "outline-secrets" + # Die Keys im Secret müssen matchen: + # SECRET_KEY, UTILS_SECRET, DATABASE_URL, REDIS_URL + # AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY + # OIDC_CLIENT_SECRET, etc. + + # Storage (S3) - Diese Werte kommen z.T. aus dem Secret oder hier hardcoded wenn öffentlich + storage: + storageType: s3 + s3: + bucket: "outline" + region: "us-east-1" # Bei MinIO/Cloudflare oft egal, aber nötig + # uploadBucketUrl: "https://..." # Optional, falls public access anders ist + # endpoint: "https://..." # Muss in Vault oder hier gesetzt werden. Ich setze es hier als Placeholder. + + # Authentication + auth: + oidc: + enabled: true + displayName: "OIDC Login" + # scopes: "openid profile email" + + # PostgreSQL Dependency Configuration + postgresql: + enabled: true + auth: + existingSecret: "outline-secrets" + secretKeys: + adminPasswordKey: "postgres-password" + userPasswordKey: "postgres-password" + primary: + persistence: + enabled: true + size: 8Gi + + # Redis Dependency Configuration + redis: + enabled: true + architecture: standalone + auth: + existingSecret: "outline-secrets" + existingSecretPasswordKey: "redis-password" + + ingress: + enabled: true + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod + hosts: + - host: kb.apps.k3s.stabify.de + paths: + - path: / + pathType: Prefix + tls: + - secretName: outline-tls + hosts: + - kb.apps.k3s.stabify.de