Skip to content

Commit

Permalink
feat(ethereum)!: scaling interface (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjorge-graphops committed Sep 27, 2023
1 parent 4b52c95 commit ae0e8e7
Show file tree
Hide file tree
Showing 34 changed files with 863 additions and 429 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions arbitrum/README.md
Expand Up @@ -18,7 +18,7 @@ Proxyd is an EVM-blockchain JSON-RPC router and load balancer developed in Go by

- Actively maintained by [![GraphOps](https://avatars.githubusercontent.com/u/85314764?s=12&v=4) *GraphOps*](https://graphops.xyz) [and contributors](/graphs/contributors)
- Common values interfaces across all namespaces
- Flexible and adaptable, allowing defaults to be overriden
- Flexible and adaptable, allowing defaults to be overridden
- Two release channels: `stable` and `canary`
- A large selection of Namespaces (listed below)

Expand All @@ -31,7 +31,7 @@ To use *Namespaces* you will require both a [*Kubernetes*](https://kubernetes.io
As such:
- Make sure your *Kubernetes* *Cluster* is in order and your environment has the *kubeconfig* context adequately setup
- Install *helmfile*, upstream guidance available here: [*Helmfile* Installation](https://github.com/helmfile/helmfile#installation)
– Install *kustomize*, upstream guidance availabe here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependencie for utilising *helmfile* features.
– Install *kustomize*, upstream guidance available here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependency for utilising *helmfile* features.

Next, setup an `helmfile.yaml` file that makes use of the arbitrum *Namespace* by creating it with the following contents:
```yaml
Expand Down Expand Up @@ -74,7 +74,7 @@ helmfiles:

where we add some labels to this *Namespace* releases, and set it to be deployed on cluster namespace different from default.

You can also easilly override values for every release, like so:
You can also easily override values for every release, like so:
```yaml
helmfiles:
- path: git::https://github.com/graphops/launchpad-namespaces.git@arbitrum/helmfile.yaml?ref=arbitrum-latest
Expand Down
60 changes: 41 additions & 19 deletions arbitrum/helmfile.yaml
@@ -1,3 +1,16 @@
#set default flavor when missing
{{ if not ( hasKey .Values "flavor" ) }}
{{ $_ := set .Values "flavor" "mainnet" }}
{{ end }}



environments:
{{ .Environment.Name }}:
values:
- flavor: {{ .Values.flavor }}

---
{{- $_tplTransforms := `
{{- $_TemplatedResources := list "Deployment" "StatefulSet" "DaemonSet" -}}
transformers:
Expand Down Expand Up @@ -34,10 +47,20 @@ transformers:
{{- $_tplReleaseValues := (print `
{{- if ( .Values | get .release dict | get "mergeValues" true ) -}}
{{- if ( hasKey .Values "flavor" ) }}
- ./values/_common/{{` "`{{ .Release.Name }}`" `}}.yaml
- ./values/{{ .Values.flavor }}/{{` "`{{ .Release.Name }}`" `}}.yaml
- ./values/_common/{{ .canonicalRelease }}.yaml
- ./values/_common/{{ .canonicalRelease }}.yaml.gotmpl
- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml
- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml.gotmpl
{{- else }}
- ./values/{{` "`{{ .Release.Name }}`" `}}.yaml
- ./values/{{ .canonicalRelease }}.yaml
- ./values/{{ .canonicalRelease }}.yaml.gotmpl
{{- end -}}
{{- if typeIs ( typeOf list ) ( .Values | get .canonicalRelease dict | get "values" dict ) -}}
{{- range $element := ( .Values | get .canonicalRelease dict | get "values" dict ) }}
- {{- $element | toYaml | nindent 2 }}
{{- end -}}
{{- else }}
- {{- .Values | get .canonicalRelease dict | get "values" dict | toYaml | nindent 2 }}
{{- end -}}
{{- end -}}
{{- if typeIs ( typeOf list ) ( .Values | get .release dict | get "values" dict ) -}}
Expand All @@ -48,7 +71,6 @@ transformers:
- {{- .Values | get .release dict | get "values" dict | toYaml | nindent 2 }}
{{- end -}}
`) -}}
{{ $__helmDefaults := `{"recreatePods":true}` | fromJson }}

{{ with ( .Values | get "helmDefaults" dict ) }}
Expand All @@ -62,12 +84,6 @@ helmDefaults:
kubeVersion: {{ .Values.kubeVersion }}
{{ end }}

#set default flavor when missing
{{ if not ( hasKey .Values "flavor" ) }}
{{ $_ := set .Values "flavor" "mainnet" }}
{{ end }}


#set default namespace
{{ $_defaultNamespace := ( print "arbitrum-" .Values.flavor ) }}

Expand Down Expand Up @@ -137,21 +153,27 @@ templates:
version: "0.2.1"
{{- end }}
releases:
{{- $canonicalRelease := "arbitrum-nitro" }}
{{- $release := "arbitrum-nitro" }}
- name: 'arbitrum-nitro'
- name: "{{ $release }}"
inherit:
- template: 'arbitrum-nitro'
- template: "{{ $canonicalRelease }}"
values:
{{- tpl $_tplReleaseValues (dict "Values" .Values "release" $release) | indent 4 -}}
{{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}}

{{- $canonicalRelease := "arbitrum-classic" }}
{{- $release := "arbitrum-classic" }}
- name: 'arbitrum-classic'
- name: "{{ $release }}"
inherit:
- template: 'arbitrum-classic'
- template: "{{ $canonicalRelease }}"
values:
{{- tpl $_tplReleaseValues (dict "Values" .Values "release" $release) | indent 4 -}}
{{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}}

{{- $canonicalRelease := "proxyd" }}
{{- $release := "proxyd" }}
- name: 'proxyd'
- name: "{{ $release }}"
inherit:
- template: 'proxyd'
- template: "{{ $canonicalRelease }}"
values:
{{- tpl $_tplReleaseValues (dict "Values" .Values "release" $release) | indent 4 -}}
{{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}}

6 changes: 3 additions & 3 deletions avalanche/README.md
Expand Up @@ -16,7 +16,7 @@ Proxyd is an EVM-blockchain JSON-RPC router and load balancer developed in Go by

- Actively maintained by [![GraphOps](https://avatars.githubusercontent.com/u/85314764?s=12&v=4) *GraphOps*](https://graphops.xyz) [and contributors](/graphs/contributors)
- Common values interfaces across all namespaces
- Flexible and adaptable, allowing defaults to be overriden
- Flexible and adaptable, allowing defaults to be overridden
- Two release channels: `stable` and `canary`
- A large selection of Namespaces (listed below)

Expand All @@ -29,7 +29,7 @@ To use *Namespaces* you will require both a [*Kubernetes*](https://kubernetes.io
As such:
- Make sure your *Kubernetes* *Cluster* is in order and your environment has the *kubeconfig* context adequately setup
- Install *helmfile*, upstream guidance available here: [*Helmfile* Installation](https://github.com/helmfile/helmfile#installation)
– Install *kustomize*, upstream guidance availabe here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependencie for utilising *helmfile* features.
– Install *kustomize*, upstream guidance available here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependency for utilising *helmfile* features.

Next, setup an `helmfile.yaml` file that makes use of the avalanche *Namespace* by creating it with the following contents:
```yaml
Expand Down Expand Up @@ -72,7 +72,7 @@ helmfiles:

where we add some labels to this *Namespace* releases, and set it to be deployed on cluster namespace different from default.

You can also easilly override values for every release, like so:
You can also easily override values for every release, like so:
```yaml
helmfiles:
- path: git::https://github.com/graphops/launchpad-namespaces.git@avalanche/helmfile.yaml?ref=avalanche-latest
Expand Down
52 changes: 36 additions & 16 deletions avalanche/helmfile.yaml
@@ -1,3 +1,16 @@
#set default flavor when missing
{{ if not ( hasKey .Values "flavor" ) }}
{{ $_ := set .Values "flavor" "mainnet" }}
{{ end }}



environments:
{{ .Environment.Name }}:
values:
- flavor: {{ .Values.flavor }}

---
{{- $_tplTransforms := `
{{- $_TemplatedResources := list "Deployment" "StatefulSet" "DaemonSet" -}}
transformers:
Expand Down Expand Up @@ -34,10 +47,20 @@ transformers:
{{- $_tplReleaseValues := (print `
{{- if ( .Values | get .release dict | get "mergeValues" true ) -}}
{{- if ( hasKey .Values "flavor" ) }}
- ./values/_common/{{` "`{{ .Release.Name }}`" `}}.yaml
- ./values/{{ .Values.flavor }}/{{` "`{{ .Release.Name }}`" `}}.yaml
- ./values/_common/{{ .canonicalRelease }}.yaml
- ./values/_common/{{ .canonicalRelease }}.yaml.gotmpl
- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml
- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml.gotmpl
{{- else }}
- ./values/{{ .canonicalRelease }}.yaml
- ./values/{{ .canonicalRelease }}.yaml.gotmpl
{{- end -}}
{{- if typeIs ( typeOf list ) ( .Values | get .canonicalRelease dict | get "values" dict ) -}}
{{- range $element := ( .Values | get .canonicalRelease dict | get "values" dict ) }}
- {{- $element | toYaml | nindent 2 }}
{{- end -}}
{{- else }}
- ./values/{{` "`{{ .Release.Name }}`" `}}.yaml
- {{- .Values | get .canonicalRelease dict | get "values" dict | toYaml | nindent 2 }}
{{- end -}}
{{- end -}}
{{- if typeIs ( typeOf list ) ( .Values | get .release dict | get "values" dict ) -}}
Expand All @@ -48,7 +71,6 @@ transformers:
- {{- .Values | get .release dict | get "values" dict | toYaml | nindent 2 }}
{{- end -}}
`) -}}
{{ $__helmDefaults := `{"recreatePods":true}` | fromJson }}

{{ with ( .Values | get "helmDefaults" dict ) }}
Expand All @@ -62,12 +84,6 @@ helmDefaults:
kubeVersion: {{ .Values.kubeVersion }}
{{ end }}

#set default flavor when missing
{{ if not ( hasKey .Values "flavor" ) }}
{{ $_ := set .Values "flavor" "mainnet" }}
{{ end }}


#set default namespace
{{ $_defaultNamespace := ( print "avalanche-" .Values.flavor ) }}

Expand Down Expand Up @@ -123,15 +139,19 @@ templates:
version: "0.1.8"
{{- end }}
releases:
{{- $canonicalRelease := "avalanche" }}
{{- $release := "avalanche" }}
- name: 'avalanche'
- name: "{{ $release }}"
inherit:
- template: 'avalanche'
- template: "{{ $canonicalRelease }}"
values:
{{- tpl $_tplReleaseValues (dict "Values" .Values "release" $release) | indent 4 -}}
{{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}}

{{- $canonicalRelease := "proxyd" }}
{{- $release := "proxyd" }}
- name: 'proxyd'
- name: "{{ $release }}"
inherit:
- template: 'proxyd'
- template: "{{ $canonicalRelease }}"
values:
{{- tpl $_tplReleaseValues (dict "Values" .Values "release" $release) | indent 4 -}}
{{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}}

6 changes: 3 additions & 3 deletions celo/README.md
Expand Up @@ -16,7 +16,7 @@ Proxyd is an EVM-blockchain JSON-RPC router and load balancer developed in Go by

- Actively maintained by [![GraphOps](https://avatars.githubusercontent.com/u/85314764?s=12&v=4) *GraphOps*](https://graphops.xyz) [and contributors](/graphs/contributors)
- Common values interfaces across all namespaces
- Flexible and adaptable, allowing defaults to be overriden
- Flexible and adaptable, allowing defaults to be overridden
- Two release channels: `stable` and `canary`
- A large selection of Namespaces (listed below)

Expand All @@ -29,7 +29,7 @@ To use *Namespaces* you will require both a [*Kubernetes*](https://kubernetes.io
As such:
- Make sure your *Kubernetes* *Cluster* is in order and your environment has the *kubeconfig* context adequately setup
- Install *helmfile*, upstream guidance available here: [*Helmfile* Installation](https://github.com/helmfile/helmfile#installation)
– Install *kustomize*, upstream guidance availabe here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependencie for utilising *helmfile* features.
– Install *kustomize*, upstream guidance available here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependency for utilising *helmfile* features.

Next, setup an `helmfile.yaml` file that makes use of the celo *Namespace* by creating it with the following contents:
```yaml
Expand Down Expand Up @@ -72,7 +72,7 @@ helmfiles:

where we add some labels to this *Namespace* releases, and set it to be deployed on cluster namespace different from default.

You can also easilly override values for every release, like so:
You can also easily override values for every release, like so:
```yaml
helmfiles:
- path: git::https://github.com/graphops/launchpad-namespaces.git@celo/helmfile.yaml?ref=celo-latest
Expand Down
52 changes: 36 additions & 16 deletions celo/helmfile.yaml
@@ -1,3 +1,16 @@
#set default flavor when missing
{{ if not ( hasKey .Values "flavor" ) }}
{{ $_ := set .Values "flavor" "mainnet" }}
{{ end }}



environments:
{{ .Environment.Name }}:
values:
- flavor: {{ .Values.flavor }}

---
{{- $_tplTransforms := `
{{- $_TemplatedResources := list "Deployment" "StatefulSet" "DaemonSet" -}}
transformers:
Expand Down Expand Up @@ -34,10 +47,20 @@ transformers:
{{- $_tplReleaseValues := (print `
{{- if ( .Values | get .release dict | get "mergeValues" true ) -}}
{{- if ( hasKey .Values "flavor" ) }}
- ./values/_common/{{` "`{{ .Release.Name }}`" `}}.yaml
- ./values/{{ .Values.flavor }}/{{` "`{{ .Release.Name }}`" `}}.yaml
- ./values/_common/{{ .canonicalRelease }}.yaml
- ./values/_common/{{ .canonicalRelease }}.yaml.gotmpl
- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml
- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml.gotmpl
{{- else }}
- ./values/{{ .canonicalRelease }}.yaml
- ./values/{{ .canonicalRelease }}.yaml.gotmpl
{{- end -}}
{{- if typeIs ( typeOf list ) ( .Values | get .canonicalRelease dict | get "values" dict ) -}}
{{- range $element := ( .Values | get .canonicalRelease dict | get "values" dict ) }}
- {{- $element | toYaml | nindent 2 }}
{{- end -}}
{{- else }}
- ./values/{{` "`{{ .Release.Name }}`" `}}.yaml
- {{- .Values | get .canonicalRelease dict | get "values" dict | toYaml | nindent 2 }}
{{- end -}}
{{- end -}}
{{- if typeIs ( typeOf list ) ( .Values | get .release dict | get "values" dict ) -}}
Expand All @@ -48,7 +71,6 @@ transformers:
- {{- .Values | get .release dict | get "values" dict | toYaml | nindent 2 }}
{{- end -}}
`) -}}
{{ $__helmDefaults := `{"recreatePods":true}` | fromJson }}

{{ with ( .Values | get "helmDefaults" dict ) }}
Expand All @@ -62,12 +84,6 @@ helmDefaults:
kubeVersion: {{ .Values.kubeVersion }}
{{ end }}

#set default flavor when missing
{{ if not ( hasKey .Values "flavor" ) }}
{{ $_ := set .Values "flavor" "mainnet" }}
{{ end }}


#set default namespace
{{ $_defaultNamespace := ( print "celo-" .Values.flavor ) }}

Expand Down Expand Up @@ -123,15 +139,19 @@ templates:
version: "0.1.8"
{{- end }}
releases:
{{- $canonicalRelease := "celo" }}
{{- $release := "celo" }}
- name: 'celo'
- name: "{{ $release }}"
inherit:
- template: 'celo'
- template: "{{ $canonicalRelease }}"
values:
{{- tpl $_tplReleaseValues (dict "Values" .Values "release" $release) | indent 4 -}}
{{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}}

{{- $canonicalRelease := "proxyd" }}
{{- $release := "proxyd" }}
- name: 'proxyd'
- name: "{{ $release }}"
inherit:
- template: 'proxyd'
- template: "{{ $canonicalRelease }}"
values:
{{- tpl $_tplReleaseValues (dict "Values" .Values "release" $release) | indent 4 -}}
{{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}}

9 changes: 6 additions & 3 deletions ethereum/README.md
Expand Up @@ -18,7 +18,7 @@ Proxyd is an EVM-blockchain JSON-RPC router and load balancer developed in Go by

- Actively maintained by [![GraphOps](https://avatars.githubusercontent.com/u/85314764?s=12&v=4) *GraphOps*](https://graphops.xyz) [and contributors](/graphs/contributors)
- Common values interfaces across all namespaces
- Flexible and adaptable, allowing defaults to be overriden
- Flexible and adaptable, allowing defaults to be overridden
- Two release channels: `stable` and `canary`
- A large selection of Namespaces (listed below)

Expand All @@ -31,7 +31,7 @@ To use *Namespaces* you will require both a [*Kubernetes*](https://kubernetes.io
As such:
- Make sure your *Kubernetes* *Cluster* is in order and your environment has the *kubeconfig* context adequately setup
- Install *helmfile*, upstream guidance available here: [*Helmfile* Installation](https://github.com/helmfile/helmfile#installation)
– Install *kustomize*, upstream guidance availabe here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependencie for utilising *helmfile* features.
– Install *kustomize*, upstream guidance available here: [*Kustomize* Installation](https://kubectl.docs.kubernetes.io/installation/kustomize/). Although `launchpad–namespaces` doesn't explicitly use *kustomize*, it is a dependency for utilising *helmfile* features.

Next, setup an `helmfile.yaml` file that makes use of the ethereum *Namespace* by creating it with the following contents:
```yaml
Expand Down Expand Up @@ -74,7 +74,7 @@ helmfiles:

where we add some labels to this *Namespace* releases, and set it to be deployed on cluster namespace different from default.

You can also easilly override values for every release, like so:
You can also easily override values for every release, like so:
```yaml
helmfiles:
- path: git::https://github.com/graphops/launchpad-namespaces.git@ethereum/helmfile.yaml?ref=ethereum-latest
Expand Down Expand Up @@ -134,6 +134,9 @@ proxyd.chartVersion | string | | Specify a specific chart version to use for th
proxyd.labels | object | | Adds helmfile labels to this release |
proxyd.mergeValues | boolean | true | Merges passed values with namespace's defaults if true, overrides if false |
proxyd.values | (object *or* list of objects) | | Pass values to the release helm chart |
scaling | object | | ethereum scaling interface |
scaling.deployments | integer | 1 | number of independent stateful sets to deploy |
scaling.startP2PPort | integer | | A beggining port for the range to use in P2P NodePorts |
targetNamespace | string | eth-mainnet | the default is eth-<flavor> |
helmDefaults | object | | |
helmDefaults.args | list of strings | | |
Expand Down

0 comments on commit ae0e8e7

Please sign in to comment.