|
| 1 | +# Ontoserver — ApplicationSet for content development + production read-only |
| 2 | +# |
| 3 | +# Creates two Applications from a single manifest: |
| 4 | +# |
| 5 | +# ontoserver-rw — Read/write StatefulSet for content development. |
| 6 | +# Single instance, external PostgreSQL, attached disk, |
| 7 | +# not publicly exposed. |
| 8 | +# |
| 9 | +# ontoserver-prod — Read-only StatefulSet cluster for production serving. |
| 10 | +# Scaled (2+ replicas), external PostgreSQL, per-pod |
| 11 | +# attached disks, Varnish cache, $closure routing to pod-0. |
| 12 | +# |
| 13 | +# Topology reference: charts/ontoserver/README.md — Production recommendations |
| 14 | +# |
| 15 | +# Prerequisites on the cluster: |
| 16 | +# - Envoy Gateway: https://gateway.envoyproxy.io/docs/install/install-helm/ |
| 17 | +# - cert-manager: https://cert-manager.io/docs/installation/ (if TLS enabled) |
| 18 | +# |
| 19 | +# Before applying: |
| 20 | +# 1. Set hostname values in generators.list.elements |
| 21 | +# 2. Set database URLs (or replace config block with External Secrets) |
| 22 | +# 3. Set quay.io credentials (or use imagePullSecrets from a pre-created secret) |
| 23 | +# 4. Adjust storage sizes and resource requests to match your node pool |
| 24 | +# |
| 25 | +# Apply to your ArgoCD instance: |
| 26 | +# kubectl apply -f dev-readonly-envoy-appset.yaml -n argocd |
| 27 | + |
| 28 | +apiVersion: argoproj.io/v1alpha1 |
| 29 | +kind: ApplicationSet |
| 30 | +metadata: |
| 31 | + name: ontoserver |
| 32 | + namespace: argocd |
| 33 | +spec: |
| 34 | + generators: |
| 35 | + - list: |
| 36 | + elements: |
| 37 | + # ── Read/write — content development ───────────────────────────────── |
| 38 | + - appName: ontoserver-rw |
| 39 | + namespace: ontoserver-rw |
| 40 | + hostname: ontoserver-rw.example.com |
| 41 | + deploymentType: single |
| 42 | + isReadOnly: "false" |
| 43 | + replicas: "1" |
| 44 | + healthCheckOption: -f |
| 45 | + clusterName: "" |
| 46 | + closureBackend: "" |
| 47 | + dbUrl: jdbc:postgresql://db.example.com:5432/ontoserver_rw |
| 48 | + dbUsername: ontoserver |
| 49 | + storageSize: 512Gi |
| 50 | + |
| 51 | + # ── Read-only — production serving ─────────────────────────────────── |
| 52 | + - appName: ontoserver-prod |
| 53 | + namespace: ontoserver-prod |
| 54 | + hostname: ontoserver.example.com |
| 55 | + deploymentType: scaled |
| 56 | + isReadOnly: "true" |
| 57 | + replicas: "2" |
| 58 | + healthCheckOption: -s |
| 59 | + clusterName: ontoserver-prod |
| 60 | + # $closure routes to pod-0 via headless service DNS |
| 61 | + closureBackend: ontoserver-prod-statefulset-0.ontoserver-prod-ontoserver-headless |
| 62 | + dbUrl: jdbc:postgresql://db.example.com:5432/ontoserver_prod |
| 63 | + dbUsername: ontoserver |
| 64 | + storageSize: 1Ti |
| 65 | + |
| 66 | + template: |
| 67 | + metadata: |
| 68 | + name: "{{appName}}" |
| 69 | + finalizers: |
| 70 | + - resources-finalizer.argocd.argoproj.io |
| 71 | + spec: |
| 72 | + project: default |
| 73 | + destination: |
| 74 | + server: https://kubernetes.default.svc |
| 75 | + namespace: "{{namespace}}" |
| 76 | + sources: |
| 77 | + # ── ontoserver ───────────────────────────────────────────────────────── |
| 78 | + - repoURL: https://github.com/aehrc/ontoserver-deploy |
| 79 | + targetRevision: HEAD |
| 80 | + path: charts/ontoserver |
| 81 | + helm: |
| 82 | + valuesObject: |
| 83 | + ontoserver: |
| 84 | + deployment: |
| 85 | + kind: StatefulSet |
| 86 | + type: "{{deploymentType}}" |
| 87 | + isReadOnly: "{{isReadOnly}}" |
| 88 | + replicas: "{{replicas}}" |
| 89 | + clusterName: "{{clusterName}}" |
| 90 | + db: |
| 91 | + enabled: false # external PostgreSQL for both environments |
| 92 | + persistence: |
| 93 | + files: |
| 94 | + accessMode: ReadWriteOnce |
| 95 | + storageSize: "{{storageSize}}" |
| 96 | + |
| 97 | + imageCredentials: |
| 98 | + username: your-quay-username |
| 99 | + password: your-quay-password |
| 100 | + |
| 101 | + serverName: "{{hostname}}" |
| 102 | + hostNames: |
| 103 | + - "{{hostname}}" |
| 104 | + |
| 105 | + timeZone: Australia/Brisbane |
| 106 | + language: en_AU |
| 107 | + |
| 108 | + resources: |
| 109 | + ontoserver: |
| 110 | + requests: |
| 111 | + cpu: "1000m" |
| 112 | + memory: "4Gi" |
| 113 | + limits: |
| 114 | + cpu: "4000m" |
| 115 | + memory: "12Gi" |
| 116 | + initialHeapSize: "1000m" |
| 117 | + maxHeapSize: "10000m" |
| 118 | + |
| 119 | + healthCheckOption: "{{healthCheckOption}}" |
| 120 | + |
| 121 | + gateway: |
| 122 | + enabled: true |
| 123 | + className: envoy-gateway-class |
| 124 | + requestTimeout: 300s |
| 125 | + backendServiceNameOverride: "{{appName}}-varnish-service" |
| 126 | + |
| 127 | + tls: |
| 128 | + enabled: true |
| 129 | + certRef: "{{appName}}-tls" |
| 130 | + certmanager: |
| 131 | + enabled: true |
| 132 | + email: your-email@example.com |
| 133 | + |
| 134 | + config: |
| 135 | + spring.datasource.url: "{{dbUrl}}" |
| 136 | + spring.datasource.username: "{{dbUsername}}" |
| 137 | + # spring.datasource.password set via External Secrets or --set |
| 138 | + |
| 139 | + # Configure syndication subscriptions here: |
| 140 | + # config: |
| 141 | + # ontoserver.syndication.plus.subscriptions.0.uri: https://your-syndication-server/fhir/SubscriptionDefinition/... |
| 142 | + |
| 143 | + # ── ontoserver-extras (Varnish) ──────────────────────────────────────── |
| 144 | + - repoURL: https://github.com/aehrc/ontoserver-deploy |
| 145 | + targetRevision: HEAD |
| 146 | + path: charts/ontoserver-extras |
| 147 | + helm: |
| 148 | + valuesObject: |
| 149 | + varnish: |
| 150 | + enabled: true |
| 151 | + graceSeconds: 30 |
| 152 | + # For the scaled prod instance, route $closure to pod-0. |
| 153 | + # Empty string disables dedicated $closure routing (used for rw). |
| 154 | + closureBackend: "{{closureBackend}}" |
| 155 | + cache: |
| 156 | + time200: 10m |
| 157 | + time404: 1m |
| 158 | + |
| 159 | + syncPolicy: |
| 160 | + automated: |
| 161 | + prune: true |
| 162 | + selfHeal: true |
| 163 | + syncOptions: |
| 164 | + - CreateNamespace=true |
0 commit comments