Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deploy] Add Kubernetes deployment file #2041

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions octobot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: octobot
name: octobot
spec:
ports:
- port: 5001
selector:
service: octobot
type: LoadBalancer

---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
service: octobot
name: octobot
spec:
replicas: 1
selector:
matchLabels:
service: octobot
strategy:
type: Recreate
template:
metadata:
labels:
service: octobot
spec:
containers:
- image: drakkarsoftware/octobot:stable
name: octobot
ports:
- containerPort: 5001
name: octobot
env:
- name: IS_CLOUD_ENV
value: "true"
volumeMounts:
- mountPath: /octobot/logs
name: octobot-logs
- mountPath: /octobot/backtesting
name: octobot-backtesting
- mountPath: /octobot/tentacles
name: octobot-tentacles
- mountPath: /octobot/user
name: octobot-user
restartPolicy: Always
volumes:
- name: octobot-logs
emptyDir: {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does that mean we not save logs for an execution to another ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logs will also be retrieved with the console output of the containers so I don't think we need to store them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console output has to be as detailed as the logfiles one for kub in this case 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to store hundreds of megabytes per bot per day with the DEBUG level.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not be that much, it's reduced by a lot now. For example right now I have a 1h runing bot with 31Ko logs. It's to be analysed if we need debug logs or not I think in cloud bots

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be easier to have the logs collected in the output of the console even if it means modifying the logs level when we are in the cloud. It will be much simpler rather than going to recover log files if needed

- name: octobot-backtesting
persistentVolumeClaim:
claimName: octobot-backtesting
- name: octobot-tentacles
persistentVolumeClaim:
claimName: octobot-tentacles
- name: octobot-user
persistentVolumeClaim:
claimName: octobot-user

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
service: octobot
name: octobot-backtesting
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi

---
apiVersion: v1
kind: PersistentVolumeClaim
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata:
labels:
service: octobot
name: octobot-tentacles
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
service: octobot
name: octobot-user
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
Loading