github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/k8s/w3bstream.yaml (about) 1 --- 2 apiVersion: v1 3 kind: ConfigMap 4 metadata: 5 name: w3bstream-example 6 app: w3bstream 7 data: 8 HASURA_GRAPHQL_ADMIN_SECRET: "w3baAdmiNsecrEtkey" 9 HASURA_GRAPHQL_DATABASE_URL: "postgresql://w3badmin:PaSsW0Rd@postgres-example:5432/w3bstream" 10 POSTGRES_USER: "w3badmin" 11 POSTGRES_PASSWORD: "PaSsW0Rd" 12 POSTGRES_DB: "w3bstream" 13 NEXT_PUBLIC_API_URL: "http://w3bstream-example:8888" 14 DATABASE_URL: "postgresql://w3badmin:PaSsW0Rd@postgres-example:5432/w3bstream?schema=applet_management" 15 DATABASE_URL_MONITOR: "postgresql://w3badmin:PaSsW0Rd@postgres-example:5432/w3bstream?schema=monitor" 16 SRV_APPLET_MGR__EthClient_Endpoints: '{"4689": "https://babel-api.mainnet.iotex.io", "4690": "https://babel-api.testnet.iotex.io"}' 17 SRV_APPLET_MGR__JWT__ExpIn: 1h 18 SRV_APPLET_MGR__JWT__Issuer: "w3bstream" 19 SRV_APPLET_MGR__JWT__SignKey: "xxxx" 20 SRV_APPLET_MGR__PGCLI__Master: "postgresql://w3badmin:PaSsW0Rd@postgres-example:5432/w3bstream?sslmode=disable" 21 SRV_APPLET_MGR__SERVER__Port: "8888" 22 SRV_APPLET_MGR__BROKER__Server: mqtt://mqtt_server-example:1883 23 24 --- 25 apiVersion: apps/v1 26 kind: Deployment 27 metadata: 28 name: w3bstream-example 29 app: w3bstream 30 spec: 31 replicas: 1 32 selector: 33 matchLabels: 34 name: w3bstream-example 35 app: w3bstream 36 template: 37 metadata: 38 labels: 39 name: w3bstream-example 40 app: w3bstream 41 spec: 42 containers: 43 - name: w3bstream 44 image: ghcr.io/machinefi/w3bstream:main 45 resources: 46 limits: 47 memory: "1Gi" 48 cpu: "1" 49 envFrom: 50 - configMapKeyRef: 51 name: w3bstream-example 52 key: SRV_APPLET_MGR__ETHCLIENTCONFIG__ChainEndpoint 53 - configMapKeyRef: 54 name: w3bstream-example 55 key: SRV_APPLET_MGR__JWT__ExpIn 56 - configMapKeyRef: 57 name: w3bstream-example 58 key: SRV_APPLET_MGR__JWT__Issuer 59 - configMapKeyRef: 60 name: w3bstream-example 61 key: SRV_APPLET_MGR__JWT__SignKey 62 - configMapKeyRef: 63 name: w3bstream-example 64 key: SRV_APPLET_MGR__PGCLI__Master 65 - configMapKeyRef: 66 name: w3bstream-example 67 key: SRV_APPLET_MGR__SERVER__Port 68 - configMapKeyRef: 69 name: w3bstream-example 70 key: SRV_APPLET_MGR__BROKER__Server 71 ports: 72 - containerPort: 8888 73 volumeMounts: 74 - mountPath: /w3bstream/asserts 75 name: asserts 76 volumes: 77 - name: asserts 78 persistentVolumeClaim: 79 claimName: w3bstream-example-asserts 80 81 --- 82 apiVersion: v1 83 kind: PersistentVolumeClaim 84 metadata: 85 name: w3bstream-example-asserts 86 app: w3bstream 87 spec: 88 resources: 89 requests: 90 storage: 10Gi 91 volumeMode: Filesystem 92 accessModes: 93 - ReadWriteMany 94 --- 95 apiVersion: v1 96 kind: Service 97 metadata: 98 name: w3bstream-example 99 app: w3bstream 100 spec: 101 selector: 102 name: w3bstream-example 103 app: w3bstream 104 ports: 105 - port: 8888 106 targetPort: 8888 107 108 --- 109 apiVersion: apps/v1 110 kind: Deployment 111 metadata: 112 name: w3bstream-studio-example 113 spec: 114 replicas: 1 115 selector: 116 matchLabels: 117 name: w3bstream-studio-example 118 app: w3bstream 119 template: 120 metadata: 121 labels: 122 name: w3bstream-studio-example 123 app: w3bstream 124 spec: 125 containers: 126 - name: w3bstream 127 image: ghcr.io/machinefi/w3bstream-studio:main 128 command: 129 - node 130 - server.js 131 envFrom: 132 - configMapKeyRef: 133 name: w3bstream-example 134 key: DATABASE_URL 135 - configMapKeyRef: 136 name: w3bstream-example 137 key: DATABASE_URL_MONITOR 138 - configMapKeyRef: 139 name: w3bstream-example 140 key: NEXT_PUBLIC_API_URL 141 resources: 142 limits: 143 memory: "1Gi" 144 cpu: "1" 145 ports: 146 - containerPort: 3000 147 --- 148 apiVersion: v1 149 kind: Service 150 metadata: 151 name: w3bstream-studio-example 152 app: w3bstream 153 spec: 154 selector: 155 name: w3bstream-studio-example 156 app: w3bstream 157 ports: 158 - port: 3000 159 targetPort: 3000 160 161 --- 162 apiVersion: v1 163 kind: Service 164 metadata: 165 name: postgres-example 166 labels: 167 app: w3bstream 168 spec: 169 type: ClusterIP 170 ports: 171 - protocol: TCP 172 port: 5432 173 targetPort: 5432 174 selector: 175 name: postgres-example 176 app: w3bstream 177 --- 178 apiVersion: apps/v1 179 kind: StatefulSet 180 metadata: 181 name: postgres-example 182 labels: 183 name: postgres-example 184 app: w3bstream 185 spec: 186 replicas: 1 187 serviceName: postgres-example 188 selector: 189 matchLabels: 190 name: postgres-example 191 app: w3bstream 192 template: 193 metadata: 194 labels: 195 name: postgres-example 196 app: w3bstream 197 spec: 198 containers: 199 - name: postgres 200 image: postgres:13 201 imagePullPolicy: Always 202 command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"] 203 ports: 204 - containerPort: 5432 205 volumeMounts: 206 - name: datadir 207 mountPath: /var/lib/postgresql/data 208 resources: 209 requests: 210 memory: 1Gi 211 cpu: 1 212 limits: 213 memory: 1Gi 214 cpu: 1 215 envFrom: 216 - configMapKeyRef: 217 name: w3bstream-example 218 key: POSTGRES_USER 219 - configMapKeyRef: 220 name: w3bstream-example 221 key: POSTGRES_PASSWORD 222 - configMapKeyRef: 223 name: w3bstream-example 224 key: POSTGRES_DB 225 226 volumeClaimTemplates: 227 - metadata: 228 name: datadir 229 labels: 230 name: postgres-example 231 app: w3bstream 232 spec: 233 accessModes: ["ReadWriteOnce"] 234 resources: 235 requests: 236 storage: 100Gi 237 238 --- 239 apiVersion: v1 240 kind: Service 241 metadata: 242 name: mqtt_server-example 243 labels: 244 app: w3bstream 245 spec: 246 type: ClusterIP 247 ports: 248 - protocol: TCP 249 port: 1883 250 targetPort: 1883 251 selector: 252 name: mqtt_server-example 253 app: w3bstream 254 255 --- 256 apiVersion: apps/v1 257 kind: StatefulSet 258 metadata: 259 name: mqtt_server-example 260 labels: 261 name: mqtt_server-example 262 app: w3bstream 263 spec: 264 replicas: 1 265 serviceName: mqtt_server-example 266 selector: 267 matchLabels: 268 name: mqtt_server-example 269 app: w3bstream 270 template: 271 metadata: 272 labels: 273 name: mqtt_server-example 274 app: w3bstream 275 spec: 276 containers: 277 - name: mqtt_server-example 278 image: eclipse-mosquitto:1.6.15 279 imagePullPolicy: Always 280 ports: 281 - containerPort: 1883 282 volumeMounts: 283 - name: datadir 284 mountPath: /mosquitto/data 285 resources: 286 requests: 287 memory: 1Gi 288 cpu: 1 289 limits: 290 memory: 1Gi 291 cpu: 1 292 293 volumeClaimTemplates: 294 - metadata: 295 name: datadir 296 labels: 297 name: mqtt_server-example 298 app: w3bstream 299 spec: 300 accessModes: ["ReadWriteOnce"] 301 resources: 302 requests: 303 storage: 50Gi 304 --- 305 apiVersion: apps/v1 306 kind: StatefulSet 307 metadata: 308 name: hasura-example 309 app: w3bstream 310 spec: 311 replicas: 1 312 serviceName: hasura-example 313 selector: 314 matchLabels: 315 name: hasura-example 316 app: w3bstream 317 template: 318 metadata: 319 labels: 320 name: hasura-example 321 app: w3bstream 322 spec: 323 containers: 324 - name: hasura 325 image: hasura/graphql-engine:v2.14.0 326 envFrom: 327 - configMapKeyRef: 328 name: w3bstream-example 329 key: HASURA_GRAPHQL_DATABASE_URL 330 - configMapKeyRef: 331 name: w3bstream-example 332 key: HASURA_GRAPHQL_ADMIN_SECRET 333 env: 334 - name: HASURA_GRAPHQL_ENABLE_CONSOLE 335 value: "true" 336 - name: example_GRAPHQL_DEV_MODE 337 value: "true" 338 - name: HASURA_GRAPHQL_UNAUTHORIZED_ROLE 339 value: "anonymous" 340 resources: 341 limits: 342 memory: "1Gi" 343 cpu: "1" 344 requests: 345 memory: "1Gi" 346 cpu: "1" 347 ports: 348 - containerPort: 8080 349 --- 350 apiVersion: v1 351 kind: Service 352 metadata: 353 name: hasura-example 354 app: w3bstream 355 spec: 356 selector: 357 name: hasura-example 358 app: w3bstream 359 ports: 360 - port: 8080 361 targetPort: 8080