I am using Kubernetes for deployment, but not able to retain data #577
-
Describe the bugI am using Kubernetes for deployment but afraid if the node goes down my data will be lost, I want to retain data for last one week, by somehow mounting of volume. What do you see?I am using Kubernetes for deployment but afraid if the node goes down my data will be lost, I want to retain data for last one week, by somehow mounting of volume. What do you expect to see?I want to retain the data even if node goes down List the steps that must be taken to reproduce this issueJust kill the node and data is gone Versionlatest Additional informationpls comment ASAP, need this on enterprise level |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 2 replies
-
The docs have this full explanation about it. You can configure an external database as such as Postgres. To production environment the basis is to use a CSI with HA in those disks. If your cluster goes down the storage still intact |
Beta Was this translation helpful? Give feedback.
-
@antikilahdjs I can see some examples for using storage with docker compose configuration, could you pls point out if there's any documentation for using storage with Kubernetes. |
Beta Was this translation helpful? Give feedback.
-
We hosted gatus app on our EKS and we are able to monitor all our live URLs without any issues. But Health check API data is getting deleted when gatus pod get crashed\delete and due to that we are unable to refer old data if thr r any issues with specific API URL in the past from gatus console. I have tried with below deployment yaml which have both gatus and postgres DB containers with ebs based PVC cliam but still data is not retaining when gatus pod goes down. Anyone tried to deploy gatus tool with PVC to retain health chks api data?
|
Beta Was this translation helpful? Give feedback.
-
Hello, I don't if I got it but it is about gatus or pvc? For example, in gatus doc it is possible to point it to postgres and I did it before then it worked fine but I've decided put it in my CSI because I have the PROD environment with WEKA. My cluster has large storage replication with the same point of access. If you use the OpenEBS for example it will mount in each node and in that case if the server crash you will lose it . Today I using this configuration below. storage:
caching: false
path: /data/gatus.db
type: sqlite Inside of the pod the path is /data but for in my CSI is /data/weka and all my gatus has a PVC attached then my data will be instacted, it is the normal way for all deployment and so on If you need put it in own database the gatus just support postgres storage:
type: postgres
path: "postgres://user:password@127.0.0.1:5432/gatus?sslmode=disable" |
Beta Was this translation helpful? Give feedback.
-
Can you format your configuration properly? (Wrap it using ```) At a glance, it seems like the problem has to do with your storage configration. It should be
But instead, you're putting it in a storage.yaml file:
|
Beta Was this translation helpful? Give feedback.
-
I have tried with below config as u suggested but still data is not retaining. Any other suggestions? i have updated the complete using code in my previous post.
|
Beta Was this translation helpful? Give feedback.
-
Currently gatus dashboard is not showing past data if gatus pod goes down and i am trying to ensure my gatus dashboard shows old data even gatus pod get terminated/re-created. I am trying to retain the data with postgres db container which "/var/lib/postgresql" folder is mounted on ebs based PVC. I can see DB level is retaining on pv cliam but gatus container is not storing any data on postgres data folder. I believe gatus is not able to use postgres container for some reason to store the data.
|
Beta Was this translation helpful? Give feedback.
-
It's because you're not formatting the configuration properly. It should look like this: kind: ConfigMap
metadata:
name: gatus
namespace: kube-system
data:
config.yaml: |
metrics: true
storage:
type: postgres
path: "postgres://username:password@postgres:5432/gatus?sslmode=disable"
endpoints:
- name: website
url: https://twin.sh/health
interval: 5m
conditions:
- "[STATUS] == 200"
- "[BODY].status == UP"
- name: github
url: https://api.github.com/healthz
interval: 5m
conditions:
- "[STATUS] == 200" |
Beta Was this translation helpful? Give feedback.
It's because you're not formatting the configuration properly.
It should look like this: