@@ -97,3 +97,43 @@ The configurations set by environment variables override the ones set by YAML.
97
97
| PROMETHEUS_URL | ** Optional.** Prometheus server URL. If not set, metric synchronization is disabled. |
98
98
| PROMETHEUS_USERNAME | ** Optional.** Prometheus username. |
99
99
| PROMETHEUS_PASSWORD | ** Optional.** Prometheus password. |
100
+
101
+ ## Multiple Clusters
102
+
103
+ ### Systemd
104
+
105
+ If you are running Icinga for Kubernetes with systemd, you have to follow these steps.
106
+
107
+ #### Create Instance
108
+
109
+ 1 . Create a new or edit the provided ` default.env ` file in ` /etc/icinga-kubernetes ` .
110
+ The file name will be the instance name for the systemd service. For example ` test-cluster.env ` will
111
+ start the service ` icinga-kubernetes@test-cluster ` .
112
+ 2 . Set the ` KUBECONFIG ` env to configure how Icinga for Kubernetes can connect to the cluster.
113
+ 3 . Set the ` ICINGA_FOR_KUBERNETES_CLUSTER_NAME ` env to configure the cluster name. If the env is not set
114
+ the cluster name will be the .env file name.
115
+ 4 . You can add additional envs to override the ` config.yml ` (look above to see more information about available envs).
116
+ 5 . Reload the systemd daemon with ` systemctl daemon-reload ` to recognize the new cluster configs.
117
+ 6 . Restart the Icinga for Kubernetes service with ` systemctl restart icinga-kubernetes ` .
118
+
119
+ An example ` test-cluster.env ` file could look like this:
120
+ ``` bash
121
+ KUBECONFIG=/home/user/.kube/config
122
+ ICINGA_FOR_KUBERNETES_CLUSTER_NAME=" Test Cluster"
123
+ ICINGA_FOR_KUBERNETES_PROMETHEUS_URL=http://localhost:9090
124
+ ```
125
+
126
+ #### Remove Instance
127
+
128
+ 1 . Remove the corresponding file from ` /etc/icinga-kubernetes ` .
129
+ 2 . Reload the systemd daemon with ` systemctl daemon-reload ` to make sure the daemon forgets the file.
130
+ 3 . Stop the service instance manually. For ` test-cluster ` it would be ` systemctl stop icinga-kubernetes@test-cluster ` .
131
+
132
+ !!! Warning
133
+
134
+ If you stop the service without removing the env file, the instance will restart when the service is restarted.
135
+
136
+ !!! Warning
137
+
138
+ If you remove the env file without stopping the instance, the instance will try to restart and
139
+ fail when the service is restarted.
0 commit comments