Browse Source

Add other configs, repair volume mounts

Anuj Bansal 3 years ago
parent
commit
6cf0fefe7c

+ 9 - 0
devops/kubernetes/argus/Pulumi.yaml

@@ -19,3 +19,12 @@ template:
     argusImage:
       description: The distributor node image to use for running the node
       default: joystream/distributor-node:latest
+    keys:
+      description: Specifies the keys available within distributor node CLI
+      default: "[{ 'suri': '//Alice' }]"
+    buckets:
+      description: Specifies the buckets distributed by the node
+      default: 'all'
+    workerId:
+      description: ID of the node operator (distribution working group worker)
+      default: 0

+ 3 - 1
devops/kubernetes/argus/README.md

@@ -38,7 +38,9 @@ After cloning this repo, from this working directory, run these commands:
 
    ```bash
    $ pulumi config set-all --plaintext aws:region=us-east-1 --plaintext aws:profile=joystream-user \
-    --plaintext queryNodeHost='https://34.197.252.42.nip.io/server/graphql' --plaintext isMinikube=false
+    --plaintext queryNodeHost='https://34.197.252.42.nip.io/server/graphql' --plaintext isMinikube=true \
+    --plaintext wsProviderEndpointURI='wss://rome-rpc-endpoint.joystream.org:9944/' \
+    --plaintext keys='[{ "suri": "//Alice" }]' --plaintext buckets="all" --plaintext workerId=0
    ```
 
    If you want to build the stack on AWS set the `isMinikube` config to `false`

+ 20 - 2
devops/kubernetes/argus/index.ts

@@ -13,6 +13,9 @@ const queryNodeHost = config.require('queryNodeHost')
 const wsProviderEndpointURI = config.require('wsProviderEndpointURI')
 let configArgusImage = config.require('argusImage')
 const lbReady = config.get('isLoadBalancerReady') === 'true'
+const keys = config.get('keys') || '[{ "suri": "//Alice" }]'
+const buckets = config.get('buckets') || 'all'
+const workerId = config.get('workerId') || '0'
 const name = 'argus-node'
 const isMinikube = config.getBoolean('isMinikube')
 
@@ -116,6 +119,18 @@ const deployment = new k8s.apps.v1.Deployment(
                   name: 'JOYSTREAM_DISTRIBUTOR__ENDPOINTS__JOYSTREAM_NODE_WS',
                   value: wsProviderEndpointURI,
                 },
+                {
+                  name: 'JOYSTREAM_DISTRIBUTOR__KEYS',
+                  value: keys,
+                },
+                {
+                  name: 'JOYSTREAM_DISTRIBUTOR__BUCKETS',
+                  value: buckets,
+                },
+                {
+                  name: 'JOYSTREAM_DISTRIBUTOR__WORKER_ID',
+                  value: workerId,
+                },
               ],
               args: ['start'],
               ports: [{ containerPort: 3334 }],
@@ -123,14 +138,17 @@ const deployment = new k8s.apps.v1.Deployment(
                 {
                   name: 'persistent-data',
                   mountPath: '/data',
+                  subPath: 'data',
                 },
                 {
                   name: 'persistent-data',
-                  mountPath: '/cache',
+                  mountPath: '/logs',
+                  subPath: 'logs',
                 },
                 {
                   name: 'persistent-data',
-                  mountPath: '/logs',
+                  mountPath: '/cache',
+                  subPath: 'cache',
                 },
               ],
             },