Hi,
I'm attempting to execute your helm chart on kubernetes cluster v1.22.4.
There were a few issues with the Igress template "api-version" and the 'persistentVolumeClaim' declaration inside the deployment template.
I've made the following modifications to the deployment template, according to the official documentations:
{{- if .Values.bot.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: freqtrade
spec:
selector:
matchLabels:
app: freqtrade
template:
metadata:
labels:
app: freqtrade
spec:
containers:
- name: freqtrade
image: {{ .Values.image.base }}:{{ .Values.image.tag }}
command:
- freqtrade
args:
- trade
- --config
- /freqtrade/config/config.json
- --strategy
- {{ .Values.bot.strategy_name }}
- --db-url
- sqlite:////sqlite/tradesv3.sqlite
volumeMounts:
- mountPath: /freqtrade/config
name: config
- mountPath: /freqtrade/user_data/strategies
name: strategies
- mountPath: /sqlite
name: sqlite
ports:
- name: api
containerPort: 8080
volumes:
- name: config
configMap:
name: freqtrade-config
- name: strategies
configMap:
name: freqtrade-strategies
- name: sqlite
persistentVolumeClaim:
claimName: freqtrade-sqlite
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: freqtrade-sqlite
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.bot.pvc_size }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: freqtrade-pv
spec:
storageClassName: manual
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /sqlite
{{- end }}
When I run the helm chart I can see that the PersistentVolume is created:
kubectl get pv freqtrade-pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
freqtrade-pv 1Gi RWO Retain Bound default/freqtrade-sqlite manual 5m10s
And the PersistentVolumeClaim is also created:
kubectl get pvc freqtrade-sqlite
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
freqtrade-sqlite Bound freqtrade-pv 1Gi RWO manual 6m24s
but the pod doesn't start to run with the error:
2021-11-23 04:31:48,036 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2021-11-23 04:31:48,036 - freqtrade.exchange.exchange - INFO - Using CCXT 1.61.24
2021-11-23 04:31:48,036 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True, 'rateLimit': 3100}
2021-11-23 04:31:48,040 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True, 'rateLimit': 3100}
2021-11-23 04:31:48,044 - freqtrade.exchange.exchange - INFO - Using Exchange "FTX"
2021-11-23 04:31:54,876 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Ftx'...
2021-11-23 04:31:54,888 - freqtrade.commands.trade_commands - ERROR - (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/14/e3q8)
2021-11-23 04:31:54,888 - freqtrade.commands.trade_commands - ERROR - Fatal exception!
I've checked the worker node where the pod is deployed and it created a '/sqlite' folder with root ownership.
When I attempt to create an empty sqlite DB file, using the 'sqlite3 file.db "VACUUM;"' command and placing
it in the node's '/sqlite' folder I get an error:
freqtrade.commands.trade_commands - ERROR - (sqlite3.OperationalError) attempt to write a readonly database
I attempted to give ownership to the folder to the local user / ftuser I get the following error:
trade.commands.trade_commands - ERROR - (sqlite3.OperationalError) unable to open database file
What am I doing wrong?
Can you please assist?