Skip to content

waves-enterprise/we-k8s-operator

Repository files navigation

General

The Kubernetes operator is designed to automate application deployment. You only need to install it and fill in the parameters in the configuration file. All services will be automatically deployed. Allows you to use a set of services as one application, by simple configuration. Using the settings, you can choose to install with a client, only a node, and any variations. The operator independently monitors that all services are deployed and running in the cluster.

Main settings

To create a WeMainnet service after installing the operator, you need to create a service with kind: WeMainnet. The minimum configuration looks like this:

apiVersion: apps.wavesenterprise.com/v1
kind: We Mainnet
metadata:
  name: mainnet
  postgres_enabled: "false"
#NODE
  image: "wavesenterprise/node:v1.8.1"
  replicas: 1
  storage: "20Gi"
#DOCKERHOST
  image_dockerhost: "docker:19.03.1-dind"
  privileged_dockerhost: true

In this case, the following services will be deployed:

node dockerhost

First you need to add configs for nodes and wallets to the namespace:

---
apiVersion: v1
kind: Secret
metadata:
  name: node-wallet
type: Opaque
data:
  node-0-keystore.dat: /FILL IN YOUR KEYSTORE IN BASE64/

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: node-config
data:
  node-0.conf: |
     /FILL IN YOUR NODE CONFIG/

Additionally, you can deploy the telegraf agent

spec: telegraf_enabled: "false"

Telegraf is used as an agent for building node metrics, it must be specified in the node configuration in the metrics.uri section

telegraf requires configuration

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: telegraf-config
data:
  telegraf.conf: |
    /FILL IN YOUR TELEGRAF CONFIG/

The postgres_enabled: "false" option can be added to the postgresql database deployment, databases for client services will be automatically created.

When the option client_enabled: "true" is enabled, client services will be deployed:

Crawler Auth Service data service frontend The following parameters in the manifest become mandatory:

#CRAWLER
  replicas_crawler: 1
  image_crawler: "wavesenterprise/crawler2:v1.8.0"
#AUTH
  replicas_auth: 1
  image_auth: "wavesenterprise/auth-service:v1.8.0"
#DATASERVICE
  replicas_ds: 1
  image_ds: "wavesenterprise/data-service:v1.8.0"
#FRONTEND
  replicas_frontend: 1
  image_frontend: "wavesenterprise/frontend-app:v1.8.0"
#AUTH ADMIN
  replicas_auth_admin: 1
  image_auth_admin: "wavesenterprise/auth-service-admin:v1.8.0"

In some cases, the web interface of the authorization service may be useful, it can also be additionally expanded with the parameter

spec: authadmin_enabled: "false"

Extra options: The parameters are set by default, they can be added to the manifest if you want to change

node:

clean_state: "false"

cpu_node_request: "2"

cpu_node_limit: "2"

memory_node_request: "4Gi"

memory_node_request: "4Gi"

java_opts: "-Dwe.check-resources=false -Xmx3g"

dockerhost:

cpu_dockerhost_request: "1"

cpu_dockerhost_limit: "2"

memory_dockerhost_request: "1Gi"

memory_dockerhost_limit: "2Gi"

Crawler

grpc_addresses: "node-0:6865,node-1:6865,node-2:6865"

cpu_crawler_request: "1"

cpu_crawler_limit: "1"

memory_crawler_request: ""2Gi"

memory_crawler_limit: "2Gi"

crawler_service_token: ""

Auth Service:

cpu_auth_request: "100m"

cpu_auth_limit: "1"

memory_auth_request: "32Mi"

memory_auth_limit: "1Gi"

mail_enabled: "false"

Data service:

cpu_ds_request: "1"

cpu_ds_limit: "1"

memory_ds_request: "1Gi"

memory_ds_limit: "1Gi"

dataservice_service_token: ""

frontend:

cpu_frontend_request: "1"

cpu_frontend_limit: "1"

memory_frontend_request: "1Gi"

memory_frontend_limit: "1Gi"

Configuration files required for services

Installation without a client:

Through this configuration, you can declare Env variables in the node container, the config is required

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: vars-node
data:
  WE_NODE_OWNER_PASSWORD: "/PASSWORD/"
  WE_NODE_OWNER_PASSWORD_EMPTY: "false"

This configuration contains the config for the node, you need to fill it with your own parameters

