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

Option to ignore offline servers #315

Closed
leventdev opened this issue Feb 14, 2024 · 2 comments
Closed

Option to ignore offline servers #315

leventdev opened this issue Feb 14, 2024 · 2 comments

Comments

@leventdev
Copy link
Contributor

When deploying an app that uses Pulse on Kubernetes, every time there's a new deployment, the host name changes and shows as a new server.
This quickly clutters up the pulse site, and even after enough time passes to not have any server data from the selected period (1H, 6H, 24H, 7D), the server is still visible as offline.
It would be neat to have a configuration option for ignoring offline servers all together, or at least after there's no more data from them from the selected time period.
Example screenshot:
image

@driesvints
Copy link
Member

I think we'd appreciate a PR for this, thanks!

@DellanX
Copy link

DellanX commented Mar 25, 2024

Something to add to this, for future developers planning to add Pulse to their Kubernetes cluster, is to set the PULSE_SERVER_NAME to be the node name, which you can do by adding the following snippet to your container spec:

          env:
            - name: PULSE_SERVER_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName

Furthermore, if you use a Daemon Set instead of a deployment, you can configure there to be exactly one pulse service per node.

This is my configuration:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ .Release.Name }}-pulse-check-default
  labels:
    tier: backend
    layer: pulse-check
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: backend
      layer: pulse-check
  template:
    metadata:
      labels:
        tier: backend
        layer: pulse-check
    spec:
      imagePullSecrets:
        - name: {{ .Release.Name }}-registry-key
      containers:
        - name: pulse-check
          image: <docker-registry>:{{ .Values.version }}
          command:
            - php
          args:
            - artisan
            - pulse:check
          ports:
            - containerPort: 9000
          env:
            - name: PULSE_SERVER_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          envFrom:
            - configMapRef:
                name: {{ .Release.Name }}
            - secretRef:
                name: {{ .Release.Name }}

This will prevent a new server entry from being created each time you update your code 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants