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