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

Add docs for instantiated systemd services #172

Open
wants to merge 1 commit into
base: config-from-env
Choose a base branch
from

Conversation

jrauh01
Copy link
Collaborator

@jrauh01 jrauh01 commented Jan 28, 2025

This PR documents how to run multiple service instances to monitor multiple clusters.

Closes #164

@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Jan 28, 2025
@jrauh01 jrauh01 force-pushed the systemd-instantiated-service branch 4 times, most recently from a31bee6 to 33f861d Compare January 30, 2025 12:51
@jrauh01 jrauh01 changed the base branch from main to config-from-env January 30, 2025 12:52
@jrauh01 jrauh01 force-pushed the systemd-instantiated-service branch from 33f861d to e930954 Compare January 30, 2025 14:20
@jrauh01 jrauh01 changed the title Add instantiated systemd service Add docs for instantiated systemd services Jan 30, 2025
Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

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

As stated in the change requests, please also adjust https://github.com/Icinga/icinga-kubernetes/blob/main/doc/02-Installation.md#running-icinga-for-kubernetes. README.md also needs to be adjusted, but we will do that after the changes to 01-About.md are fine.

doc/01-About.md Outdated
@@ -29,6 +29,8 @@ each connecting to a different cluster but writing data into the same database.
The web interface accesses this database to display resource information and state,
offering the flexibility to view aggregated data from all clusters or focus on a specific cluster.
This setup ensures scalable monitoring and a unified view of resources across multiple Kubernetes environments.
To monitor multiple clusters you have to
Copy link
Member

Choose a reason for hiding this comment

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

I would rewrite the whole paragraph to better describe the two options for multi-cluster support:

  1. The Icinga for Kubernetes daemon is installed in different clusters and all daemons connect to a database outside the clusters via an external service. The web interface is also located outside the clusters.
  2. All components run outside the Kubernetes clusters and multi-cluster support is provided via instantiated systemd services.

(this text is not intended for copy and paste)


## Multiple Clusters

### Systemd
Copy link
Member

Choose a reason for hiding this comment

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

There is no need to have this as a subheading as there is no other option that needs to be described here. I would simply use Multi-Cluster Support using systemd Instantiated Services.


### Systemd

If you are running Icinga for Kubernetes with systemd, you have to follow these steps.
Copy link
Member

Choose a reason for hiding this comment

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

I would replace this with an introduction, e.g. that since version 0.3 we use systemd-instantiated services for multi-cluster support and that it is possible to connect to multiple Kubernetes clusters when running Icinga for Kubernetes components outside of Kubernetes clusters. I would explain that we manage instances with env files and how these files/instances work in general, also that it is intended to put KUBECONFIG there but that it is also possible to override any other configuration, that the cluster name is derived from the env filename but can also be overridden with ICINGA_FOR_KUBERNETES_CLUSTER_NAME and that the cluster name is used in the frontend.

Then I would explain the purpose of the default.env in a subheading as it needs to be linked to our installation docs which also need to be adjusted.

Then I would explain how to add a new instance like you did with test-cluster.

2. Reload the systemd daemon with `systemctl daemon-reload` to make sure the daemon forgets the file.
3. Stop the service instance manually. For `test-cluster` it would be `systemctl stop icinga-kubernetes@test-cluster`.

!!! Warning
Copy link
Member

Choose a reason for hiding this comment

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

I would combine the warnings.


#### Remove Instance

1. Remove the corresponding file from `/etc/icinga-kubernetes`.
Copy link
Member

Choose a reason for hiding this comment

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

The order does not seem logical to me. I would first stop the service, then remove the file and then reload the systemd daemon.

@jrauh01 jrauh01 force-pushed the systemd-instantiated-service branch 8 times, most recently from 2707cc5 to aef4ca1 Compare February 19, 2025 09:15
@jrauh01 jrauh01 force-pushed the systemd-instantiated-service branch from aef4ca1 to 9fe0599 Compare February 19, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants