|
| 1 | +# GitOps Pattern: External Secret + External MongoDB |
| 2 | +# |
| 3 | +# This example demonstrates the correct configuration for users who want to: |
| 4 | +# - Use GitOps (Argo CD / Flux) with externally-managed secrets |
| 5 | +# - Connect to an external/self-managed MongoDB instance |
| 6 | +# - Avoid Helm-managed secret generation and rotation |
| 7 | +# |
| 8 | +# Why this pattern? |
| 9 | +# - Global secrets are managed outside Helm (e.g., via sealed-secrets, external-secrets operator) |
| 10 | +# - MongoDB is managed separately (cloud provider, self-managed cluster, etc.) |
| 11 | +# - Helm only orchestrates the Graylog and Data Node workloads |
| 12 | +# |
| 13 | +# Prerequisites: |
| 14 | +# 1. A secret named "graylog-managed-secret" (or your chosen name) must exist |
| 15 | +# with the following required keys: |
| 16 | +# - GRAYLOG_PASSWORD_SECRET: Base64-encoded pepper string (≥64 chars) |
| 17 | +# - GRAYLOG_ROOT_PASSWORD_SHA2: SHA256 hash of root password |
| 18 | +# - GRAYLOG_MONGODB_URI: Base64-encoded MongoDB connection string |
| 19 | +# - GRAYLOG_ROOT_USERNAME: (optional) defaults to "admin" if not provided |
| 20 | +# |
| 21 | +# 2. MongoDB must be running and accessible at the configured connection URI |
| 22 | +# |
| 23 | +# Example secret creation: |
| 24 | +# kubectl create secret generic graylog-managed-secret \ |
| 25 | +# --from-literal=GRAYLOG_PASSWORD_SECRET="$(openssl rand -base64 64)" \ |
| 26 | +# --from-literal=GRAYLOG_ROOT_PASSWORD_SHA2="$(echo -n mypassword | sha256sum | cut -d' ' -f1)" \ |
| 27 | +# --from-literal=GRAYLOG_MONGODB_URI="$(echo -n 'mongodb://graylo[EMAIL_ADDRESS_REDACTED]om:27017/graylog' | base64)" \ |
| 28 | +# --from-literal=GRAYLOG_ROOT_USERNAME="admin" |
| 29 | +# |
| 30 | + |
| 31 | +global: |
| 32 | + # Point to the externally-managed secret containing all credentials |
| 33 | + # This secret must exist in the same namespace before installation |
| 34 | + existingSecretName: graylog-managed-secret |
| 35 | + |
| 36 | +# Disable chart-managed MongoDB |
| 37 | +# When using external MongoDB, set this to false |
| 38 | +mongodb: |
| 39 | + communityResource: |
| 40 | + enabled: false |
| 41 | + |
| 42 | +# Configure Graylog to use external MongoDB |
| 43 | +graylog: |
| 44 | + # The MongoDB connection URI is read from the external secret's GRAYLOG_MONGODB_URI key |
| 45 | + # You can also override it here if needed (optional): |
| 46 | + # config: |
| 47 | + # mongodb: |
| 48 | + # customUri: "mongodb://graylo[EMAIL_ADDRESS_REDACTED]om:27017/graylog" |
| 49 | + |
| 50 | + # Example: Configure replicas for Graylog |
| 51 | + replicas: 3 |
| 52 | + |
| 53 | + # Example: Configure resources |
| 54 | + resources: |
| 55 | + requests: |
| 56 | + memory: "2Gi" |
| 57 | + cpu: "500m" |
| 58 | + limits: |
| 59 | + memory: "3Gi" |
| 60 | + cpu: "1000m" |
| 61 | + |
| 62 | +# Data Node configuration (also uses the external secret) |
| 63 | +datanode: |
| 64 | + # Example: Configure replicas for Data Node |
| 65 | + replicas: 3 |
| 66 | + |
| 67 | + # Example: Configure resources for Data Node |
| 68 | + resources: |
| 69 | + requests: |
| 70 | + memory: "2Gi" |
| 71 | + cpu: "500m" |
| 72 | + limits: |
| 73 | + memory: "4Gi" |
| 74 | + cpu: "1000m" |
| 75 | + |
| 76 | +# Disable MongoDB-specific tests (not applicable when MongoDB is external) |
| 77 | +graylog: |
| 78 | + enabled: true |
| 79 | + |
| 80 | +# Example: Configure ingress for external access |
| 81 | +ingress: |
| 82 | + enabled: true |
| 83 | + ingressClassName: "nginx" |
| 84 | + web: |
| 85 | + enabled: true |
| 86 | + hosts: |
| 87 | + - host: "graylog.example.com" |
| 88 | + paths: |
| 89 | + - path: / |
| 90 | + pathType: Prefix |
| 91 | + tls: |
| 92 | + - secretName: graylog-tls |
| 93 | + hosts: |
| 94 | + - "graylog.example.com" |
0 commit comments