Skip to content

Commit

Permalink
renterd 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
artur9010 committed Mar 14, 2024
1 parent dd79e4e commit bd065ac
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 104 deletions.
38 changes: 31 additions & 7 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,31 @@ entries:
renterd:
- apiVersion: v2
appVersion: 1.0.5
created: "2024-03-07T22:31:11.687240034Z"
created: "2024-03-14T13:02:27.05742037Z"
dependencies:
- condition: mysql.enabled
name: mysql
repository: https://charts.bitnami.com/bitnami
version: 9.22.0
description: Sia renterd helm chart
digest: 2dc5d1613c7968526dde35b65e7c8feb143a699e39645c9b27f13d0b70937b35
icon: https://i.imgur.com/pWg0PRK.png
keywords:
- storage
- distributed
- blockchain
- sia
- renter
- s3
- webui
name: renterd
type: application
urls:
- https://charts.motyka.pro/renterd-1.0.6.tgz
version: 1.0.6
- apiVersion: v2
appVersion: 1.0.5
created: "2024-03-14T13:02:27.052184835Z"
dependencies:
- condition: mysql.enabled
name: mysql
Expand All @@ -27,7 +51,7 @@ entries:
version: 1.0.5
- apiVersion: v2
appVersion: 1.0.5
created: "2024-03-07T22:31:11.683559739Z"
created: "2024-03-14T13:02:27.038181136Z"
dependencies:
- condition: mysql.enabled
name: mysql
Expand All @@ -51,7 +75,7 @@ entries:
version: 1.0.4
- apiVersion: v2
appVersion: 1.0.0
created: "2024-03-07T22:31:11.66968001Z"
created: "2024-03-14T13:02:27.023010149Z"
dependencies:
- condition: mysql.enabled
name: mysql
Expand All @@ -75,7 +99,7 @@ entries:
version: 1.0.3
- apiVersion: v2
appVersion: 1.0.0
created: "2024-03-07T22:31:11.655689622Z"
created: "2024-03-14T13:02:27.00569118Z"
dependencies:
- condition: mysql.enabled
name: mysql
Expand All @@ -99,7 +123,7 @@ entries:
version: 1.0.2
- apiVersion: v2
appVersion: 1.0.0
created: "2024-03-07T22:31:11.644462703Z"
created: "2024-03-14T13:02:26.994493915Z"
dependencies:
- condition: mysql.enabled
name: mysql
Expand All @@ -123,7 +147,7 @@ entries:
version: 1.0.1
- apiVersion: v2
appVersion: 1.0.0
created: "2024-03-07T22:31:11.631519918Z"
created: "2024-03-14T13:02:26.977149208Z"
dependencies:
- condition: mysql.enabled
name: mysql
Expand All @@ -137,4 +161,4 @@ entries:
urls:
- https://charts.motyka.pro/renterd-1.0.0.tgz
version: 1.0.0
generated: "2024-03-07T22:31:11.605182103Z"
generated: "2024-03-14T13:02:26.962129213Z"
Binary file added renterd-1.0.6.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion renterd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: renterd
description: Sia renterd helm chart
type: application
version: 1.0.5
version: 1.0.6
appVersion: "1.0.5"
icon: https://i.imgur.com/pWg0PRK.png
keywords:
Expand Down
48 changes: 29 additions & 19 deletions renterd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,42 @@

