From 4325993482d43b68876a4e435eb10098a9cda0d1 Mon Sep 17 00:00:00 2001 From: sacreman Date: Thu, 16 Sep 2021 00:39:03 +0700 Subject: [PATCH] pass in provider config --- README.md | 11 ++--- charts/provider/Chart.yaml | 2 +- .../templates/configmap-client-config.yaml | 9 ++--- .../templates/configmap-provider-config.yaml | 33 ++------------- charts/provider/templates/secret.yaml | 9 +++-- .../templates/tests/test-connection.yaml | 15 ------- charts/provider/values.yaml | 40 +++++++++++++++++++ 7 files changed, 58 insertions(+), 61 deletions(-) delete mode 100644 charts/provider/templates/tests/test-connection.yaml diff --git a/README.md b/README.md index 83436ad3..f866be03 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Usage -[Helm](https://helm.sh) must be installed to use the charts. Please refer to +[Helm](https://helm.sh) must be installed to use the charts. Please refer to Helm's [documentation](https://helm.sh/docs) to get started. Once Helm has been set up correctly, add the repo as follows: @@ -10,15 +10,16 @@ helm repo add akash https://ovrclk.github.io/helm-charts ``` If you had already added this repo earlier, run `helm repo update` to retrieve -the latest versions of the packages. You can then run `helm search repo -akash` to see the charts. +the latest versions of the packages. You can then run `helm search repo akash` to see the charts. ### Example -To install the provider chart: +To install the provider chart make sure you have your [provider-cert.pem](https://docs.akash.network/operations/provider#creating-the-provider-on-the-blockchain) in the current directory and then set the env vars below and install the chart. ``` -helm install provider akash/provider +akash_key= +akash_password= +helm install provider akash/provider --set akash_provider.key=$akash_key --set akash_provider.keysecret=$akash_password --set-file akash_provider.providercert=provider-cert.pem ``` To uninstall the chart: diff --git a/charts/provider/Chart.yaml b/charts/provider/Chart.yaml index 865e675b..4fe9e6b5 100644 --- a/charts/provider/Chart.yaml +++ b/charts/provider/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.18.0 +version: 0.19.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/provider/templates/configmap-client-config.yaml b/charts/provider/templates/configmap-client-config.yaml index 76b4d8a3..709ea3c8 100644 --- a/charts/provider/templates/configmap-client-config.yaml +++ b/charts/provider/templates/configmap-client-config.yaml @@ -3,9 +3,6 @@ kind: ConfigMap metadata: name: akash-client-config data: - home: "/home" - from: "main" - node: "http://akash-node:26657" - chain-id: "local" - keyring-backend: "test" - trust-node: "true" + {{- range $key, $val := .Values.akash_client }} + {{ $key }}: {{ $val | quote }} + {{- end }} diff --git a/charts/provider/templates/configmap-provider-config.yaml b/charts/provider/templates/configmap-provider-config.yaml index 55f6692f..59c4c3a4 100644 --- a/charts/provider/templates/configmap-provider-config.yaml +++ b/charts/provider/templates/configmap-provider-config.yaml @@ -3,33 +3,6 @@ kind: ConfigMap metadata: name: akash-provider-config data: - ## - # override-able defaults - ## - # ingress-static-hosts: false - # ingress-domain: - # ingress-expose-lb-hosts: false - # network-policies-enabled: false - # max-unit-cpu: 500 - # max-unit-memory: 1073741824 - # max-unit-storage: 1073741824 - # max-unit-count: 10 - # max-unit-price: 10000 - # min-unit-cpu: 10 - # min-unit-memory: 1024 - # min-unit-storage: 1024 - # min-unit-count: 1 - # min-unit-price: 1 - # max-group-count: 10 - # max-group-units: 10 - # max-group-cpu: 1000 - # max-group-memory: 1073741824 - # max-group-storage: 5368709120 - # mem-price-min: 50 - # mem-price-max: 1048576 - # bid-price-strategy: - # bid-cpu-scale: - # bid-storage-scale: - # bid-script-path: - # bid-script-process-limit: - # bid-script-process-timeout: + {{- range $key, $val := .Values.akash_provider }} + {{ $key }}: {{ $val | quote }} + {{- end }} diff --git a/charts/provider/templates/secret.yaml b/charts/provider/templates/secret.yaml index e45dad26..04bca47f 100644 --- a/charts/provider/templates/secret.yaml +++ b/charts/provider/templates/secret.yaml @@ -2,10 +2,11 @@ apiVersion: v1 kind: Secret metadata: name: akash-provider-keys -data: +type: "Opaque" +stringData: provider-cert.pem: | - ZHVtbXk= + {{ .Values.akash_provider.providercert }} key.txt: | - ZHVtbXk= + {{ .Values.akash_provider.key }} key-pass.txt: | - ZHVtbXk= + {{ .Values.akash_provider.keysecret }} diff --git a/charts/provider/templates/tests/test-connection.yaml b/charts/provider/templates/tests/test-connection.yaml deleted file mode 100644 index 05e119af..00000000 --- a/charts/provider/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "provider.fullname" . }}-test-connection" - labels: - {{- include "provider.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "provider.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/charts/provider/values.yaml b/charts/provider/values.yaml index 8e6f1471..c63738bc 100644 --- a/charts/provider/values.yaml +++ b/charts/provider/values.yaml @@ -14,6 +14,46 @@ imagePullSecrets: [] service: port: 8443 +akash_client: + home: "/home" + from: "main" + node: "http://135.181.60.250:26657" + chain-id: "akashnet-2" + keyring-backend: "test" + trust-node: "true" + +akash_provider: + key: + keysecret: + providercert: + ingress-static-hosts: false + ingress-domain: + ingress-expose-lb-hosts: false + network-policies-enabled: false + max-unit-cpu: 500 + max-unit-memory: 1073741824 + max-unit-storage: 1073741824 + max-unit-count: 10 + max-unit-price: 10000 + min-unit-cpu: 10 + min-unit-memory: 1024 + min-unit-storage: 1024 + min-unit-count: 1 + min-unit-price: 1 + max-group-count: 10 + max-group-units: 10 + max-group-cpu: 1000 + max-group-memory: 1073741824 + max-group-storage: 5368709120 + mem-price-min: 50 + mem-price-max: 1048576 + bid-price-strategy: + bid-cpu-scale: + bid-storage-scale: + bid-script-path: + bid-script-process-limit: + bid-script-process-timeout: + autoscaling: enabled: false minReplicas: 1