diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml new file mode 100644 index 0000000..88ded27 --- /dev/null +++ b/.github/workflows/lint-test.yml @@ -0,0 +1,39 @@ +name: Lint and Test Charts + +on: pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 + with: + version: v3.13.0 + + # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and + # yamllint (https://github.com/adrienverge/yamllint) which require Python + - name: Set up Python + uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 + with: + python-version: 3.x + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0f7f771 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +name: Release Chart +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Publish Helm charts + uses: stefanprodan/helm-gh-pages@master + with: + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/README.md b/README.md new file mode 100644 index 0000000..c1ea826 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +

+ +

+ +

+ + + +

+ +## P2P Helm Charts for Kubernetes + +This repository offers a selection of carefully curated P2P Helm charts, which are stored in individual folders. Each chart has its own `values.yaml` file defining the configuration parameters. + +## Getting Started + +To use these Helm charts, you first need to add the P2P repository to your local Helm client: + +```bash +helm repo add p2p-avs https://p2p-org.github.io/avs-helm-charts/ +``` + +Once the repository is added, you can deploy a specific chart with the following command: + +```bash +helm install my-release p2p-avs/ +``` + +**Note:** Make sure to replace `` with the name of the actual chart you intend to install. + +## Requirements + +Before you can use these Helm charts, ensure you have the following: + +* Kubernetes 1.20 or higher +* Helm 3 +* PV provisioner support in the underlying infrastructure (required for some charts) + +## Using Helm + +After installing the Helm client and adding the P2P repository, Helm is your tool of choice to manage packages on your Kubernetes cluster. For detailed guidance on using Helm, see the [official documentation](https://helm.sh/docs/intro/using_helm/). + +Here's a selection of helpful Helm commands to kickstart your journey: + +* Install a chart: `helm install my-release p2p-avs/` +* Upgrade your application: `helm upgrade my-release p2p-avs/` + +## Contribute + +We welcome contributions to improve our Helm charts. If you discover any bugs, have issues, or ideas for enhancements, feel free to open an issue or submit a pull request. Every feedback, bug report, or feature request is invaluable to us, and we appreciate the community's involvement in making P2P's Helm charts better. + +Feel free to explore the repository and experiment with the Helm charts to suit your specific needs. P2P's Helm charts aim to make application deployment on Kubernetes an effortless experience. diff --git a/charts/.gitkeep b/charts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/charts/aethos/.gitignore b/charts/aethos/.gitignore new file mode 100644 index 0000000..4a424df --- /dev/null +++ b/charts/aethos/.gitignore @@ -0,0 +1 @@ +secret.yaml diff --git a/charts/aethos/Chart.yaml b/charts/aethos/Chart.yaml new file mode 100644 index 0000000..4a1fbb2 --- /dev/null +++ b/charts/aethos/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +appVersion: 0.1.0 +description: A Helm chart for Kubernetes +name: aethos +type: application +version: 0.1.0 +maintainers: + - name: xom4ek + email: aleksei.lazarev@p2p.org diff --git a/charts/aethos/README.md b/charts/aethos/README.md new file mode 100644 index 0000000..610cc9b --- /dev/null +++ b/charts/aethos/README.md @@ -0,0 +1,146 @@ +# README + +This Helm chart is used to deploy a Kubernetes application. The following documentation provides details on the configurable values and their default settings. + +## Table of Contents + +- [README](#readme) + - [Table of Contents](#table-of-contents) + - [Parameters](#parameters) + - [Global Parameters](#global-parameters) + - [PVC Parameters](#pvc-parameters) + - [Service Parameters](#service-parameters) + - [Ingress Parameters](#ingress-parameters) + - [Configuration Parameters](#configuration-parameters) + - [Node Container Parameters](#node-container-parameters) + - [Pod Parameters](#pod-parameters) + - [Service Account Parameters](#service-account-parameters) + - [VM Pod Scrape Parameters](#vm-pod-scrape-parameters) + - [Example](#example) + - [License](#license) + +## Parameters + +### Global Parameters + +| Parameter | Description | Default | +|--------------------|--------------------------------------|---------| +| `nameOverride` | Optionally override the name of the chart | `""` | +| `fullnameOverride` | Optionally override the full name of the chart | `""` | +| `replicaCount` | Number of replicas to deploy | `1` | +| `labels` | Additional labels to add to resources | `{}` | +| `imagePullSecrets` | Secrets for pulling images from a private registry | `[]` | + +### PVC Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------| +| `pvc.size` | Size of the persistent volume claim | `10Gi` | +| `pvc.storageClassName` | Storage class name for the PVC | `""` | +| `pvc.labels` | Labels to add to the PVC | `{}` | +| `pvc.annotations` | Annotations to add to the PVC | `{}` | + +### Service Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `service.annotations` | Annotations to add to the service | `{}` | +| `service.type` | Type of service to create | `LoadBalancer`| +| `service.ports` | List of ports to expose from the service | `[{ name: node-api, port: 8080, protocol: TCP, targetPort: 8080 }, { name: metrics, port: 9090, protocol: TCP, targetPort: 9090 }, { name: task-server, port: 9010, protocol: TCP, targetPort: 9010 }]` | + +### Ingress Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `ingress.annotations` | Annotations to add to the ingress | `{}` | +| `ingress.enabled` | Enable or disable the ingress | `false` | +| `ingress.host` | Hostname for the ingress | `example.com` | + +### Configuration Parameters + +| Parameter | Description | Default | +|-----------------------------|--------------------------------------|---------------| +| `configs.operator.yaml` | Configuration file for the operator | ```yaml environment: production eth_rpc_url: https://lb.drpc.org/ogrpc?network=ethereum avs_service_manager_address: 0xdE93E0dA148e1919bb7f33cd8847F96e45791210 node_eigen_api_server_host_and_port: 0.0.0.0:8080 eigen_metrics_ip_port_address: 0.0.0.0:9090 node_task_server_host_and_port: 0.0.0.0:9010 aggregator_server_ip_port_address: holesky.task.aethos.network:50051``` | + +### Node Container Parameters + +| Parameter | Description | Default | +|-----------------------------------|--------------------------------------|---------------| +| `node.volumeMounts` | Volume mounts for the node container | `[{ name: ecdsa-key, mountPath: /app/operator_keys/ecdsa_key.json, subPath: ecdsa_key.json, readOnly: true }, { name: aethos, mountPath: /app/data/ }]` | +| `node.image.repository` | Image registry for the node container | `ghcr.io/aethosnetwork/operator` | +| `node.image.pullPolicy` | Image pull policy for the node container | `Always` | +| `node.image.tag` | Image tag for the node container | `latest` | +| `node.ports` | Ports to expose from the node container | `[{ name: node-api, containerPort: 8080, protocol: TCP }, { name: metrics, containerPort: 9090, protocol: TCP }, { name: task-server, containerPort: 9010, protocol: TCP }]` | +| `node.resources` | Resource limits and requests for the node container | `{ limits: { cpu: 4, memory: 16Gi }, requests: { cpu: 2, memory: 8Gi } }` | +| `node.env` | Environment variables for the node container | `[{ name: AETHOS_SIGNING_PRIVATE_KEY_STORE_PATH, value: "/app/operator_keys/ecdsa_key.json" }, { name: OPERATOR_ID, value: $YOU_OPERATOR_ID }, { name: AETHOS_SIGNING_PRIVATE_KEY_PASSWORD, valueFrom: { secretKeyRef: { name: YOURSECREWITHWALLET, key: ecdsa-private-key-password } } }, { name: NODE_TASK_SERVER_HOST_AND_PORT_TO_BROADCAST, value: 127.0.0.1:9010 }, { name: ETH_RPC_URL, value: https://lb.drpc.org/ogrpc?network=holesky }]` | +| `node.args` | Arguments to pass to the node container | `["start", "--config=/app/config/operator.yaml"]` | +| `node.readinessProbe` | Readiness probe for the node container | `{ httpGet: { path: /metrics, port: 9090 }, initialDelaySeconds: 30, periodSeconds: 10, timeoutSeconds: 3, failureThreshold: 3, successThreshold: 1 }` | + +### Pod Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `nodeSelector` | Node selector for the pod | `{}` | +| `tolerations` | Tolerations for the pod | `[]` | +| `affinity` | Affinity rules for the pod | `{}` | +| `podAnnotations` | Annotations to add to the pod | `{}` | +| `podSecurityContext` | Security context for the pod | `{}` | +| `securityContext` | Security context for the container | `{}` | +| `volumes` | Volumes for the pod | `[{ name: ecdsa-key, secret: { secretName: YOURSECREWITHWALLET, items: [{ key: ecdsa-private-key, path: ecdsa_key.json }] } }, { name: aethos, persistentVolumeClaim: { claimName: aethos } }]` | + +### Service Account Parameters + +| Parameter | Description | Default | +|------------------------------|--------------------------------------|---------------| +| `serviceAccount.create` | Specifies whether a service account should be created | `false` | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | +| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `aethos` | + +### VM Pod Scrape Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `vmPodScrape.enabled` | Enable or disable VM Pod Scraping | `true` | + +## Example + +To deploy the chart with custom values, create a `values.yaml` file: + +```yaml +replicaCount: 2 + +service: + type: LoadBalancer + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 8080 + +ingress: + enabled: true + host: myapp.example.com + +node: + image: + repository: my-registry/my-node + tag: stable + resources: + limits: + cpu: 2 + memory: 2Gi + requests: + cpu: 1 + memory: 1Gi +``` + +Then install the chart using the Helm CLI: + +```sh +helm repo add p2p-avs https://p2p-org.github.io/avs-helm-charts/ +helm upgrade -i aethos-release p2p-avs/aethos -f values.holesky.yaml +``` + +## License + +This Helm chart is licensed under the MIT License. See the LICENSE file for more information. diff --git a/charts/aethos/example/README.md b/charts/aethos/example/README.md new file mode 100644 index 0000000..1de8c10 --- /dev/null +++ b/charts/aethos/example/README.md @@ -0,0 +1,3 @@ +## Generate keys + +For generate keys read this doc https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation diff --git a/charts/aethos/example/wallet-secret.yaml b/charts/aethos/example/wallet-secret.yaml new file mode 100644 index 0000000..bcfac10 --- /dev/null +++ b/charts/aethos/example/wallet-secret.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +stringData: + + ecdsa-private-key: | + + { + "address": "sadflkasmdflkamsldfas;df", + "crypto": { + "cipher": "aes-128-ctr", + "ciphertext": "as;dmflaskmdflasmdlfkmalsdf", + "cipherparams": { + "iv": "lakmdslfkmalsdmflkasdmfl" + }, + "kdf": "scrypt", + "kdfparams": { + "dklen": 123, + "n": 123123, + "p": 12, + "r": 823, + "salt": "daslkfmklasdmfklmasdlkfmlakdsf" + }, + "mac": "alsdkmflkamsdlfkmasldfmlaksdmlf" + }, + "id": "alsdfmlkasmdlfkmasldf", + "version": 3 + } + + ecdsa-private-key-password: anlNASLdnfaljksdnLANSDlnalsdkjnASLKJDNlwnqlo21n3lkASLDndalsd +kind: Secret +metadata: + name: YOURSECREWITHWALLET +type: Opaque diff --git a/charts/aethos/templates/_helpers.tpl b/charts/aethos/templates/_helpers.tpl new file mode 100644 index 0000000..cc3580a --- /dev/null +++ b/charts/aethos/templates/_helpers.tpl @@ -0,0 +1,68 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "aethos.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "aethos.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "aethos.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "aethos.labels" -}} +helm.sh/chart: {{ include "aethos.chart" . }} +{{ include "aethos.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{- define "aethosRegister.labels" -}} +helm.sh/chart: {{ include "aethos.chart" . }} +{{ include "aethosRegister.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aethos.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aethos.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aethosRegister.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aethos.name" . }}-register +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/aethos/templates/configmap.tpl b/charts/aethos/templates/configmap.tpl new file mode 100644 index 0000000..47edc3a --- /dev/null +++ b/charts/aethos/templates/configmap.tpl @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "aethos.fullname" . }}-config + labels: + {{- include "aethos.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +data: + {{- if .Values.configs }} + {{- toYaml .Values.configs | nindent 2 }} + {{- end }} diff --git a/charts/aethos/templates/ingress.tpl b/charts/aethos/templates/ingress.tpl new file mode 100644 index 0000000..896702a --- /dev/null +++ b/charts/aethos/templates/ingress.tpl @@ -0,0 +1,28 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "aethos.fullname" . }} + labels: + {{- include "aethos.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: nginx + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "aethos.fullname" . }} + port: + name: node-api +{{- end }} diff --git a/charts/aethos/templates/pvc.tpl b/charts/aethos/templates/pvc.tpl new file mode 100644 index 0000000..4cee309 --- /dev/null +++ b/charts/aethos/templates/pvc.tpl @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "aethos.fullname" . }} + {{- with .Values.pvc.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "aethos.labels" . | nindent 4 }} + {{- with .Values.pvc.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + storageClassName: oci-bv + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.pvc.size }} diff --git a/charts/aethos/templates/service.tpl b/charts/aethos/templates/service.tpl new file mode 100644 index 0000000..17b2d37 --- /dev/null +++ b/charts/aethos/templates/service.tpl @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aethos.fullname" . }} + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "aethos.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + type: {{ .Values.service.type }} + ports: + {{- range .Values.service.ports }} + - name: {{ .name }} + port: {{ .port }} + protocol: {{ .protocol }} + targetPort: {{ .targetPort }} + {{- end }} + selector: + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + app: {{ include "aethos.fullname" . }} diff --git a/charts/aethos/templates/serviceaccount.tpl b/charts/aethos/templates/serviceaccount.tpl new file mode 100644 index 0000000..431386d --- /dev/null +++ b/charts/aethos/templates/serviceaccount.tpl @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "aethos.fullname" . }} + labels: + {{- include "aethos.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} diff --git a/charts/aethos/templates/statefulset.tpl b/charts/aethos/templates/statefulset.tpl new file mode 100644 index 0000000..26954f7 --- /dev/null +++ b/charts/aethos/templates/statefulset.tpl @@ -0,0 +1,96 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "aethos.fullname" . }} + labels: + {{- include "aethos.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "aethos.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: {{ include "aethos.fullname" . }} + {{- include "aethos.selectorLabels" . | nindent 8 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 8 }} + {{- end}} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "aethos.fullname" .) }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: node + {{- with .Values.node.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.node.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.node.image.repository }}:{{ .Values.node.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.node.image.pullPolicy }} + ports: + {{- toYaml $.Values.node.ports | nindent 10 }} + {{- if .Values.lifecycleHooks }} + lifecycle: + {{- toYaml .Values.node.lifecycleHooks | nindent 12 }} + {{- end }} + {{- if .Values.node.livenessProbe }} + livenessProbe: + {{- toYaml .Values.node.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.node.readinessProbe }} + readinessProbe: + {{- toYaml .Values.node.readinessProbe | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.node.resources | nindent 12 }} + volumeMounts: + {{- with .Values.node.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + - name: config + mountPath: /app/config/operator.yaml + subPath: operator.yaml + env: + {{- toYaml .Values.node.env | nindent 12 }} + volumes: + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: config + configMap: + name: {{ include "aethos.fullname" . }}-config + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/aethos/templates/vmPodScrape.tpl b/charts/aethos/templates/vmPodScrape.tpl new file mode 100644 index 0000000..b6a19a6 --- /dev/null +++ b/charts/aethos/templates/vmPodScrape.tpl @@ -0,0 +1,16 @@ +{{- if .Values.vmPodScrape.enabled -}} +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMPodScrape +metadata: + name: {{ include "aethos.fullname" . }} +spec: + selector: + matchLabels: + {{- include "aethos.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + podMetricsEndpoints: + - port: metrics + scheme: http +{{- end }} diff --git a/charts/aethos/values.holesky.yaml b/charts/aethos/values.holesky.yaml new file mode 100644 index 0000000..1469565 --- /dev/null +++ b/charts/aethos/values.holesky.yaml @@ -0,0 +1,53 @@ +node: + volumeMounts: + - name: ecdsa-key + mountPath: /app/operator_keys/ecdsa_key.json + subPath: ecdsa_key.json + readOnly: true + - name: aethos + mountPath: /app/data/ + env: + - name: AETHOS_SIGNING_PRIVATE_KEY_STORE_PATH + value: "/app/operator_keys/ecdsa_key.json" + - name: OPERATOR_ID + value: $YOU_OPERATOR_ID ## Fill your operator ID + - name: AETHOS_SIGNING_PRIVATE_KEY_PASSWORD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET + key: ecdsa-private-key-password + - name: NODE_TASK_SERVER_HOST_AND_PORT_TO_BROADCAST + value: 127.0.0.1:9010 ## Your External IP address for access to aethos node + - name: ETH_RPC_URL + value: https://lb.drpc.org/ogrpc?network=holesky + +serviceAccount: + create: false + name: aethos + +volumes: + - name: ecdsa-key + secret: + secretName: YOURSECREWITHWALLET + items: + - key: ecdsa-private-key + path: ecdsa_key.json + - name: aethos + persistentVolumeClaim: + claimName: aethos +configs: + ## Need double check after changes + operator.yaml: | + + environment: production + avs_service_manager_address: 0xdE93E0dA148e1919bb7f33cd8847F96e45791210 + avs_directory_address: 0x055733000064333CaDDbC92763c58BF0192fFeBf + node_eigen_api_server_host_and_port: 0.0.0.0:8080 + eigen_metrics_ip_port_address: 0.0.0.0:9090 + node_task_server_host_and_port: 0.0.0.0:9010 + aggregator_server_ip_port_address: holesky.task.aethos.network:50051 + # db path + db_path: /app/data/ + + # enable log colors + enable_log_color: true diff --git a/charts/aethos/values.mainnet.yaml b/charts/aethos/values.mainnet.yaml new file mode 100644 index 0000000..ee62a2c --- /dev/null +++ b/charts/aethos/values.mainnet.yaml @@ -0,0 +1,52 @@ +node: + volumeMounts: + - name: ecdsa-key + mountPath: /app/operator_keys/ecdsa_key.json + subPath: ecdsa_key.json + readOnly: true + - name: aethos + mountPath: /app/data/ + env: + - name: AETHOS_SIGNING_PRIVATE_KEY_STORE_PATH + value: "/app/operator_keys/ecdsa_key.json" + - name: OPERATOR_ID + value: $YOU_OPERATOR_ID ## Fill your operator ID + - name: AETHOS_SIGNING_PRIVATE_KEY_PASSWORD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET + key: ecdsa-private-key-password + - name: NODE_TASK_SERVER_HOST_AND_PORT_TO_BROADCAST + value: 127.0.0.1:9010 ## Your External IP address for access to aethos node + - name: ETH_RPC_URL + value: https://lb.drpc.org/ogrpc?network=ethereum ## Your eth rpc url +serviceAccount: + create: false + name: aethos + +volumes: + - name: ecdsa-key + secret: + secretName: YOURSECREWITHWALLET + items: + - key: ecdsa-private-key + path: ecdsa_key.json + - name: aethos + persistentVolumeClaim: + claimName: aethos +configs: + ## Need double check after changes + operator.yaml: | + + environment: production + avs_service_manager_address: 0xdE93E0dA148e1919bb7f33cd8847F96e45791210 + avs_directory_address: 0x055733000064333CaDDbC92763c58BF0192fFeBf + node_eigen_api_server_host_and_port: 0.0.0.0:8080 + eigen_metrics_ip_port_address: 0.0.0.0:9090 + node_task_server_host_and_port: 0.0.0.0:9010 + aggregator_server_ip_port_address: holesky.task.aethos.network:50051 + # db path + db_path: /app/data/ + + # enable log colors + enable_log_color: true diff --git a/charts/aethos/values.schema.json b/charts/aethos/values.schema.json new file mode 100644 index 0000000..27d60de --- /dev/null +++ b/charts/aethos/values.schema.json @@ -0,0 +1,261 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "affinity": { + "properties": {}, + "type": "object" + }, + "configs": { + "properties": { + "operator.yaml": { + "type": "string" + } + }, + "type": "object" + }, + "fullnameOverride": { + "type": "string" + }, + "imagePullSecrets": { + "type": "array" + }, + "ingress": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "host": { + "type": "string" + } + }, + "type": "object" + }, + "labels": { + "properties": {}, + "type": "object" + }, + "nameOverride": { + "type": "string" + }, + "node": { + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array" + }, + "env": { + "type": "array" + }, + "image": { + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "ports": { + "items": { + "properties": { + "containerPort": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "protocol": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "readinessProbe": { + "properties": { + "failureThreshold": { + "type": "integer" + }, + "httpGet": { + "properties": { + "path": { + "type": "string" + }, + "port": { + "type": "integer" + } + }, + "type": "object" + }, + "initialDelaySeconds": { + "type": "integer" + }, + "periodSeconds": { + "type": "integer" + }, + "successThreshold": { + "type": "integer" + }, + "timeoutSeconds": { + "type": "integer" + } + }, + "type": "object" + }, + "resources": { + "properties": { + "limits": { + "properties": { + "cpu": { + "type": "integer" + }, + "memory": { + "type": "string" + } + }, + "type": "object" + }, + "requests": { + "properties": { + "cpu": { + "type": "integer" + }, + "memory": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "volumeMounts": { + "type": "array" + } + }, + "type": "object" + }, + "nodeSelector": { + "properties": {}, + "type": "object" + }, + "pvc": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "labesl": { + "properties": {}, + "type": "object" + }, + "size": { + "type": "string" + }, + "storageClassName": { + "type": "string" + } + }, + "type": "object" + }, + "replicaCount": { + "type": "integer" + }, + "service": { + "properties": { + "annotations": { + "properties": { + "oci-network-load-balancer.oraclecloud.com/security-list-management-mode": { + "type": "string" + }, + "oci.oraclecloud.com/load-balancer-type": { + "type": "string" + }, + "oci.oraclecloud.com/security-rule-management-mode": { + "type": "string" + } + }, + "type": "object" + }, + "ports": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "targetPort": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "serviceAccount": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "create": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "podAnnotations": { + "properties": {}, + "type": "object" + }, + "podSecurityContext": { + "properties": {}, + "type": "object" + }, + "securityContext": { + "properties": {}, + "type": "object" + } + }, + "type": "object" + }, + "tolerations": { + "type": "array" + }, + "vmPodScrape": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "volumes": { + "type": "array" + } + }, + "type": "object" +} diff --git a/charts/aethos/values.yaml b/charts/aethos/values.yaml new file mode 100644 index 0000000..ebec3cb --- /dev/null +++ b/charts/aethos/values.yaml @@ -0,0 +1,130 @@ +nameOverride: "" +fullnameOverride: "" + +replicaCount: 1 +labels: {} + +pvc: + size: 10Gi + storageClassName: "" + labesl: {} + annotations: {} +imagePullSecrets: [] +service: + annotations: {} + type: LoadBalancer + ports: + - name: node-api + port: 8080 + protocol: TCP + targetPort: 8080 + - name: metrics + port: 9090 + protocol: TCP + targetPort: 9090 + - name: task-server + port: 9010 + protocol: TCP + targetPort: 9010 +ingress: + annotations: {} + enabled: false + host: example.com + +configs: + operator.yaml: | + + environment: production + eth_rpc_url: https://lb.drpc.org/ogrpc?network=ethereum + avs_service_manager_address: 0xdE93E0dA148e1919bb7f33cd8847F96e45791210 + node_eigen_api_server_host_and_port: 0.0.0.0:8080 + eigen_metrics_ip_port_address: 0.0.0.0:9090 + node_task_server_host_and_port: 0.0.0.0:9010 + aggregator_server_ip_port_address: holesky.task.aethos.network:50051 + +# register: +# image: +# repository: ghcr.io/aethosnetwork/operator +# pullPolicy: Always +# tag: "latest" +# args: +# - --config=/app/config/operator.yaml +# - register-operator-with-avs + +node: + volumeMounts: [] + image: + repository: ghcr.io/aethosnetwork/operator + pullPolicy: Always + tag: "latest" + ports: + - name: node-api + containerPort: 8080 + protocol: TCP + - name: metrics + containerPort: 9090 + protocol: TCP + - name: task-server + containerPort: 9010 + protocol: TCP + resources: + limits: + cpu: 4 + memory: 16Gi + requests: + cpu: 2 + memory: 8Gi + env: [] + args: + - start + - --config=/app/config/operator.yaml + readinessProbe: + httpGet: + path: /metrics + port: 9090 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 + successThreshold: 1 + # livenessProbe: + # httpGet: + # path: /metrics + # port: 9090 + # initialDelaySeconds: 1200 + # periodSeconds: 30 + # timeoutSeconds: 3 + # failureThreshold: 2 + # successThreshold: 1 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + + podAnnotations: {} + + podSecurityContext: {} + # fsGroup: 2000 + + securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + # +volumes: [] +vmPodScrape: + enabled: true diff --git a/charts/arpa/.gitignore b/charts/arpa/.gitignore new file mode 100644 index 0000000..4a424df --- /dev/null +++ b/charts/arpa/.gitignore @@ -0,0 +1 @@ +secret.yaml diff --git a/charts/arpa/Chart.yaml b/charts/arpa/Chart.yaml new file mode 100644 index 0000000..ac33fa9 --- /dev/null +++ b/charts/arpa/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +appVersion: 0.1.0 +description: A Helm chart for Kubernetes +name: arpa +type: application +version: 0.1.0 +maintainers: + - name: xom4ek + email: aleksei.lazarev@p2p.org diff --git a/charts/arpa/README.md b/charts/arpa/README.md new file mode 100644 index 0000000..183eb38 --- /dev/null +++ b/charts/arpa/README.md @@ -0,0 +1,179 @@ +# Helm Chart for ARPA Network Node + +## Placeholders + +The following placeholders need to be replaced with your actual values: + +- `YOURSECREWITHWALLET_PLACEHOLDER`: Replace with the name of your Kubernetes secret containing the wallet. +- `YOUREXTERNALADDRESS_PLACEHOLDER`: Replace with your external address. +- `YOURADDRESS_PLACEHOLDER`: Replace with your specific address for log stream names. + +## Overview + +This Helm chart deploys an ARPA Network Node with the following features: +- Configurable replica count +- Customizable persistent volume claims +- LoadBalancer service with multiple ports +- Configurable node and cloudwatch settings +- Support for secret-based configuration + +## Installation + +To install the chart with the release name `arpa`: + +```sh +helm repo add p2p-avs https://p2p-org.github.io/avs-helm-charts/ +helm upgrade -i arpa p2p-avs/arpa -f values.$NETWORK.yaml +``` + +## Configuration + +The following table lists the configurable parameters of the ARPA Network Node chart and their default values. + +| Parameter | Description | Default | +| --- | --- | --- | +| `nameOverride` | Override the name of the chart | `""` | +| `fullnameOverride` | Override the full name of the chart | `""` | +| `replicaCount` | Number of replicas for the deployment | `1` | +| `labels` | Additional labels for the deployment | `{}` | +| `pvc.size` | Persistent Volume Claim size | `10Gi` | +| `pvc.storageClassName` | Storage class for the PVC | `default` | +| `pvc.annotations` | Annotations for the PVC | `{}` | +| `pvc.labels` | Labels for the PVC | `{}` | +| `imagePullSecrets` | Secrets for pulling images | `[]` | +| `service.annotations` | Annotations for the service | See values.yaml | +| `service.type` | Service type | `LoadBalancer` | +| `service.ports` | Ports for the service | See values.yaml | +| `ingress.annotations` | Annotations for the ingress | `{}` | +| `ingress.enabled` | Enable ingress | `false` | +| `ingress.host` | Host for the ingress | `example.com` | +| `configs` | Custom configurations | See values.yaml | +| `cloudwatch.enabled` | Enable CloudWatch | `false` | +| `cloudwatch.image.repository` | CloudWatch image repository | `ghcr.io/arpa-network/node-client` | +| `cloudwatch.image.pullPolicy` | Image pull policy for CloudWatch | `Always` | +| `cloudwatch.image.tag` | Image tag for CloudWatch | `latest` | +| `cloudwatch.resources` | Resources for CloudWatch container | `{}` | +| `cloudwatch.env` | Environment variables for CloudWatch | `[]` | +| `cloudwatch.command` | Command for CloudWatch container | See values.yaml | +| `cloudwatch.args` | Arguments for CloudWatch container | `[]` | +| `node.image.repository` | Node image repository | `ghcr.io/arpa-network/node-client` | +| `node.image.pullPolicy` | Image pull policy for Node | `Always` | +| `node.image.tag` | Image tag for Node | `latest` | +| `node.resources` | Resources for Node container | See values.yaml | +| `node.env` | Environment variables for Node | `[]` | +| `node.command` | Command for Node container | `/app/node-client` | +| `node.args` | Arguments for Node container | `-c=/app/config/operator.yaml` | +| `node.volumeMounts` | Volume mounts for Node container | See values.yaml | +| `nodeSelector` | Node selector for the deployment | `{}` | +| `tolerations` | Tolerations for the deployment | `[]` | +| `affinity` | Affinity for the deployment | `{}` | +| `serviceAccount.create` | Create service account | `true` | +| `serviceAccount.annotations` | Annotations for the service account | `{}` | +| `serviceAccount.name` | Name of the service account | `""` | +| `podAnnotations` | Annotations for the pod | `{}` | +| `podSecurityContext` | Security context for the pod | `{}` | +| `securityContext` | Security context for the container | `{}` | +| `volumes` | Volumes for the pod | `[]` | +| `vmPodScrape.enabled` | Enable VM pod scrape | `false` | + +## Custom Configurations + +Custom configurations can be provided in the `configs` section. For example: + +```yaml +configs: + operator.yaml: | + node_committer_rpc_endpoint: "0.0.0.0:50061" + node_advertised_committer_rpc_endpoint: "143.47.183.136:50061" + node_management_rpc_endpoint: "0.0.0.0:50091" + node_management_rpc_token: "c3VwZXJzZWNyZXR0b2tlbg==" + node_statistics_http_endpoint: "0.0.0.0:50081" + provider_endpoint: "wss://lb.drpc.org/ogws?network=holesky" + chain_id: 17000 + is_eigenlayer: true + controller_address: "0xbF53802722985b01c30C0C065738BcC776Ef5A69" + controller_relayer_address: "0x4A88f1d5D3ab086763df5967D7560148006eE8b4" + adapter_address: "0x88ab708e6A43eF8c7ab6a3f24B1F90f52a1682b8" + data_path: "/app/data/data1.sqlite" + logger: + context_logging: false + log_file_path: /app/data/log/1/ + rolling_file_size: 10 gb + account: + keystore: + password: env + path: /app/operator_keys/ecdsa_key.json + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: PreGrouping + interval_millis: 0 + use_jitter: true + - l_type: PostCommitGrouping + interval_millis: 1000 + use_jitter: true + - l_type: PostGrouping + interval_millis: 1000 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + time_limits: + block_time: 12 + dkg_timeout_duration: 40 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + dkg_wait_for_phase_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false +``` + +## Updating the Chart + +To update the chart with new values, run: + +```sh +helm repo add p2p-avs https://p2p-org.github.io/avs-helm-charts/ +helm upgrade -i arpa p2p-avs/arpa --set key1=value1,key2=value2 +``` + +## Uninstallation + +To uninstall/delete the `arpa` deployment: + +```sh +helm delete arpa +``` + +This command removes all the Kubernetes components associated with the chart and deletes the release. + +## Notes + +- Ensure that your Kubernetes cluster has enough resources for the requested CPU and memory. +- Configure your cloud provider's load balancer to handle the specified annotations if using a `LoadBalancer` service type. +- Review and update security context and volume mounts as necessary for your environment. diff --git a/charts/arpa/example/README.md b/charts/arpa/example/README.md new file mode 100644 index 0000000..1de8c10 --- /dev/null +++ b/charts/arpa/example/README.md @@ -0,0 +1,3 @@ +## Generate keys + +For generate keys read this doc https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation diff --git a/charts/arpa/example/wallet-secret.yaml b/charts/arpa/example/wallet-secret.yaml new file mode 100644 index 0000000..715ddef --- /dev/null +++ b/charts/arpa/example/wallet-secret.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +stringData: + + ecdsa-private-key: | + + { + "address": "sadflkasmdflkamsldfas;df", + "crypto": { + "cipher": "aes-128-ctr", + "ciphertext": "as;dmflaskmdflasmdlfkmalsdf", + "cipherparams": { + "iv": "lakmdslfkmalsdmflkasdmfl" + }, + "kdf": "scrypt", + "kdfparams": { + "dklen": 123, + "n": 123123, + "p": 12, + "r": 823, + "salt": "daslkfmklasdmfklmasdlkfmlakdsf" + }, + "mac": "alsdkmflkamsdlfkmasldfmlaksdmlf" + }, + "id": "alsdfmlkasmdlfkmasldf", + "version": 3 + } + + ecdsa-private-key-password: anlNASLdnfaljksdnLANSDlnalsdkjnASLKJDNlwnqlo21n3lkASLDndalsd +kind: Secret +metadata: + name: YOUROPERATORADDRESS +type: Opaque diff --git a/charts/arpa/templates/_helpers.tpl b/charts/arpa/templates/_helpers.tpl new file mode 100644 index 0000000..34cd131 --- /dev/null +++ b/charts/arpa/templates/_helpers.tpl @@ -0,0 +1,68 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "arpa.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "arpa.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "arpa.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "arpa.labels" -}} +helm.sh/chart: {{ include "arpa.chart" . }} +{{ include "arpa.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{- define "arpaRegister.labels" -}} +helm.sh/chart: {{ include "arpa.chart" . }} +{{ include "arpaRegister.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "arpa.selectorLabels" -}} +app.kubernetes.io/name: {{ include "arpa.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "arpaRegister.selectorLabels" -}} +app.kubernetes.io/name: {{ include "arpa.name" . }}-register +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/arpa/templates/configmap.tpl b/charts/arpa/templates/configmap.tpl new file mode 100644 index 0000000..dda9544 --- /dev/null +++ b/charts/arpa/templates/configmap.tpl @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "arpa.fullname" . }}-config + labels: + {{- include "arpa.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +data: + {{- if .Values.configs }} + {{- toYaml .Values.configs | nindent 2 }} + {{- end }} diff --git a/charts/arpa/templates/ingress.tpl b/charts/arpa/templates/ingress.tpl new file mode 100644 index 0000000..237554b --- /dev/null +++ b/charts/arpa/templates/ingress.tpl @@ -0,0 +1,28 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "arpa.fullname" . }} + labels: + {{- include "arpa.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: nginx + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "arpa.fullname" . }} + port: + name: node-api +{{- end }} diff --git a/charts/arpa/templates/pvc.tpl b/charts/arpa/templates/pvc.tpl new file mode 100644 index 0000000..f3de763 --- /dev/null +++ b/charts/arpa/templates/pvc.tpl @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "arpa.fullname" . }} + {{- with .Values.pvc.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "arpa.labels" . | nindent 4 }} + {{- with .Values.pvc.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + storageClassName: {{ .Values.pvc.storageClassName}} + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.pvc.size }} diff --git a/charts/arpa/templates/service.tpl b/charts/arpa/templates/service.tpl new file mode 100644 index 0000000..cb97412 --- /dev/null +++ b/charts/arpa/templates/service.tpl @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "arpa.fullname" . }} + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "arpa.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + type: {{ .Values.service.type }} + ports: + {{- range .Values.service.ports }} + - name: {{ .name }} + port: {{ .port }} + protocol: {{ .protocol }} + targetPort: {{ .targetPort }} + {{- end }} + selector: + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + app: {{ include "arpa.fullname" . }} diff --git a/charts/arpa/templates/serviceaccount.tpl b/charts/arpa/templates/serviceaccount.tpl new file mode 100644 index 0000000..9a4a276 --- /dev/null +++ b/charts/arpa/templates/serviceaccount.tpl @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "arpa.fullname" . }} + labels: + {{- include "arpa.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} diff --git a/charts/arpa/templates/statefulset.tpl b/charts/arpa/templates/statefulset.tpl new file mode 100644 index 0000000..8b0595a --- /dev/null +++ b/charts/arpa/templates/statefulset.tpl @@ -0,0 +1,128 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "arpa.fullname" . }} + labels: + {{- include "arpa.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "arpa.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: {{ include "arpa.fullname" . }} + {{- include "arpa.selectorLabels" . | nindent 8 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 8 }} + {{- end}} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "arpa.fullname" .) }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: node + {{- with .Values.node.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.node.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.node.image.repository }}:{{ .Values.node.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.node.image.pullPolicy }} + ports: + {{- toYaml $.Values.node.ports | nindent 10 }} + {{- if .Values.lifecycleHooks }} + lifecycle: + {{- toYaml .Values.node.lifecycleHooks | nindent 12 }} + {{- end }} + {{- if .Values.node.livenessProbe }} + livenessProbe: + {{- toYaml .Values.node.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.node.readinessProbe }} + readinessProbe: + {{- toYaml .Values.node.readinessProbe | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.node.resources | nindent 12 }} + volumeMounts: + {{- with .Values.node.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + env: + {{- toYaml .Values.node.env | nindent 12 }} + {{- if .Values.cloudwatch.enabled }} + - name: cloudwatch + {{- with .Values.cloudwatch.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.cloudwatch.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.cloudwatch.image.repository }}:{{ .Values.cloudwatch.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.cloudwatch.image.pullPolicy }} + {{- if .Values.lifecycleHooks }} + lifecycle: + {{- toYaml .Values.cloudwatch.lifecycleHooks | nindent 12 }} + {{- end }} + {{- if .Values.cloudwatch.livenessProbe }} + livenessProbe: + {{- toYaml .Values.cloudwatch.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.cloudwatch.readinessProbe }} + readinessProbe: + {{- toYaml .Values.cloudwatch.readinessProbe | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.cloudwatch.resources | nindent 12 }} + volumeMounts: + {{- with .Values.cloudwatch.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + env: + {{- toYaml .Values.cloudwatch.env | nindent 12 }} + {{- end }} + volumes: + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: config + configMap: + name: {{ include "arpa.fullname" . }}-config + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/arpa/templates/vmPodScrape.tpl b/charts/arpa/templates/vmPodScrape.tpl new file mode 100644 index 0000000..519be0c --- /dev/null +++ b/charts/arpa/templates/vmPodScrape.tpl @@ -0,0 +1,16 @@ +{{- if .Values.vmPodScrape.enabled -}} +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMPodScrape +metadata: + name: {{ include "arpa.fullname" . }} +spec: + selector: + matchLabels: + {{- include "arpa.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + podMetricsEndpoints: + - port: metrics + scheme: http +{{- end }} diff --git a/charts/arpa/values.holesky.yaml b/charts/arpa/values.holesky.yaml new file mode 100644 index 0000000..6b4da5e --- /dev/null +++ b/charts/arpa/values.holesky.yaml @@ -0,0 +1,196 @@ +node: + volumeMounts: + - name: ecdsa-key + mountPath: /app/operator_keys/ecdsa_key.json + subPath: ecdsa_key.json + readOnly: true + - name: arpa + mountPath: /app/data/ + - name: config + mountPath: /app/config/operator.yaml + subPath: operator.yaml + env: + - name: ARPA_NODE_ACCOUNT_KEYSTORE_PASSWORD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET + key: ecdsa-private-key-password + +cloudwatch: + enabled: true + volumeMounts: + - name: arpa + mountPath: /app/data/ + - name: config + mountPath: /opt/aws/amazon-cloudwatch-agent/bin/default_linux_config.json + subPath: default_linux_config.json + command: + - /opt/aws/amazon-cloudwatch-agent/bin/start-amazon-cloudwatch-agent + args: [] + +serviceAccount: + create: false + name: arpa + +volumes: + - name: ecdsa-key + secret: + secretName: YOURSECREWITHWALLET + items: + - key: ecdsa-private-key + path: ecdsa_key.json + - name: arpa + persistentVolumeClaim: + claimName: arpa +configs: + + default_linux_config.json: | + + { + "agent": { + "run_as_user": "root", + "region": "us-east-1", + "mode": "onPremise" + }, + "logs": { + "logs_collected": { + "files": { + "collect_list": [ + { + "file_path": "/app/data/log/1/node.log", + "log_group_class": "STANDARD", + "log_group_name": "arpa-network-logs", + "log_stream_name": "YOURADDRESS", + "retention_in_days": -1 + }, + { + "file_path": "/app/data/log/1/node_err.log", + "log_group_class": "STANDARD", + "log_group_name": "arpa-network-logs", + "log_stream_name": "YOURADDRESS", + "retention_in_days": -1 + } + ] + } + } + } + } + + operator.yaml: | + + node_committer_rpc_endpoint: "0.0.0.0:50061" + node_advertised_committer_rpc_endpoint: "YOUREXTERNALADDRESS:50061" + node_management_rpc_endpoint: "0.0.0.0:50091" + node_management_rpc_token: "c3VwZXJzZWNyZXR0b2tlbg==" + node_statistics_http_endpoint: "0.0.0.0:50081" + provider_endpoint: "wss://lb.drpc.org/ogws?network=holesky" + chain_id: 17000 + is_eigenlayer: true + controller_address: "0xbF53802722985b01c30C0C065738BcC776Ef5A69" + controller_relayer_address: "0x4A88f1d5D3ab086763df5967D7560148006eE8b4" + adapter_address: "0x88ab708e6A43eF8c7ab6a3f24B1F90f52a1682b8" + data_path: "/app/data/data1.sqlite" + + logger: + context_logging: false + log_file_path: /app/data/log/1/ + rolling_file_size: 10 gb + + account: + keystore: + password: env + path: /app/operator_keys/ecdsa_key.json + + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: PreGrouping + interval_millis: 0 + use_jitter: true + - l_type: PostCommitGrouping + interval_millis: 1000 + use_jitter: true + - l_type: PostGrouping + interval_millis: 1000 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + + time_limits: + block_time: 12 + dkg_timeout_duration: 40 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + dkg_wait_for_phase_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false + + relayed_chains: + - chain_id: 17069 + description: "Redstone Garnet" + provider_endpoint: "wss://rpc.garnetchain.com" + controller_oracle_address: "0x901105C43C7f0e421b33c9D1DaA25f54076F6563" + adapter_address: "0x323488A9Ad7463081F109468B4E50a5084e91295" + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + time_limits: + block_time: 2 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false diff --git a/charts/arpa/values.mainnet.yaml b/charts/arpa/values.mainnet.yaml new file mode 100644 index 0000000..a90ad0c --- /dev/null +++ b/charts/arpa/values.mainnet.yaml @@ -0,0 +1,233 @@ +replicaCount: 0 + +node: + volumeMounts: + - name: ecdsa-key + mountPath: /app/operator_keys/ecdsa_key.json + subPath: ecdsa_key.json + readOnly: true + - name: arpa + mountPath: /app/data/ + env: + - name: ARPA_NODE_ACCOUNT_KEYSTORE_PASSWORD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET_PLACEHOLDER + key: ecdsa-private-key-password +serviceAccount: + create: false + name: arpa + +volumes: + - name: ecdsa-key + secret: + secretName: YOURSECREWITHWALLET_PLACEHOLDER + items: + - key: ecdsa-private-key + path: ecdsa_key.json + - name: arpa + persistentVolumeClaim: + claimName: arpa +configs: + operator.yaml: | + + node_committer_rpc_endpoint: "0.0.0.0:50061" + node_advertised_committer_rpc_endpoint: "YOUREXTERNALADDRES_PLACEHOLDER:50061" + node_management_rpc_endpoint: "0.0.0.0:50091" + node_management_rpc_token: "c3VwZXJzZWNyZXR0b2tlbg==" + node_statistics_http_endpoint: "0.0.0.0:50081" + provider_endpoint: "wss://lb.drpc.org/ogws?network=ethereum" ## Your wss rpc endpoint + chain_id: 1 + is_eigenlayer: true + controller_address: "0xbd0620c34796a4d978aecad929a3ad3d6b86280b" + adapter_address: "0xbd57b868bb3374faa88722d2ee7ba3023c744e05" + controller_relayer_address: "0x2c73da7786311C8011480fB590B6AEF79f425D18" + data_path: "/app/data/data1.sqlite" + + logger: + context_logging: false + log_file_path: /app/data/log/1/ + rolling_file_size: 10 gb + + account: + keystore: + password: env + path: /app/operator_keys/ecdsa_key.json + + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: PreGrouping + interval_millis: 0 + use_jitter: true + - l_type: PostCommitGrouping + interval_millis: 10000 + use_jitter: true + - l_type: PostGrouping + interval_millis: 10000 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 10000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + + time_limits: + block_time: 12 + dkg_timeout_duration: 40 + randomness_task_exclusive_window: 10 + listener_interval_millis: 10000 + dkg_wait_for_phase_interval_millis: 10000 + provider_polling_interval_millis: 10000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false + + relayed_chains: + - chain_id: 10 + description: "OP" + provider_endpoint: "wss://lb.drpc.org/ogws?network=optimism" ## Your wss rpc endpoint + controller_oracle_address: "0xa6ca2cF29616f7b4c0EBc872b3a06a5e72A11E6D" + adapter_address: "0xDEc250D24ECf7475De51C51371e4F73b204c5b84" + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + time_limits: + block_time: 2 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false + - chain_id: 8453 + description: "Base" + provider_endpoint: "wss://lb.drpc.org/ogws?network=base" ## Your wss rpc endpoint + controller_oracle_address: "0xf1CCf9Bfd94079Ced6FC151030896F2a295b5Fdf" + adapter_address: "0xD1A1c06a23cD4F5755ae3e90b8dCc1608C40A58B" + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + time_limits: + block_time: 2 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false + - chain_id: 690 + description: "RedStone" + provider_endpoint: "wss://rpc.redstonechain.com" + controller_oracle_address: "0xBd57b868BB3374faA88722D2ee7bA3023C744e05" + adapter_address: "0x88a10c3aCCC51B52F8C6c95D1c614aB6065C7163" + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + time_limits: + block_time: 2 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false diff --git a/charts/arpa/values.schema.json b/charts/arpa/values.schema.json new file mode 100644 index 0000000..a50a168 --- /dev/null +++ b/charts/arpa/values.schema.json @@ -0,0 +1,305 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "affinity": { + "properties": {}, + "type": "object" + }, + "cloudwatch": { + "properties": { + "args": { + "type": "array" + }, + "command": { + "items": { + "type": "string" + }, + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "env": { + "type": "array" + }, + "image": { + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "resources": { + "properties": {}, + "type": "object" + }, + "volumeMounts": { + "type": "array" + } + }, + "type": "object" + }, + "configs": { + "properties": { + "operator.yaml": { + "type": "string" + } + }, + "type": "object" + }, + "fullnameOverride": { + "type": "string" + }, + "imagePullSecrets": { + "type": "array" + }, + "ingress": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "host": { + "type": "string" + } + }, + "type": "object" + }, + "labels": { + "properties": {}, + "type": "object" + }, + "nameOverride": { + "type": "string" + }, + "node": { + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array" + }, + "command": { + "items": { + "type": "string" + }, + "type": "array" + }, + "env": { + "type": "array" + }, + "image": { + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "ports": { + "items": { + "properties": { + "containerPort": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "protocol": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "readinessProbe": { + "properties": { + "failureThreshold": { + "type": "integer" + }, + "initialDelaySeconds": { + "type": "integer" + }, + "periodSeconds": { + "type": "integer" + }, + "successThreshold": { + "type": "integer" + }, + "tcpSocket": { + "properties": { + "port": { + "type": "integer" + } + }, + "type": "object" + }, + "timeoutSeconds": { + "type": "integer" + } + }, + "type": "object" + }, + "resources": { + "properties": { + "limits": { + "properties": { + "cpu": { + "type": "integer" + }, + "memory": { + "type": "string" + } + }, + "type": "object" + }, + "requests": { + "properties": { + "cpu": { + "type": "integer" + }, + "memory": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "volumeMounts": { + "type": "array" + } + }, + "type": "object" + }, + "nodeSelector": { + "properties": {}, + "type": "object" + }, + "pvc": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "labels": { + "properties": {}, + "type": "object" + }, + "size": { + "type": "string" + }, + "storageClassName": { + "type": "string" + } + }, + "type": "object" + }, + "replicaCount": { + "type": "integer" + }, + "service": { + "properties": { + "annotations": { + "properties": { + "oci-network-load-balancer.oraclecloud.com/security-list-management-mode": { + "type": "string" + }, + "oci.oraclecloud.com/load-balancer-type": { + "type": "string" + }, + "oci.oraclecloud.com/security-rule-management-mode": { + "type": "string" + } + }, + "type": "object" + }, + "ports": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "targetPort": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "serviceAccount": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "create": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "podAnnotations": { + "properties": {}, + "type": "object" + }, + "podSecurityContext": { + "properties": {}, + "type": "object" + }, + "securityContext": { + "properties": {}, + "type": "object" + } + }, + "type": "object" + }, + "tolerations": { + "type": "array" + }, + "vmPodScrape": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "volumes": { + "type": "array" + } + }, + "type": "object" +} diff --git a/charts/arpa/values.yaml b/charts/arpa/values.yaml new file mode 100644 index 0000000..c1a49d4 --- /dev/null +++ b/charts/arpa/values.yaml @@ -0,0 +1,267 @@ +nameOverride: "" +fullnameOverride: "" + +replicaCount: 1 +labels: {} + +pvc: + size: 10Gi + storageClassName: default + annotations: {} + labels: {} + +imagePullSecrets: [] +service: + annotations: + oci.oraclecloud.com/load-balancer-type: "nlb" + oci-network-load-balancer.oraclecloud.com/security-list-management-mode: "All" + oci.oraclecloud.com/security-rule-management-mode: "SL-All" + type: LoadBalancer + ports: + - name: node-api + port: 50061 + protocol: TCP + targetPort: 50061 + - name: metrics + port: 50081 + protocol: TCP + targetPort: 50081 +ingress: + annotations: {} + enabled: false + host: example.com + +configs: + operator.yaml: | + + node_committer_rpc_endpoint: "0.0.0.0:50061" + node_advertised_committer_rpc_endpoint: "143.47.183.136:50061" + node_management_rpc_endpoint: "0.0.0.0:50091" + node_management_rpc_token: "c3VwZXJzZWNyZXR0b2tlbg==" + node_statistics_http_endpoint: "0.0.0.0:50081" + provider_endpoint: "wss://lb.drpc.org/ogws?network=holesky" + chain_id: 17000 + is_eigenlayer: true + controller_address: "0xbF53802722985b01c30C0C065738BcC776Ef5A69" + controller_relayer_address: "0x4A88f1d5D3ab086763df5967D7560148006eE8b4" + adapter_address: "0x88ab708e6A43eF8c7ab6a3f24B1F90f52a1682b8" + data_path: "/app/data/data1.sqlite" + + logger: + context_logging: false + log_file_path: /app/data/log/1/ + rolling_file_size: 10 gb + + account: + keystore: + password: env + path: /app/operator_keys/ecdsa_key.json + + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: PreGrouping + interval_millis: 0 + use_jitter: true + - l_type: PostCommitGrouping + interval_millis: 1000 + use_jitter: true + - l_type: PostGrouping + interval_millis: 1000 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + + time_limits: + block_time: 12 + dkg_timeout_duration: 40 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + dkg_wait_for_phase_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false + + relayed_chains: + - chain_id: 17069 + description: "Redstone Garnet" + provider_endpoint: "wss://rpc.garnetchain.com" + controller_oracle_address: "0x901105C43C7f0e421b33c9D1DaA25f54076F6563" + adapter_address: "0x323488A9Ad7463081F109468B4E50a5084e91295" + listeners: + - l_type: Block + interval_millis: 0 + use_jitter: true + - l_type: NewRandomnessTask + interval_millis: 0 + use_jitter: true + - l_type: ReadyToHandleRandomnessTask + interval_millis: 1000 + use_jitter: true + - l_type: RandomnessSignatureAggregation + interval_millis: 2000 + use_jitter: false + time_limits: + block_time: 2 + randomness_task_exclusive_window: 10 + listener_interval_millis: 1000 + provider_polling_interval_millis: 1000 + provider_reset_descriptor: + interval_millis: 5000 + max_attempts: 17280 + use_jitter: false + contract_transaction_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 3 + use_jitter: true + contract_view_retry_descriptor: + base: 2 + factor: 500 + max_attempts: 5 + use_jitter: true + commit_partial_signature_retry_descriptor: + base: 2 + factor: 1000 + max_attempts: 5 + use_jitter: false + + +# register: +# image: +# repository: ghcr.io/arpa-network/node-client +# pullPolicy: Always +# tag: "eigenlayer" +# args: +# - --config=/app/config/operator.yaml +# - register-operator-with-avs + +cloudwatch: + enabled: false + volumeMounts: [] + image: + repository: ghcr.io/arpa-network/node-client + pullPolicy: Always + tag: "latest" + resources: {} + env: [] + command: + - /opt/aws/amazon-cloudwatch-agent/bin/start-amazon-cloudwatch-agent + args: [] + # readinessProbe: + # tcpSocket: + # port: 50081 + # initialDelaySeconds: 10 + # periodSeconds: 5 + # timeoutSeconds: 1 + # successThreshold: 1 + # failureThreshold: 3 + # livenessProbe: + # httpGet: + # path: /metrics + # port: 50081 + # initialDelaySeconds: 1200 + # periodSeconds: 30 + # timeoutSeconds: 3 + # failureThreshold: 2 + # successThreshold: 1 + +node: + volumeMounts: [] + image: + repository: ghcr.io/arpa-network/node-client + pullPolicy: Always + tag: "latest" + ports: + - name: node-api + containerPort: 50061 + protocol: TCP + - name: metrics + containerPort: 50081 + protocol: TCP + resources: + limits: + cpu: 4 + memory: 4Gi + requests: + cpu: 2 + memory: 4Gi + env: [] + command: + - /app/node-client + args: + - -c=/app/config/operator.yaml + readinessProbe: + tcpSocket: + port: 50081 + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 3 + # livenessProbe: + # httpGet: + # path: /metrics + # port: 50081 + # initialDelaySeconds: 1200 + # periodSeconds: 30 + # timeoutSeconds: 3 + # failureThreshold: 2 + # successThreshold: 1 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + + podAnnotations: {} + + podSecurityContext: {} + # fsGroup: 2000 + + securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + # +volumes: [] +vmPodScrape: + enabled: false diff --git a/charts/lagrange/.gitignore b/charts/lagrange/.gitignore new file mode 100644 index 0000000..4a424df --- /dev/null +++ b/charts/lagrange/.gitignore @@ -0,0 +1 @@ +secret.yaml diff --git a/charts/lagrange/Chart.yaml b/charts/lagrange/Chart.yaml new file mode 100644 index 0000000..714ed03 --- /dev/null +++ b/charts/lagrange/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +appVersion: 0.1.0 +description: A Helm chart for Kubernetes +name: lagrange +type: application +version: 0.1.0 +maintainers: + - name: xom4ek + email: aleksei.lazarev@p2p.org diff --git a/charts/lagrange/README.md b/charts/lagrange/README.md new file mode 100644 index 0000000..6c36c0f --- /dev/null +++ b/charts/lagrange/README.md @@ -0,0 +1,148 @@ +# README + +This Helm chart is used to deploy a Kubernetes application. The following documentation provides details on the configurable values and their default settings. + +## Table of Contents + +- [README](#readme) + - [Table of Contents](#table-of-contents) + - [Parameters](#parameters) + - [Global Parameters](#global-parameters) + - [Service Parameters](#service-parameters) + - [Ingress Parameters](#ingress-parameters) + - [Configuration Parameters](#configuration-parameters) + - [Register Container Parameters](#register-container-parameters) + - [Node Container Parameters](#node-container-parameters) + - [Pod Parameters](#pod-parameters) + - [Service Account Parameters](#service-account-parameters) + - [VM Pod Scrape Parameters](#vm-pod-scrape-parameters) + - [Example](#example) + +## Parameters + +### Global Parameters + +| Parameter | Description | Default | +|--------------------|--------------------------------------|---------| +| `nameOverride` | Optionally override the name of the chart | `""` | +| `fullnameOverride` | Optionally override the full name of the chart | `""` | +| `replicaCount` | Number of replicas to deploy | `1` | +| `labels` | Additional labels to add to resources | `{}` | +| `imagePullSecrets` | Secrets for pulling images from a private registry | `[]` | + +### Service Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `service.annotations` | Annotations to add to the service | `{}` | +| `service.type` | Type of service to create | `ClusterIP` | +| `service.ports` | List of ports to expose from the service | `[]` | + +### Ingress Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `ingress.annotations` | Annotations to add to the ingress | `{}` | +| `ingress.enabled` | Enable or disable the ingress | `false` | +| `ingress.host` | Hostname for the ingress | `example.com` | + +### Configuration Parameters + +| Parameter | Description | Default | +|-----------------------------|--------------------------------------|---------------| +| `configs.operator.yaml` | Configuration file for the operator | `# some configs via file` | + +### Register Container Parameters + +| Parameter | Description | Default | +|-----------------------------------|--------------------------------------|---------------| +| `register.enabled` | Enable or disable the register container | `true` | +| `register.image.repository` | Image registry for the register container | `` | +| `register.image.pullPolicy` | Image pull policy for the register container | `Always` | +| `register.image.tag` | Image tag for the register container | `` | +| `register.args` | Arguments to pass to the register container | `["--config=/app/config/operator.yaml", "register-operator-with-avs"]` | + +### Node Container Parameters + +| Parameter | Description | Default | +|-----------------------------------|--------------------------------------|---------------| +| `node.volumeMounts` | Volume mounts for the node container | `[]` | +| `node.image.repository` | Image registry for the node container | `` | +| `node.image.pullPolicy` | Image pull policy for the node container | `Always` | +| `node.image.tag` | Image tag for the node container | `` | +| `node.ports` | Ports to expose from the node container | `[]` | +| `node.resources` | Resource limits and requests for the node container | `{}` | +| `node.env` | Environment variables for the node container | `[]` | +| `node.args` | Arguments to pass to the node container | `[]` | +| `node.readinessProbe` | Readiness probe for the node container | `{}` | +| `node.livenessProbe` | Liveness probe for the node container | `{}` | + +### Pod Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `nodeSelector` | Node selector for the pod | `{}` | +| `tolerations` | Tolerations for the pod | `[]` | +| `affinity` | Affinity rules for the pod | `{}` | +| `podAnnotations` | Annotations to add to the pod | `{}` | +| `podSecurityContext` | Security context for the pod | `{}` | +| `securityContext` | Security context for the container | `{}` | +| `volumes` | Volumes for the pod | `[]` | + +### Service Account Parameters + +| Parameter | Description | Default | +|------------------------------|--------------------------------------|---------------| +| `serviceAccount.create` | Specifies whether a service account should be created | `true` | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | +| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `""` | + +### VM Pod Scrape Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `vmPodScrape.enabled` | Enable or disable VM Pod Scraping | `true` | + +## Example + +To deploy the chart with custom values, create a `values.yaml` file: + +```yaml +replicaCount: 2 + +service: + type: LoadBalancer + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 8080 + +ingress: + enabled: true + host: myapp.example.com + +register: + image: + repository: my-registry/my-register + tag: latest + +node: + image: + repository: my-registry/my-node + tag: stable + resources: + limits: + cpu: 2 + memory: 2Gi + requests: + cpu: 1 + memory: 1Gi +``` + +Then install the chart using the Helm CLI: + +```sh +helm repo add p2p-avs https://p2p-org.github.io/avs-helm-charts/ +helm upgrade -i lagrange-release p2p-avs/lagrange -f values.holesky.yaml +``` diff --git a/charts/lagrange/templates/_helpers.tpl b/charts/lagrange/templates/_helpers.tpl new file mode 100644 index 0000000..755c4e5 --- /dev/null +++ b/charts/lagrange/templates/_helpers.tpl @@ -0,0 +1,68 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "lagrange.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "lagrange.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "lagrange.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "lagrange.labels" -}} +helm.sh/chart: {{ include "lagrange.chart" . }} +{{ include "lagrange.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{- define "lagrangeRegister.labels" -}} +helm.sh/chart: {{ include "lagrange.chart" . }} +{{ include "lagrangeRegister.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "lagrange.selectorLabels" -}} +app.kubernetes.io/name: {{ include "lagrange.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "lagrangeRegister.selectorLabels" -}} +app.kubernetes.io/name: {{ include "lagrange.name" . }}-register +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/lagrange/templates/configmap.tpl b/charts/lagrange/templates/configmap.tpl new file mode 100644 index 0000000..567eacc --- /dev/null +++ b/charts/lagrange/templates/configmap.tpl @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "lagrange.fullname" . }}-config + labels: + {{- include "lagrange.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +data: + {{- if .Values.configs }} + {{- toYaml .Values.configs | nindent 2 }} + {{- end }} diff --git a/charts/lagrange/templates/ingress.tpl b/charts/lagrange/templates/ingress.tpl new file mode 100644 index 0000000..683f000 --- /dev/null +++ b/charts/lagrange/templates/ingress.tpl @@ -0,0 +1,31 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "lagrange.fullname" . }} + labels: + {{- include "lagrange.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + annotations: + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.annotations }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + ingressClassName: nginx + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "lagrange.fullname" . }} + port: + name: node-api +{{- end }} diff --git a/charts/lagrange/templates/pvc.tpl b/charts/lagrange/templates/pvc.tpl new file mode 100644 index 0000000..540b2c3 --- /dev/null +++ b/charts/lagrange/templates/pvc.tpl @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "lagrange.fullname" . }} + {{- with .Values.pvc.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "lagrange.labels" . | nindent 4 }} + {{- with .Values.pvc.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + storageClassName: {{ .Values.pvc.storageClassName }} + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.pvc.size }} diff --git a/charts/lagrange/templates/register.tpl b/charts/lagrange/templates/register.tpl new file mode 100644 index 0000000..9de8437 --- /dev/null +++ b/charts/lagrange/templates/register.tpl @@ -0,0 +1,42 @@ +{{- if .Values.register.enabled }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "lagrange.fullname" . }}-register-job + labels: + {{- include "lagrangeRegister.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + annotations: + "helm.sh/hook": "post-install" + {{- with .Values.annotations }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + template: + metadata: + labels: + {{- include "lagrangeRegister.labels" . | nindent 8 }} + spec: + containers: + - name: register + image: "{{ .Values.register.image.repository }}:{{ .Values.register.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.register.image.pullPolicy }} + args: + {{- toYaml .Values.register.args | nindent 12 }} + env: + {{- toYaml .Values.register.env | nindent 12 }} + volumeMounts: + {{- toYaml .Values.register.volumeMounts | nindent 12 }} + - name: config + mountPath: /app/config/operator.yaml + subPath: operator.yaml + restartPolicy: Never + volumes: + {{- toYaml .Values.volumes | nindent 8 }} + - name: config + configMap: + name: {{ include "lagrange.fullname" . }}-config + backoffLimit: 2 +{{- end }} diff --git a/charts/lagrange/templates/service.tpl b/charts/lagrange/templates/service.tpl new file mode 100644 index 0000000..a78d13b --- /dev/null +++ b/charts/lagrange/templates/service.tpl @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "lagrange.fullname" . }} + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "lagrange.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + type: {{ .Values.service.type }} + ports: + {{- range .Values.service.ports }} + - name: {{ .name }} + port: {{ .port }} + protocol: {{ .protocol }} + targetPort: {{ .targetPort }} + {{- end }} + selector: + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + app: {{ include "lagrange.fullname" . }} diff --git a/charts/lagrange/templates/serviceaccount.tpl b/charts/lagrange/templates/serviceaccount.tpl new file mode 100644 index 0000000..9de577f --- /dev/null +++ b/charts/lagrange/templates/serviceaccount.tpl @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "lagrange.fullname" . }} + labels: + {{- include "lagrange.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} diff --git a/charts/lagrange/templates/statefulset.tpl b/charts/lagrange/templates/statefulset.tpl new file mode 100644 index 0000000..ecc1d05 --- /dev/null +++ b/charts/lagrange/templates/statefulset.tpl @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "lagrange.fullname" . }} + labels: + {{- include "lagrange.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + annotations: + {{- with .Values.annotations }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "lagrange.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + template: + metadata: + annotations: + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.annotations }} + {{- toYaml . | nindent 8 }} + {{- end}} + labels: + app: {{ include "lagrange.fullname" . }} + {{- include "lagrange.selectorLabels" . | nindent 8 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 8 }} + {{- end}} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "lagrange.fullname" .) }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: node + {{- with .Values.node.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.node.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.node.image.repository }}:{{ .Values.node.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.node.image.pullPolicy }} + ports: + {{- toYaml $.Values.node.ports | nindent 10 }} + {{- if .Values.lifecycleHooks }} + lifecycle: + {{- toYaml .Values.node.lifecycleHooks | nindent 12 }} + {{- end }} + {{- if .Values.node.livenessProbe }} + livenessProbe: + {{- toYaml .Values.node.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.node.readinessProbe }} + readinessProbe: + {{- toYaml .Values.node.readinessProbe | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.node.resources | nindent 12 }} + volumeMounts: + {{- with .Values.node.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + - name: config + mountPath: /app/config + env: + {{- toYaml .Values.node.env | nindent 12 }} + volumes: + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: config + configMap: + name: {{ include "lagrange.fullname" . }}-config + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/lagrange/templates/vmPodScrape.tpl b/charts/lagrange/templates/vmPodScrape.tpl new file mode 100644 index 0000000..6e17f04 --- /dev/null +++ b/charts/lagrange/templates/vmPodScrape.tpl @@ -0,0 +1,16 @@ +{{- if .Values.vmPodScrape.enabled -}} +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMPodScrape +metadata: + name: {{ include "lagrange.fullname" . }} +spec: + selector: + matchLabels: + {{- include "lagrange.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + podMetricsEndpoints: + - port: metrics + scheme: http +{{- end }} diff --git a/charts/lagrange/values.holesky.yaml b/charts/lagrange/values.holesky.yaml new file mode 100644 index 0000000..5ac3d2c --- /dev/null +++ b/charts/lagrange/values.holesky.yaml @@ -0,0 +1,131 @@ +configs: + # Configuration file for the operator + worker-conf.toml: | + + [worker] + data_dir = "/app/data/tmp" + instance_type = "medium" + + [avs] + gateway_url = "ws://gateway.STAGE-distributed-query.STAGE.distributed-query.io:80" + issuer = "lagrange" + worker_id = "YOURWORKERID" + + [public_params] + dir = "/app/data/zkmr_params" + url = "https://distributed-query-public-" + + [public_params.preprocessing_params] + file = "STORAGE_PREPROCESS/PUBLIC_PARAMS" + + [public_params.query2_params] + file = "STORAGE_QUERY2/public_params" + + [public_params.groth16_assets] + circuit_file = "STORAGE_QUERY2/groth16_assets/circuit.bin" + r1cs_file = "STORAGE_QUERY2/groth16_assets/r1cs.bin" + pk_file = "STORAGE_QUERY2/groth16_assets/pk.bin" + + [prometheus] + port = 9090 + # some configs via file + +node: + # Configuration for the node container image + image: + repository: lagrangelabs/worker + pullPolicy: Always + tag: "holesky" + + # Ports to expose from the node container + ports: + - name: metrics + containerPort: 9090 + protocol: TCP + + # Resource limits and requests for the node container + resources: {} + # Example resource limits and requests + # limits: + # cpu: 4 + # memory: 4Gi + # requests: + # cpu: 2 + # memory: 4Gi + + # Environment variables for the node container + volumeMounts: + - name: ecdsa-key + mountPath: /app/operator_keys/ecdsa_key.json + subPath: ecdsa_key.json + readOnly: true + - name: lagrange + mountPath: /app/data/ + env: + - name: RPC_URL + value: https://rpc-url + - name: NETWORK + value: holesky + - name: AVS__LAGR_KEYSTORE + value: /app/operator_keys/ecdsa_key.json + - name: AVS__LAGR_PWD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET + key: ecdsa-private-key-password + - name: RUST_LOG + value: "info,worker=debug" + - name: PUBLIC_PARAMS__SKIP_STORE + value: false + + + # Arguments to pass to the node container + args: + # Example arguments for the node container + - --config=/app/config/worker-conf.toml + + + +# Node selector for the pod +nodeSelector: {} + +# Tolerations for the pod +tolerations: [] + +# Affinity rules for the pod +affinity: {} + +serviceAccount: + # Specifies whether a service account should be created + create: true + + # Annotations to add to the service account + annotations: {} + + # The name of the service account to use. If not set and create is true, a name is generated using the fullname template + name: "" + +# Annotations to add to the pod +podAnnotations: {} + +# Security context for the pod +podSecurityContext: {} + # Example security context + # fsGroup: 2000 + +# Security context for the container +securityContext: {} + # Example security context + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# Volumes for the pod +volumes: [] + +vmPodScrape: + # Enable or disable VM Pod Scraping + enabled: true diff --git a/charts/lagrange/values.schema.json b/charts/lagrange/values.schema.json new file mode 100644 index 0000000..90be201 --- /dev/null +++ b/charts/lagrange/values.schema.json @@ -0,0 +1,216 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "affinity": { + "properties": {}, + "type": "object" + }, + "configs": { + "properties": { + "operator.yaml": { + "type": "string" + } + }, + "type": "object" + }, + "fullnameOverride": { + "type": "string" + }, + "imagePullSecrets": { + "type": "array" + }, + "ingress": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "host": { + "type": "string" + } + }, + "type": "object" + }, + "labels": { + "properties": {}, + "type": "object" + }, + "nameOverride": { + "type": "string" + }, + "node": { + "properties": { + "args": { + "type": "array" + }, + "env": { + "type": "array" + }, + "image": { + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "livenessProbe": { + "properties": {}, + "type": "object" + }, + "ports": { + "type": "array" + }, + "readinessProbe": { + "properties": {}, + "type": "object" + }, + "resources": { + "properties": {}, + "type": "object" + }, + "volumeMounts": { + "type": "array" + } + }, + "type": "object" + }, + "nodeSelector": { + "properties": {}, + "type": "object" + }, + "podAnnotations": { + "properties": {}, + "type": "object" + }, + "podSecurityContext": { + "properties": {}, + "type": "object" + }, + "pvc": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "labels": { + "properties": {}, + "type": "object" + }, + "size": { + "type": "string" + }, + "storageClassName": { + "type": "string" + } + }, + "type": "object" + }, + "register": { + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "image": { + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "replicaCount": { + "type": "integer" + }, + "securityContext": { + "properties": {}, + "type": "object" + }, + "service": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "ports": { + "items": { + "properties": { + "name": { + "type": "string" + }, + "port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "targetPort": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "serviceAccount": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "create": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "tolerations": { + "type": "array" + }, + "vmPodScrape": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "volumes": { + "type": "array" + } + }, + "type": "object" +} diff --git a/charts/lagrange/values.yaml b/charts/lagrange/values.yaml new file mode 100644 index 0000000..fa268c1 --- /dev/null +++ b/charts/lagrange/values.yaml @@ -0,0 +1,212 @@ +# Optionally override the name of the chart +nameOverride: "" + +# Optionally override the full name of the chart +fullnameOverride: "" + +# Number of replicas to deploy +replicaCount: 1 + +# Additional labels to add to resources +labels: {} + +# Secrets for pulling images from a private registry +imagePullSecrets: [] + +service: + # Annotations to add to the service + annotations: {} + + # Type of service to create + type: ClusterIP + + # List of ports to expose from the service + ports: + # Example port configuration for metrics service + - name: metrics + port: 9090 + protocol: TCP + targetPort: 9090 + + # Example port configuration for node-api service + # - name: node-api + # port: 9010 + # protocol: TCP + # targetPort: 9010 + +ingress: + # Annotations to add to the ingress + annotations: {} + + # Enable or disable the ingress + enabled: false + + # Hostname for the ingress + host: example.com + +configs: + # Configuration file for the operator + operator.yaml: | + + [worker] + data_dir = "/app/data" + instance_type = "medium" + + [avs] + gateway_url = "ws://gateway..io:80" + issuer = "lagrange" + worker_id = "p2p-worker" + + [public_params] + dir = "/zkmr_params" + url = "https://distributed-.amazonaws.com" + + [public_params.preprocessing_params] + file = "STORAGE_PREPROCESS/PUBLIC_PARAMS" + + [public_params.query2_params] + file = "STORAGE_QUERY2/public_params" + + [public_params.groth16_assets] + circuit_file = "STORAGE_QUERY2/groth16_assets/circuit.bin" + r1cs_file = "STORAGE_QUERY2/groth16_assets/r1cs.bin" + pk_file = "STORAGE_QUERY2/groth16_assets/pk.bin" + + [prometheus] + port = 9090 + +register: + # Enable or disable the register container + enabled: false + + # Configuration for the register container image + image: + # Image registry for the register container + repository: + + # Image pull policy for the register container + pullPolicy: Always + + # Image tag for the register container + tag: "" + + # Arguments to pass to the register container + args: + - --config=/app/config/worker-conf.toml +pvc: + size: 30Gi + storageClassName: default + annotations: {} + labels: {} +node: + # Volume mounts for the node container + volumeMounts: [] + + # Configuration for the node container image + image: + # Image registry for the node container + repository: + + # Image pull policy for the node container + pullPolicy: Always + + # Image tag for the node container + tag: "" + + # Ports to expose from the node container + ports: [] + # Example port configuration for node-api container + # - name: node-api + # containerPort: 9010 + # protocol: TCP + # Example port configuration for metrics container + # - name: metrics + # containerPort: 9091 + # protocol: TCP + + # Resource limits and requests for the node container + resources: {} + # Example resource limits and requests + # limits: + # cpu: 4 + # memory: 4Gi + # requests: + # cpu: 2 + # memory: 4Gi + + # Environment variables for the node container + env: [] + + # Arguments to pass to the node container + args: [] + # Example arguments for the node container + # - --config=/app/config/operator.yaml + # - start-operator + + # Readiness probe for the node container + readinessProbe: {} + # Example HTTP readiness probe + # httpGet: + # path: /metrics + # port: 9091 + # initialDelaySeconds: 30 + # periodSeconds: 10 + # timeoutSeconds: 3 + # failureThreshold: 3 + # successThreshold: 1 + + # Liveness probe for the node container + livenessProbe: {} + # Example HTTP liveness probe + # httpGet: + # path: /metrics + # port: 9090 + # initialDelaySeconds: 1200 + # periodSeconds: 30 + # timeoutSeconds: 3 + # failureThreshold: 2 + # successThreshold: 1 + +# Node selector for the pod +nodeSelector: {} + +# Tolerations for the pod +tolerations: [] + +# Affinity rules for the pod +affinity: {} + +serviceAccount: + # Specifies whether a service account should be created + create: true + + # Annotations to add to the service account + annotations: {} + + # The name of the service account to use. If not set and create is true, a name is generated using the fullname template + name: "" + +# Annotations to add to the pod +podAnnotations: {} + +# Security context for the pod +podSecurityContext: {} + # Example security context + # fsGroup: 2000 + +# Security context for the container +securityContext: {} + # Example security context + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# Volumes for the pod +volumes: [] + +vmPodScrape: + # Enable or disable VM Pod Scraping + enabled: true diff --git a/charts/openoracle/.gitignore b/charts/openoracle/.gitignore new file mode 100644 index 0000000..4a424df --- /dev/null +++ b/charts/openoracle/.gitignore @@ -0,0 +1 @@ +secret.yaml diff --git a/charts/openoracle/Chart.yaml b/charts/openoracle/Chart.yaml new file mode 100644 index 0000000..426f499 --- /dev/null +++ b/charts/openoracle/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +appVersion: 0.1.0 +description: A Helm chart for Kubernetes +name: openoracle +type: application +version: 0.1.0 +maintainers: + - name: xom4ek + email: aleksei.lazarev@p2p.org diff --git a/charts/openoracle/example/README.md b/charts/openoracle/example/README.md new file mode 100644 index 0000000..1de8c10 --- /dev/null +++ b/charts/openoracle/example/README.md @@ -0,0 +1,3 @@ +## Generate keys + +For generate keys read this doc https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation diff --git a/charts/openoracle/example/wallet-secret.yaml b/charts/openoracle/example/wallet-secret.yaml new file mode 100644 index 0000000..1cd3bd8 --- /dev/null +++ b/charts/openoracle/example/wallet-secret.yaml @@ -0,0 +1,55 @@ +apiVersion: v1 +stringData: + bls-private-key: | + + { + "pubKey": "alskdfmlaksmdfklamsdlfmalsdfmlasdf", + "crypto": { + "cipher": "aes-128-ctr", + "ciphertext": "asfdkalskdmflkasmdlfkmasdlkf", + "cipherparams": { + "iv": "asldkfmaklsmdflmasldkf" + }, + "kdf": "scrypt", + "kdfparams": { + "dklen": 12, + "n": 213123, + "p": 132, + "r": 12, + "salt": "asdlfmaslkdfmlaksmdflkamsdlfmasdf" + }, + "mac": "alskfnmlasnflkasnlfdnasldnflasndlfnasldfnla" + } + } + bls-private-key-hex: 'laksdnflkasldfnalknfpwjerpijqwpremawfmdsf' + bls-private-key-password: 'lkansdlfknaskldnfklasndfknasdpfmapfsm' + + ecdsa-private-key: | + + { + "address": "sadflkasmdflkamsldfas;df", + "crypto": { + "cipher": "aes-128-ctr", + "ciphertext": "as;dmflaskmdflasmdlfkmalsdf", + "cipherparams": { + "iv": "lakmdslfkmalsdmflkasdmfl" + }, + "kdf": "scrypt", + "kdfparams": { + "dklen": 123, + "n": 123123, + "p": 12, + "r": 823, + "salt": "daslkfmklasdmfklmasdlkfmlakdsf" + }, + "mac": "alsdkmflkamsdlfkmasldfmlaksdmlf" + }, + "id": "alsdfmlkasmdlfkmasldf", + "version": 3 + } + + ecdsa-private-key-password: anlNASLdnfaljksdnLANSDlnalsdkjnASLKJDNlwnqlo21n3lkASLDndalsd +kind: Secret +metadata: + name: YOUROPERATORADDRESS +type: Opaque diff --git a/charts/openoracle/templates/_helpers.tpl b/charts/openoracle/templates/_helpers.tpl new file mode 100644 index 0000000..375ac0a --- /dev/null +++ b/charts/openoracle/templates/_helpers.tpl @@ -0,0 +1,68 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "openoracle.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "openoracle.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "openoracle.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "openoracle.labels" -}} +helm.sh/chart: {{ include "openoracle.chart" . }} +{{ include "openoracle.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{- define "openoracleRegister.labels" -}} +helm.sh/chart: {{ include "openoracle.chart" . }} +{{ include "openoracleRegister.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openoracle.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openoracle.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "openoracleRegister.selectorLabels" -}} +app.kubernetes.io/name: {{ include "openoracle.name" . }}-register +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/openoracle/templates/configmap.tpl b/charts/openoracle/templates/configmap.tpl new file mode 100644 index 0000000..eaa4094 --- /dev/null +++ b/charts/openoracle/templates/configmap.tpl @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "openoracle.fullname" . }}-config + labels: + {{- include "openoracle.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +data: + {{- if .Values.configs }} + {{- toYaml .Values.configs | nindent 2 }} + {{- end }} diff --git a/charts/openoracle/templates/ingress.tpl b/charts/openoracle/templates/ingress.tpl new file mode 100644 index 0000000..397e7f8 --- /dev/null +++ b/charts/openoracle/templates/ingress.tpl @@ -0,0 +1,28 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "openoracle.fullname" . }} + labels: + {{- include "openoracle.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: nginx + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include "openoracle.fullname" . }} + port: + name: node-api +{{- end }} diff --git a/charts/openoracle/templates/register.tpl b/charts/openoracle/templates/register.tpl new file mode 100644 index 0000000..0b52ef6 --- /dev/null +++ b/charts/openoracle/templates/register.tpl @@ -0,0 +1,34 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "openoracle.fullname" . }}-register-job + labels: + {{- include "openoracleRegister.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": "post-install" +spec: + template: + metadata: + labels: + {{- include "openoracleRegister.labels" . | nindent 8 }} + spec: + containers: + - name: register + image: "{{ .Values.register.image.repository }}:{{ .Values.register.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.register.image.pullPolicy }} + args: + {{- toYaml .Values.register.args | nindent 12 }} + env: + {{- toYaml .Values.node.env | nindent 12 }} + volumeMounts: + {{- toYaml .Values.node.volumeMounts | nindent 12 }} + - name: config + mountPath: /app/config/operator.yaml + subPath: operator.yaml + restartPolicy: Never + volumes: + {{- toYaml .Values.volumes | nindent 8 }} + - name: config + configMap: + name: {{ include "openoracle.fullname" . }}-config + backoffLimit: 2 diff --git a/charts/openoracle/templates/service.tpl b/charts/openoracle/templates/service.tpl new file mode 100644 index 0000000..de60b00 --- /dev/null +++ b/charts/openoracle/templates/service.tpl @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "openoracle.fullname" . }} + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "openoracle.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + type: {{ .Values.service.type }} + ports: + {{- range .Values.service.ports }} + - name: {{ .name }} + port: {{ .port }} + protocol: {{ .protocol }} + targetPort: {{ .targetPort }} + {{- end }} + selector: + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + app: {{ include "openoracle.fullname" . }} diff --git a/charts/openoracle/templates/serviceaccount.tpl b/charts/openoracle/templates/serviceaccount.tpl new file mode 100644 index 0000000..697ace8 --- /dev/null +++ b/charts/openoracle/templates/serviceaccount.tpl @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "openoracle.fullname" . }} + labels: + {{- include "openoracle.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} diff --git a/charts/openoracle/templates/statefulset.tpl b/charts/openoracle/templates/statefulset.tpl new file mode 100644 index 0000000..be7d99b --- /dev/null +++ b/charts/openoracle/templates/statefulset.tpl @@ -0,0 +1,96 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "openoracle.fullname" . }} + labels: + {{- include "openoracle.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "openoracle.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: {{ include "openoracle.fullname" . }} + {{- include "openoracle.selectorLabels" . | nindent 8 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 8 }} + {{- end}} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "openoracle.fullname" .) }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: node + {{- with .Values.node.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.node.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.node.image.repository }}:{{ .Values.node.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.node.image.pullPolicy }} + ports: + {{- toYaml $.Values.node.ports | nindent 10 }} + {{- if .Values.lifecycleHooks }} + lifecycle: + {{- toYaml .Values.node.lifecycleHooks | nindent 12 }} + {{- end }} + {{- if .Values.node.livenessProbe }} + livenessProbe: + {{- toYaml .Values.node.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.node.readinessProbe }} + readinessProbe: + {{- toYaml .Values.node.readinessProbe | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.node.resources | nindent 12 }} + volumeMounts: + {{- with .Values.node.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + - name: config + mountPath: /app/config/operator.yaml + subPath: operator.yaml + env: + {{- toYaml .Values.node.env | nindent 12 }} + volumes: + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: config + configMap: + name: {{ include "openoracle.fullname" . }}-config + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/openoracle/templates/vmPodScrape.tpl b/charts/openoracle/templates/vmPodScrape.tpl new file mode 100644 index 0000000..3fe8989 --- /dev/null +++ b/charts/openoracle/templates/vmPodScrape.tpl @@ -0,0 +1,16 @@ +{{- if .Values.vmPodScrape.enabled -}} +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMPodScrape +metadata: + name: {{ include "openoracle.fullname" . }} +spec: + selector: + matchLabels: + {{- include "openoracle.selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + podMetricsEndpoints: + - port: metrics + scheme: http +{{- end }} diff --git a/charts/openoracle/values.holesky.yaml b/charts/openoracle/values.holesky.yaml new file mode 100644 index 0000000..aa39ce1 --- /dev/null +++ b/charts/openoracle/values.holesky.yaml @@ -0,0 +1,84 @@ +node: + volumeMounts: + - name: bls-key + mountPath: /app/operator_keys/bls_key.json + subPath: bls_key.json + readOnly: true + - name: ecdsa-key + mountPath: /app/operator_keys/ecdsa_key.json + subPath: ecdsa_key.json + readOnly: true + env: + - name: BLS_PRIVATE_KEY_PATH + value: "/app/operator_keys/bls_key.json" + - name: ECDSA_PRIVATE_KEY_PATH + value: "/app/operator_keys/ecdsa_key.json" + - name: OPERATOR_ADDRESS + value: "YOUROPERATORADDRESS" + # - name: OPERATOR_ADDRESS + # valueFrom: + # secretKeyRef: + # name: YOURSECREWITHWALLET + # key: ecdsa-public-key + - name: OPERATOR_BLS_KEY_PASSWORD + valueFrom: + secretKeyRef: + name: YOURWALLETSECRET + key: bls-private-key-password + - name: OPERATOR_ECDSA_KEY_PASSWORD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET + key: ecdsa-private-key-password + - name: HTTP_RPC_URL + value: https://lb.drpc.org/ogrpc?network=holesky + - name: WS_RPC_URL + value: wss://lb.drpc.org/ogrpc?network=holesky + +serviceAccount: + create: true + name: openoracle + +volumes: + - name: bls-key + secret: + secretName: YOURSECREWITHWALLET + items: + - key: bls-private-key + path: bls_key.json + - name: ecdsa-key + secret: + secretName: YOURSECREWITHWALLET + items: + - key: ecdsa-private-key + path: ecdsa_key.json + +configs: + operator.yaml: | + + # this sets the logger level (true = info, false = debug) + production: true + + # EigenLayer Slasher contract address + + # This is the address of the slasher which is deployed in the anvil saved state + # The saved eigenlayer state is located in tests/anvil/eigenlayer-deployed-anvil-state.json + avs_registry_coordinator_address: 0xE0315CCaF46A736BFAB173670CBcC97bE65Eb414 + operator_state_retriever_address: 0x12ddeDbB47340e6702529197cB593204A4aFa318 + + # address which the aggregator listens on for operator signed messages + aggregator_server_ip_port_address: https://us-central1-openoracle-de73b.cloudfunctions.net/backend_apis/api/report_result + chain_name: eth + + # avs node spec compliance https://eigen.nethermind.io/docs/spec/intro + eigen_metrics_ip_port_address: 0.0.0.0:9091 + enable_metrics: true + node_api_ip_port_address: 0.0.0.0:9010 + enable_node_api: true + + # we need to register the operator on startup when running the docker compose file + # because unfortunately we cannot register the operator previously and save it in the anvil json file + # This is because anvil only dumps the state, and not the receipt tree, so when we restart anvil with + # the registered operator, it's blspubkey registering event with the compendium is not present anymore, + # and so the aggregator can't find it.... very annoying + register_operator_on_startup: true diff --git a/charts/openoracle/values.mainnet.yaml b/charts/openoracle/values.mainnet.yaml new file mode 100644 index 0000000..60cb47b --- /dev/null +++ b/charts/openoracle/values.mainnet.yaml @@ -0,0 +1,83 @@ +node: + volumeMounts: + - name: bls-key + mountPath: /app/operator_keys/bls_key.json + subPath: bls_key.json + readOnly: true + - name: ecdsa-key + mountPath: /app/operator_keys/ecdsa_key.json + subPath: ecdsa_key.json + readOnly: true + env: + - name: BLS_PRIVATE_KEY_PATH + value: "/app/operator_keys/bls_key.json" + - name: ECDSA_PRIVATE_KEY_PATH + value: "/app/operator_keys/ecdsa_key.json" + - name: OPERATOR_ADDRESS + value: "YOUROPERATORADDRES" + # - name: OPERATOR_ADDRESS + # valueFrom: + # secretKeyRef: + # name: YOURSECREWITHWALLET + # key: ecdsa-public-key + - name: OPERATOR_BLS_KEY_PASSWORD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET + key: bls-private-key-password + - name: OPERATOR_ECDSA_KEY_PASSWORD + valueFrom: + secretKeyRef: + name: YOURSECREWITHWALLET + key: ecdsa-private-key-password + - name: HTTP_RPC_URL + value: https://lb.drpc.org/ogrpc?network=ethereum + - name: WS_RPC_URL + value: wss://lb.drpc.org/ogrpc?network=holesky + +serviceAccount: + create: true + name: openoracle + +volumes: + - name: bls-key + secret: + secretName: YOURSECREWITHWALLET + items: + - key: bls-private-key + path: bls_key.json + - name: ecdsa-key + secret: + secretName: YOURSECREWITHWALLET + items: + - key: ecdsa-private-key + path: ecdsa_key.json + +configs: + operator.yaml: | + + production: true + + # EigenLayer Slasher contract address + + # This is the address of the slasher which is deployed in the anvil saved state + # The saved eigenlayer state is located in tests/anvil/eigenlayer-deployed-anvil-state.json + avs_registry_coordinator_address: 0x7dd7320044013f7f49B1b6D67aED10726fe6e62b + operator_state_retriever_address: 0x8b57BC00cF01841a78b09Fabe3C2D49A1303A060 + + # address which the aggregator listens on for operator signed messages + aggregator_server_ip_port_address: https://us-central1-openoracle-de73b.cloudfunctions.net/backend_apis/api/report_result + chain_name: ethmainnet + + # avs node spec compliance https://eigen.nethermind.io/docs/spec/intro + eigen_metrics_ip_port_address: 0.0.0.0:9091 + enable_metrics: true + node_api_ip_port_address: 0.0.0.0:9010 + enable_node_api: true + + # we need to register the operator on startup when running the docker compose file + # because unfortunately we cannot register the operator previously and save it in the anvil json file + # This is because anvil only dumps the state, and not the receipt tree, so when we restart anvil with + # the registered operator, it's blspubkey registering event with the compendium is not present anymore, + # and so the aggregator can't find it.... very annoying + register_operator_on_startup: true diff --git a/charts/openoracle/values.yaml b/charts/openoracle/values.yaml new file mode 100644 index 0000000..0055b05 --- /dev/null +++ b/charts/openoracle/values.yaml @@ -0,0 +1,137 @@ +nameOverride: "" +fullnameOverride: "" + +replicaCount: 1 +labels: {} + +imagePullSecrets: [] +service: + annotations: {} + type: ClusterIP + ports: + - name: node-api + port: 9010 + protocol: TCP + targetPort: 9010 + - name: metrics + port: 9091 + protocol: TCP + targetPort: 9091 +ingress: + annotations: {} + enabled: false + host: example.com + +configs: + operator.yaml: | + + # this sets the logger level (true = info, false = debug) + production: true + + # EigenLayer Slasher contract address + + # This is the address of the slasher which is deployed in the anvil saved state + # The saved eigenlayer state is located in tests/anvil/eigenlayer-deployed-anvil-state.json + avs_registry_coordinator_address: 0xE0315CCaF46A736BFAB173670CBcC97bE65Eb414 + operator_state_retriever_address: 0x12ddeDbB47340e6702529197cB593204A4aFa318 + + # address which the aggregator listens on for operator signed messages + aggregator_server_ip_port_address: https://us-central1-openoracle-de73b.cloudfunctions.net/backend_apis/api/report_result + chain_name: eth + + # avs node spec compliance https://eigen.nethermind.io/docs/spec/intro + eigen_metrics_ip_port_address: 0.0.0.0:9091 + enable_metrics: true + node_api_ip_port_address: 0.0.0.0:9010 + enable_node_api: true + + # we need to register the operator on startup when running the docker compose file + # because unfortunately we cannot register the operator previously and save it in the anvil json file + # This is because anvil only dumps the state, and not the receipt tree, so when we restart anvil with + # the registered operator, it's blspubkey registering event with the compendium is not present anymore, + # and so the aggregator can't find it.... very annoying + register_operator_on_startup: true + +register: + image: + repository: gcr.io/openoracle-de73b/operator + pullPolicy: Always + tag: "latest" + args: + - --config=/app/config/operator.yaml + - register-operator-with-avs + +node: + volumeMounts: [] + image: + repository: gcr.io/openoracle-de73b/operator + pullPolicy: Always + tag: "latest" + ports: + - name: node-api + containerPort: 9010 + protocol: TCP + - name: metrics + containerPort: 9091 + protocol: TCP + resources: + limits: + cpu: 4 + memory: 4Gi + requests: + cpu: 2 + memory: 4Gi + env: [] + args: + - --config=/app/config/operator.yaml + - start-operator + readinessProbe: + httpGet: + path: /metrics + port: 9091 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 + successThreshold: 1 + # livenessProbe: + # httpGet: + # path: /metrics + # port: 9090 + # initialDelaySeconds: 1200 + # periodSeconds: 30 + # timeoutSeconds: 3 + # failureThreshold: 2 + # successThreshold: 1 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + + podAnnotations: {} + + podSecurityContext: {} + # fsGroup: 2000 + + securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + # +volumes: [] +vmPodScrape: + enabled: true diff --git a/starters/avs/.gitignore b/starters/avs/.gitignore new file mode 100644 index 0000000..4a424df --- /dev/null +++ b/starters/avs/.gitignore @@ -0,0 +1 @@ +secret.yaml diff --git a/starters/avs/Chart.yaml b/starters/avs/Chart.yaml new file mode 100644 index 0000000..e125e27 --- /dev/null +++ b/starters/avs/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v2 +name: +description: +type: application +version: 1.0.0 +appVersion: "" +home: https://github.com/p2p-org/avs-helm-charts/ +icon: +maintainers: [] +sources: + - diff --git a/starters/avs/README.md b/starters/avs/README.md new file mode 100644 index 0000000..56c3c81 --- /dev/null +++ b/starters/avs/README.md @@ -0,0 +1,147 @@ +# README + +This Helm chart is used to deploy a Kubernetes application. The following documentation provides details on the configurable values and their default settings. + +## Table of Contents + +- [README](#readme) + - [Table of Contents](#table-of-contents) + - [Parameters](#parameters) + - [Global Parameters](#global-parameters) + - [Service Parameters](#service-parameters) + - [Ingress Parameters](#ingress-parameters) + - [Configuration Parameters](#configuration-parameters) + - [Register Container Parameters](#register-container-parameters) + - [Node Container Parameters](#node-container-parameters) + - [Pod Parameters](#pod-parameters) + - [Service Account Parameters](#service-account-parameters) + - [VM Pod Scrape Parameters](#vm-pod-scrape-parameters) + - [Example](#example) + +## Parameters + +### Global Parameters + +| Parameter | Description | Default | +|--------------------|--------------------------------------|---------| +| `nameOverride` | Optionally override the name of the chart | `""` | +| `fullnameOverride` | Optionally override the full name of the chart | `""` | +| `replicaCount` | Number of replicas to deploy | `1` | +| `labels` | Additional labels to add to resources | `{}` | +| `imagePullSecrets` | Secrets for pulling images from a private registry | `[]` | + +### Service Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `service.annotations` | Annotations to add to the service | `{}` | +| `service.type` | Type of service to create | `ClusterIP` | +| `service.ports` | List of ports to expose from the service | `[]` | + +### Ingress Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `ingress.annotations` | Annotations to add to the ingress | `{}` | +| `ingress.enabled` | Enable or disable the ingress | `false` | +| `ingress.host` | Hostname for the ingress | `example.com` | + +### Configuration Parameters + +| Parameter | Description | Default | +|-----------------------------|--------------------------------------|---------------| +| `configs.operator.yaml` | Configuration file for the operator | `# some configs via file` | + +### Register Container Parameters + +| Parameter | Description | Default | +|-----------------------------------|--------------------------------------|---------------| +| `register.enabled` | Enable or disable the register container | `true` | +| `register.image.repository` | Image registry for the register container | `` | +| `register.image.pullPolicy` | Image pull policy for the register container | `Always` | +| `register.image.tag` | Image tag for the register container | `` | +| `register.args` | Arguments to pass to the register container | `["--config=/app/config/operator.yaml", "register-operator-with-avs"]` | + +### Node Container Parameters + +| Parameter | Description | Default | +|-----------------------------------|--------------------------------------|---------------| +| `node.volumeMounts` | Volume mounts for the node container | `[]` | +| `node.image.repository` | Image registry for the node container | `` | +| `node.image.pullPolicy` | Image pull policy for the node container | `Always` | +| `node.image.tag` | Image tag for the node container | `` | +| `node.ports` | Ports to expose from the node container | `[]` | +| `node.resources` | Resource limits and requests for the node container | `{}` | +| `node.env` | Environment variables for the node container | `[]` | +| `node.args` | Arguments to pass to the node container | `[]` | +| `node.readinessProbe` | Readiness probe for the node container | `{}` | +| `node.livenessProbe` | Liveness probe for the node container | `{}` | + +### Pod Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `nodeSelector` | Node selector for the pod | `{}` | +| `tolerations` | Tolerations for the pod | `[]` | +| `affinity` | Affinity rules for the pod | `{}` | +| `podAnnotations` | Annotations to add to the pod | `{}` | +| `podSecurityContext` | Security context for the pod | `{}` | +| `securityContext` | Security context for the container | `{}` | +| `volumes` | Volumes for the pod | `[]` | + +### Service Account Parameters + +| Parameter | Description | Default | +|------------------------------|--------------------------------------|---------------| +| `serviceAccount.create` | Specifies whether a service account should be created | `true` | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | +| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | `""` | + +### VM Pod Scrape Parameters + +| Parameter | Description | Default | +|--------------------------|--------------------------------------|---------------| +| `vmPodScrape.enabled` | Enable or disable VM Pod Scraping | `true` | + +## Example + +To deploy the chart with custom values, create a `values.yaml` file: + +```yaml +replicaCount: 2 + +service: + type: LoadBalancer + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 8080 + +ingress: + enabled: true + host: myapp.example.com + +register: + image: + repository: my-registry/my-register + tag: latest + +node: + image: + repository: my-registry/my-node + tag: stable + resources: + limits: + cpu: 2 + memory: 2Gi + requests: + cpu: 1 + memory: 1Gi +``` + +Then install the chart using the Helm CLI: + +```sh +helm install my-release -f values.yaml . +``` diff --git a/starters/avs/templates/_helpers.tpl b/starters/avs/templates/_helpers.tpl new file mode 100644 index 0000000..8d970b9 --- /dev/null +++ b/starters/avs/templates/_helpers.tpl @@ -0,0 +1,68 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define ".name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define ".fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define ".chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define ".labels" -}} +helm.sh/chart: {{ include ".chart" . }} +{{ include ".selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{- define "Register.labels" -}} +helm.sh/chart: {{ include ".chart" . }} +{{ include "Register.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define ".selectorLabels" -}} +app.kubernetes.io/name: {{ include ".name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "Register.selectorLabels" -}} +app.kubernetes.io/name: {{ include ".name" . }}-register +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/starters/avs/templates/configmap.tpl b/starters/avs/templates/configmap.tpl new file mode 100644 index 0000000..8a8bbe7 --- /dev/null +++ b/starters/avs/templates/configmap.tpl @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include ".fullname" . }}-config + labels: + {{- include ".labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +data: + {{- if .Values.configs }} + {{- toYaml .Values.configs | nindent 2 }} + {{- end }} diff --git a/starters/avs/templates/ingress.tpl b/starters/avs/templates/ingress.tpl new file mode 100644 index 0000000..920b5c3 --- /dev/null +++ b/starters/avs/templates/ingress.tpl @@ -0,0 +1,31 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include ".fullname" . }} + labels: + {{- include ".labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + annotations: + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.annotations }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + ingressClassName: nginx + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ include ".fullname" . }} + port: + name: node-api +{{- end }} diff --git a/starters/avs/templates/register.tpl b/starters/avs/templates/register.tpl new file mode 100644 index 0000000..2c4daa6 --- /dev/null +++ b/starters/avs/templates/register.tpl @@ -0,0 +1,40 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include ".fullname" . }}-register-job + labels: + {{- include "Register.labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + annotations: + "helm.sh/hook": "post-install" + {{- with .Values.annotations }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + template: + metadata: + labels: + {{- include "Register.labels" . | nindent 8 }} + spec: + containers: + - name: register + image: "{{ .Values.register.image.repository }}:{{ .Values.register.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.register.image.pullPolicy }} + args: + {{- toYaml .Values.register.args | nindent 12 }} + env: + {{- toYaml .Values.register.env | nindent 12 }} + volumeMounts: + {{- toYaml .Values.register.volumeMounts | nindent 12 }} + - name: config + mountPath: /app/config/operator.yaml + subPath: operator.yaml + restartPolicy: Never + volumes: + {{- toYaml .Values.volumes | nindent 8 }} + - name: config + configMap: + name: {{ include ".fullname" . }}-config + backoffLimit: 2 diff --git a/starters/avs/templates/service.tpl b/starters/avs/templates/service.tpl new file mode 100644 index 0000000..ec99da6 --- /dev/null +++ b/starters/avs/templates/service.tpl @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include ".fullname" . }} + {{- with .Values.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include ".labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + type: {{ .Values.service.type }} + ports: + {{- range .Values.service.ports }} + - name: {{ .name }} + port: {{ .port }} + protocol: {{ .protocol }} + targetPort: {{ .targetPort }} + {{- end }} + selector: + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + app: {{ include ".fullname" . }} diff --git a/starters/avs/templates/serviceaccount.tpl b/starters/avs/templates/serviceaccount.tpl new file mode 100644 index 0000000..75b3e47 --- /dev/null +++ b/starters/avs/templates/serviceaccount.tpl @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include ".fullname" . }} + labels: + {{- include ".labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} diff --git a/starters/avs/templates/statefulset.tpl b/starters/avs/templates/statefulset.tpl new file mode 100644 index 0000000..be1b48d --- /dev/null +++ b/starters/avs/templates/statefulset.tpl @@ -0,0 +1,103 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include ".fullname" . }} + labels: + {{- include ".labels" . | nindent 4 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end}} + annotations: + {{- with .Values.annotations }} + {{- toYaml . | nindent 4 }} + {{- end}} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include ".selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + template: + metadata: + annotations: + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.annotations }} + {{- toYaml . | nindent 8 }} + {{- end}} + labels: + app: {{ include ".fullname" . }} + {{- include ".selectorLabels" . | nindent 8 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 8 }} + {{- end}} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include ".fullname" .) }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: node + {{- with .Values.node.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.node.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.node.image.repository }}:{{ .Values.node.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.node.image.pullPolicy }} + ports: + {{- toYaml $.Values.node.ports | nindent 10 }} + {{- if .Values.lifecycleHooks }} + lifecycle: + {{- toYaml .Values.node.lifecycleHooks | nindent 12 }} + {{- end }} + {{- if .Values.node.livenessProbe }} + livenessProbe: + {{- toYaml .Values.node.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.node.readinessProbe }} + readinessProbe: + {{- toYaml .Values.node.readinessProbe | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.node.resources | nindent 12 }} + volumeMounts: + {{- with .Values.node.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + - name: config + mountPath: /app/config/operator.yaml + subPath: operator.yaml + env: + {{- toYaml .Values.node.env | nindent 12 }} + volumes: + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + - name: config + configMap: + name: {{ include ".fullname" . }}-config + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/starters/avs/templates/vmPodScrape.tpl b/starters/avs/templates/vmPodScrape.tpl new file mode 100644 index 0000000..1515e98 --- /dev/null +++ b/starters/avs/templates/vmPodScrape.tpl @@ -0,0 +1,16 @@ +{{- if .Values.vmPodScrape.enabled -}} +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMPodScrape +metadata: + name: {{ include ".fullname" . }} +spec: + selector: + matchLabels: + {{- include ".selectorLabels" . | nindent 6 }} + {{- with .Values.labels }} + {{- toYaml . | nindent 6 }} + {{- end}} + podMetricsEndpoints: + - port: metrics + scheme: http +{{- end }} diff --git a/starters/avs/values.schema.json b/starters/avs/values.schema.json new file mode 100644 index 0000000..cdb5b1f --- /dev/null +++ b/starters/avs/values.schema.json @@ -0,0 +1,180 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "affinity": { + "properties": {}, + "type": "object" + }, + "configs": { + "properties": { + "operator.yaml": { + "type": "string" + } + }, + "type": "object" + }, + "fullnameOverride": { + "type": "string" + }, + "imagePullSecrets": { + "type": "array" + }, + "ingress": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "host": { + "type": "string" + } + }, + "type": "object" + }, + "labels": { + "properties": {}, + "type": "object" + }, + "nameOverride": { + "type": "string" + }, + "node": { + "properties": { + "args": { + "type": "array" + }, + "env": { + "type": "array" + }, + "image": { + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "livenessProbe": { + "properties": {}, + "type": "object" + }, + "ports": { + "type": "array" + }, + "readinessProbe": { + "properties": {}, + "type": "object" + }, + "resources": { + "properties": {}, + "type": "object" + }, + "volumeMounts": { + "type": "array" + } + }, + "type": "object" + }, + "nodeSelector": { + "properties": {}, + "type": "object" + }, + "podAnnotations": { + "properties": {}, + "type": "object" + }, + "podSecurityContext": { + "properties": {}, + "type": "object" + }, + "register": { + "properties": { + "args": { + "items": { + "type": "string" + }, + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "image": { + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "replicaCount": { + "type": "integer" + }, + "securityContext": { + "properties": {}, + "type": "object" + }, + "service": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "ports": { + "type": "array" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "serviceAccount": { + "properties": { + "annotations": { + "properties": {}, + "type": "object" + }, + "create": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "tolerations": { + "type": "array" + }, + "vmPodScrape": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "volumes": { + "type": "array" + } + }, + "type": "object" +} diff --git a/starters/avs/values.yaml b/starters/avs/values.yaml new file mode 100644 index 0000000..938309b --- /dev/null +++ b/starters/avs/values.yaml @@ -0,0 +1,182 @@ +# Optionally override the name of the chart +nameOverride: "" + +# Optionally override the full name of the chart +fullnameOverride: "" + +# Number of replicas to deploy +replicaCount: 1 + +# Additional labels to add to resources +labels: {} + +# Secrets for pulling images from a private registry +imagePullSecrets: [] + +service: + # Annotations to add to the service + annotations: {} + + # Type of service to create + type: ClusterIP + + # List of ports to expose from the service + ports: [] + # Example port configuration for node-api service + # - name: node-api + # port: 9010 + # protocol: TCP + # targetPort: 9010 + # Example port configuration for metrics service + # - name: metrics + # port: 9091 + # protocol: TCP + # targetPort: 9091 + +ingress: + # Annotations to add to the ingress + annotations: {} + + # Enable or disable the ingress + enabled: false + + # Hostname for the ingress + host: example.com + +configs: + # Configuration file for the operator + operator.yaml: | + # some configs via file + +register: + # Enable or disable the register container + enabled: true + + # Configuration for the register container image + image: + # Image registry for the register container + repository: + + # Image pull policy for the register container + pullPolicy: Always + + # Image tag for the register container + tag: "" + + # Arguments to pass to the register container + args: + - --config=/app/config/operator.yaml + - register-operator-with-avs + +node: + # Volume mounts for the node container + volumeMounts: [] + + # Configuration for the node container image + image: + # Image registry for the node container + repository: + + # Image pull policy for the node container + pullPolicy: Always + + # Image tag for the node container + tag: "" + + # Ports to expose from the node container + ports: [] + # Example port configuration for node-api container + # - name: node-api + # containerPort: 9010 + # protocol: TCP + # Example port configuration for metrics container + # - name: metrics + # containerPort: 9091 + # protocol: TCP + + # Resource limits and requests for the node container + resources: {} + # Example resource limits and requests + # limits: + # cpu: 4 + # memory: 4Gi + # requests: + # cpu: 2 + # memory: 4Gi + + # Environment variables for the node container + env: [] + + # Arguments to pass to the node container + args: [] + # Example arguments for the node container + # - --config=/app/config/operator.yaml + # - start-operator + + # Readiness probe for the node container + readinessProbe: {} + # Example HTTP readiness probe + # httpGet: + # path: /metrics + # port: 9091 + # initialDelaySeconds: 30 + # periodSeconds: 10 + # timeoutSeconds: 3 + # failureThreshold: 3 + # successThreshold: 1 + + # Liveness probe for the node container + livenessProbe: {} + # Example HTTP liveness probe + # httpGet: + # path: /metrics + # port: 9090 + # initialDelaySeconds: 1200 + # periodSeconds: 30 + # timeoutSeconds: 3 + # failureThreshold: 2 + # successThreshold: 1 + +# Node selector for the pod +nodeSelector: {} + +# Tolerations for the pod +tolerations: [] + +# Affinity rules for the pod +affinity: {} + +serviceAccount: + # Specifies whether a service account should be created + create: true + + # Annotations to add to the service account + annotations: {} + + # The name of the service account to use. If not set and create is true, a name is generated using the fullname template + name: "" + +# Annotations to add to the pod +podAnnotations: {} + +# Security context for the pod +podSecurityContext: {} + # Example security context + # fsGroup: 2000 + +# Security context for the container +securityContext: {} + # Example security context + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# Volumes for the pod +volumes: [] + +vmPodScrape: + # Enable or disable VM Pod Scraping + enabled: true