Helm chart for [Sia renterd software](https://sia.tech/software/renterd).

**This chart should be installed in a dedicated namespace due to hardcoded names**

## Helm repository

```
helm repo add artur9010 https://charts.motyka.pro
helm install renterd artur9010/renterd --version 1.0.5
helm install renterd artur9010/renterd --version 1.0.6
```

## Requirements

- Kubernetes 1.28+ cluster, nodes should have at least 8GB of ram as renterd is memory hungry. It should work with older versions of k8s but I haven't tested it.
- Some kind of persistent storage solution (longhorn, ceph, aws-ebs etc.) and 50GB of available storage (mostly for blockchain copy). It's only required by `renterd-bus` pod which contains consensus (blockchain) copy and partial slabs. There is no support for hostPath, but [rancher local path provisioner](https://github.com/rancher/local-path-provisioner) should work fine
- Some kind of persistent storage (longhorn, ceph, aws-ebs etc.) and 50GB of available storage (mostly for blockchain copy). It's only required by `renterd-bus` pod which contains consensus (blockchain) copy and partial slabs. There is no support for hostPath, but [rancher local path provisioner](https://github.com/rancher/local-path-provisioner) should work fine
- Manual creation of secret, see "Creating secret" section.

renterd can run with sqlite or mysql database, due to performance issues on sqlite one I decided to not include an option to use sqlite. This chart includes bitnami mysql chart that you can enable by setting `mysql.enabled` to `true`. If you already have a mysql databse - create two databases (eq. `renterd` and `renterd_metrics`) and grant all privileges on them to renterd user. Provide credentials to external database in section `mysqlExternal` in values
renterd can run with sqlite or mysql database, due to performance issues on sqlite one I decided to not include an option to use sqlite. This chart includes bitnami mysql chart which is enabled by default. If you already have mysql database, check the instructions below.

```yaml
mysqlExternal:
address: "mysql.example.com:3306"
username: "renterd"
password: "renterd123"
database: "renterd"
databaseMetrics: "renterd_metrics"
### How to use external mysql database

If you already have a mysql databse - just disable built-in chart (`mysql.enabled` set to `false`) and create secret named `renterd-mysql` inside renterd namespace.

Create an .txt file named mysql.txt and containing:
```
RENTERD_DB_URI=mysql.example.com:3306
RENTERD_DB_USER=renterd
RENTERD_DB_PASSWORD=hunter2
RENTERD_DB_NAME=renterd
RENTERD_DB_METRICS_NAME=renterd_metrics
```

Now run `kubectl create secret generic renterd-mysql -n <your namespace> --from-env-file=mysql.txt`

Additional requirements for external mysql database:
- `max_connections` a bit higher than default 151, 1024 works fine
- `log_bin_trust_function_creators` set to 1 (as long as your db user dosen't have SUPER privilage, see https://github.com/SiaFoundation/renterd/issues/910)

And while it's not a requirement, please increase innodb_buffer_pool_size from default 128MB, 4G should be ok for 16GB node. I've tested it with those params and it works fine for me, those are also a defaults if you enable built-in mysql chart (Values.mysql.primary.configuration)
```
[mysqld]
innodb_buffer_pool_size=4G
```
## Creating secret

Create an .txt file named secret.txt and containing:
Expand All @@ -53,9 +56,7 @@ Password: API password, use the same value for all 3 of them.
Now run `kubectl create secret generic <secret name from values> -n <your namespace> --from-env-file=secret.txt`

## CPU and memory requirements
Tested on Ryzen zen1 platform (Ryzen 5 2200G, 2400G), while uploading files to s3 api via rclone, max 4 uploads at once. As database gets bigger it will probably require more memory, renterd holds uploaded data in memory.
While uploading files via s3 api using rclone (--transfers 20)
Tested on Ryzen zen1 platform (Ryzen 5 2200G, 2400G) while uploading files via s3 api using rclone (--transfers 20)
```
➜ ~ kubectl top pod -n renterd-zen
NAME CPU(cores) MEMORY(bytes)
Expand All @@ -77,8 +78,17 @@ ARM servers are available from 7 eur per month. [Check netcup for more info.](ht

Use code `36nc16697741959` to get [5 EUR off](https://www.netcup.eu/bestellen/gutschein_einloesen.php?gutschein=36nc16697741959&ref=200705).

Looking for more [netcup coupons](https://netcup-coupons.com)? Check [netcup-coupons.com](https://netcup-coupons.com)

## Changelog

### 1.0.6
- Removed an option to specify external database credentials inside values.
- Renamed secret containing mysql credentials to `renterd-mysql`
- Changed default image from `1.0.5-zen` to `1.0.5` as most users will probably run renterd on mainnet.
- Added option to modify pod's `enableServiceLinks` and disabled it by default.
- Moved all configmaps to separate files

### 1.0.5
- Removed support for `VerticalPodAutoscaler`
- Upgraded `bitnami/mysql` chart to `9.22.0`
Expand Down
30 changes: 0 additions & 30 deletions renterd/templates/configmap.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions renterd/templates/configmaps/renterd-autopilot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: renterd-autopilot
data:
renterd.yml: |
# Managed by Helm - configmap/renterd-autopilot/renterd.yml
{{ with .Values.renterd.autopilot.config }}
autopilot: {{ . | toYaml | nindent 6 }}
{{- end }}
14 changes: 14 additions & 0 deletions renterd/templates/configmaps/renterd-bus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: renterd-bus
data:
renterd.yml: |
# Managed by Helm - configmap/renterd-bus/renterd.yml
bus:
gatewayAddr: "0.0.0.0:{{ .Values.service.bus.port }}"
{{ with .Values.renterd.bus.config }}
{{ . | toYaml | nindent 6 }}
{{- end }}
s3:
enabled: {{ .Values.renterd.s3.enabled }}
12 changes: 12 additions & 0 deletions renterd/templates/configmaps/renterd-worker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: renterd-worker
data:
renterd.yml: |
# Managed by Helm - configmap/renterd-worker/renterd.yml
s3:
enabled: {{ .Values.renterd.s3.enabled }}
{{ with .Values.renterd.workers.config }}
worker: {{ . | toYaml | nindent 6 }}
{{- end }}
9 changes: 9 additions & 0 deletions renterd/templates/configmaps/renterd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: renterd
data:
entrypoint.sh: |
#!/bin/sh
# Managed by Helm - configmap/renterd/entrypoint.sh
exec renterd -http=':{{ .Values.service.http.port }}' -s3.address=':{{ .Values.service.s3.port }}' "$@"
20 changes: 0 additions & 20 deletions renterd/templates/secrets/renterd-bus-env.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions renterd/templates/secrets/renterd-mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ if .Values.mysql.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: renterd-mysql
type: Opaque
data:
RENTERD_DB_URI: {{ "mysql:3306" | b64enc | quote }}
RENTERD_DB_USER: {{ .Values.mysql.auth.username | b64enc | quote }}
RENTERD_DB_PASSWORD: {{ .Values.mysql.auth.password | b64enc | quote }}
RENTERD_DB_NAME: {{ .Values.mysql.auth.database | b64enc | quote }}
RENTERD_DB_METRICS_NAME: {{ .Values.mysql.auth.databaseMetrics | b64enc | quote }}
{{ end }}
12 changes: 9 additions & 3 deletions renterd/templates/statefulset-renterd-autopilot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ spec:
{{- include "renterd.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: autopilot
annotations:
checksum/configmap-renterd: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/configmap-renterd: {{ include (print $.Template.BasePath "/configmaps/renterd.yaml") . | sha256sum }}
checksum/configmap-renterd-autopilot: {{ include (print $.Template.BasePath "/configmaps/renterd-autopilot.yaml") . | sha256sum }}
spec:
automountServiceAccountToken: {{ .Values.renterd.autopilot.automountServiceAccountToken }}
enableServiceLinks: {{ .Values.renterd.autopilot.enableServiceLinks }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down Expand Up @@ -61,8 +63,8 @@ spec:
- mountPath: "/data"
name: renterd-data-emptydir
- mountPath: "/data/renterd.yml"
name: renterd-config
subPath: "renterd.autopilot.yml"
name: renterd-autopilot-config
subPath: "renterd.yml"
- mountPath: "/entrypoint.sh"
name: renterd-config
subPath: "entrypoint.sh"
Expand Down Expand Up @@ -97,6 +99,10 @@ spec:
configMap:
name: renterd
defaultMode: 0755
- name: renterd-autopilot-config
configMap:
name: renterd-autopilot
defaultMode: 0755
- name: renterd-data-emptydir
emptyDir:
medium: "Memory"
Expand Down
16 changes: 11 additions & 5 deletions renterd/templates/statefulset-renterd-bus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ spec:
{{- include "renterd.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: bus
annotations:
checksum/configmap-renterd: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secret-renterd-bus-env: {{ include (print $.Template.BasePath "/secrets/renterd-bus-env.yaml") . | sha256sum }}
checksum/configmap-renterd: {{ include (print $.Template.BasePath "/configmaps/renterd.yaml") . | sha256sum }}
checksum/configmap-renterd-bus: {{ include (print $.Template.BasePath "/configmaps/renterd-bus.yaml") . | sha256sum }}
checksum/secret-renterd-mysql: {{ include (print $.Template.BasePath "/secrets/renterd-mysql.yaml") . | sha256sum }}
spec:
automountServiceAccountToken: {{ .Values.renterd.bus.automountServiceAccountToken }}
enableServiceLinks: {{ .Values.renterd.bus.enableServiceLinks }}
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down Expand Up @@ -58,16 +60,16 @@ spec:
- mountPath: "/data"
name: renterd-bus-data
- mountPath: "/data/renterd.yml"
name: renterd-config
subPath: "renterd.bus.yml"
name: renterd-bus-config
subPath: "renterd.yml"
- mountPath: "/entrypoint.sh"
name: renterd-config
subPath: "entrypoint.sh"
envFrom:
- secretRef:
name: {{ .Values.renterd.secretName | quote }}
- secretRef:
name: renterd-bus-env
name: renterd-mysql
env:
- name: RENTERD_AUTOPILOT_ENABLED
value: "false"
Expand All @@ -92,6 +94,10 @@ spec:
configMap:
name: renterd
defaultMode: 0755
- name: renterd-bus-config
configMap:
name: renterd-bus
defaultMode: 0755
volumeClaimTemplates:
- metadata:
name: renterd-bus-data
Expand Down
Loading

0 comments on commit bd065ac

Please sign in to comment.