apiVersion: v1
kind: ConfigMap
metadata:
  name: node-config
data:
  node-0.conf: |
    node {
      waves-crypto="yes"
      owner-address = "/ADDRESS/"
      directory="/node"
      license.file = "/opt/licenses/node-0.license"
      data-directory = "/node/data"
      wallet {
        file = "/opt/wallets/node-0-keystore.dat"
        password= "/PASSWORD/"
      }
      blockchain {
        type="MAINNET"
      }
      logging-level="DEBUG"
      network {
        bind-address="0.0.0.0"
        port=6864
        known-peers = [
          "cloud.wemeadow.com:6864"
          "pool.wemeadow.com:6864"
          "node-0.wavesenterprise.com:6864"
          "node-1.wavesenterprise.com:6864"
          "node-2.wavesenterprise.com:6864"
        ]
        node-name="MAINNET_NODE_2"
        peers-data-residence-time="2h"
        break-idle-connections-timeout = "3m"
        declared-address = "0.0.0.0:6864"
      }
      api {
        auth {
          type = "api-key"
          api-key-hash = "/KEYHASH/"
          privacy-api-key-hash = "/PRIVACYKEYHASH/"
        }
      }
      miner {
        enable = "yes"
        quorum = 2
        interval-after-last-block-then-generation-is-allowed = "35d"
        micro-block-interval = "5s"
        min-micro-block-age = "3s"
        max-transactions-in-micro-block = 500
        minimal-block-generation-offset = "200ms"
      }
      scheduler-service {
        enable = "no"
      }
      privacy {
        crawling-parallelism = 100
        storage {
          vendor = "none"
        }
      }
      docker-engine {
        enable = "yes"
        use-node-docker-host = "yes"
        default-registry-domain = "registry.wavesenterprise.com/waves-enterprise-public"
        docker-host = "tcp://dockerhost:2375"
        execution-limits {
          timeout = "30s"
          memory = 512
          memory-swap = 0
        }
        reuse-containers = "yes"
        remove-container-after = "10m"
        remote-registries = []
        check-registry-auth-on-startup = "yes"
        contract-execution-messages-cache {
          expire-after = "60m"
          max-buffer-size = 10
          max-buffer-time = "100ms"
        }
      }
    }
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: node-license
data:
  node-0.license: |

    {"license":"....}

For the authorization service, you need to generate keys and add them to the auth-service-keys secret

Generating a new key pair:

ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
 # Don't add passphrase
 openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
 cat jwtRS256.key | base64
 cat jwtRS256.key.pub | base64
---
apiVersion: v1
kind: Secret
metadata:
  name: auth-service-keys
type: Opaque
data:
  jwtRS256.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS0FJQkFBS0NBZ0VBa3FmcW1PSUNTQ203ZFZBUjlnOEhZSXFiNUhqd05KNDdPK1JLVDZMV3lSSz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LS0tLQ==

---
apiVersion: v1
kind: Secret
metadata:
  name: node-wallet
type: Opaque
data:
  node-0-keystore.dat: /WALLET BASE64/
  

Using the auth-service-tokens secret, you can set your application access tokens. They will need to be set via a parameter in the crawler and dataservice.

---
apiVersion: v1
kind: Secret
metadata:
  name: auth-service-tokens
type: Opaque
data:
  tokens.json: ICAgIHsKICAgICAgImFjY2VzcyI6ICJNaDdLMGlNajFqZTNwckMza2tqaFpFM0ZPWDVpblBSYlh2T0Foc1BSIgogICAgfQ==

Using the pg-user secret, we set parameters for accessing services to the database

---
apiVersion: v1
kind: Secret
metadata:
  name: pg-user
type: Opaque
data:
  user: cG9zdGdyZXM=
  password_admin: VE1MdDFoUE9GVG8xMG9Gaw==
  ssl: ZmFsc2UK

Using a mail secret, you can set the parameters for sending emails via smtp

---
apiVersion: v1
kind: Secret
metadata:
  name: mail
type: Opaque
data:
  mail-host: ZXhhbXBsZQ==
  mail-user: ZXhhbXBsZQ==
  mail-password: ZXhhbXBsZQ==
  mail-from: ZXhhbXBsZQ==
  mail-port: ZXhhbXBsZQ==
  mail-salt: ZXhhbXBsZQ==

About

Kubernetes operator for Waves Enterprise Mainnet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published