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

Grafana-agent-operator: ability to run Integration as a StatefulSet #4763

Open
james-callahan opened this issue Aug 9, 2023 · 2 comments
Open
Labels
enhancement New feature or request operator Grafana Agent Operator related variant/operator Related to Grafana Agent Static Operator.

Comments

@james-callahan
Copy link
Contributor

Request

When trying to run eventhandler as a logs integration, we need a volume to store the event cache.
I'm creating this with a PVC and attaching it to the Integration:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grafana-agent-eventhandler
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: monitoring.grafana.com/v1alpha1
kind: Integration
metadata:
  name: eventhandler
  labels:
    grafana-agent: logs
spec:
  config:
    cache_path: /etc/eventhandler/eventhandler.cache
    logs_instance: default/grafana-agent-logs
  name: eventhandler
  type:
    unique: true
  volumeMounts:
    - mountPath: /etc/eventhandler
      name: eventhandler-cache
  volumes:
    - name: eventhandler-cache
      persistentVolumeClaim:
        claimName: grafana-agent-eventhandler

However, the integration runs as a Deployment, and when a new pod comes up (e.g. due to other changes such as a new grafana agent version), then the new pod comes up but is unable to mount the volume as it is already in use.

My first preference would be to be have the integration as a StatefulSet instead.

Second prize would be to at least be able to set the Deployment's strategy.type to Recreate instead of the default of RollingUpdate.

Use case

Stateful integrations.

@james-callahan james-callahan added the enhancement New feature or request label Aug 9, 2023
@github-actions
Copy link
Contributor

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

@github-actions github-actions bot added the needs-attention An issue or PR has been sitting around and needs attention. label Sep 15, 2023
@rfratto rfratto added operator Grafana Agent Operator related and removed type/operator labels Nov 2, 2023
@morsik
Copy link

morsik commented Dec 17, 2023

Just went to identical issue.

It's even in official documentation that eventhandler should be run as StatefulSet: https://grafana.com/docs/agent/latest/static/configuration/integrations/integrations-next/eventhandler-config/ but this limitation makes it impossible.

To use the cache feature and maintain state in a Kubernetes environment, a StatefulSet must be used.

@rfratto rfratto added the variant/operator Related to Grafana Agent Static Operator. label Apr 9, 2024
@github-actions github-actions bot removed the needs-attention An issue or PR has been sitting around and needs attention. label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request operator Grafana Agent Operator related variant/operator Related to Grafana Agent Static Operator.
Projects
No open projects
Development

No branches or pull requests

3 participants