Hi folks,
I’m stuck in a rabbit hole since a few hours. I’m using a AKS Cubernetes Cluster and want to monitor it via the Module Icinga for Kubernetes. I installed the packages via apt-install as written in the documentation.
I made a empty database that is on my localhost and accessible.
I made a configuration file for my database (I checked that the database is accessible):
config.yml:
# This is the configuration file for Icinga for Kubernetes.
# Connection configuration for the database to which Icinga for Kubernetes synchronizes data.
# This is also the database used in Icinga for Kubernetes Web to view and work with the data.
database:
# Database type. Only 'mysql' is supported yet which is the default.
# type: mysql
# Database host or absolute Unix socket path.
host: localhost
# Database port. By default, the MySQL port.
# port:
# Database name.
database: kubernetes
# Database user.
user: kubernetes
# Database password.
password: test
Where I’m stuck since a few hours now is the start of the service.
If I run systemctl enable --now icinga-kubernetes I get the following error:
Jul 25 10:58:12 dev-icinga2 systemd[1]: icinga-kubernetes.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
× icinga-kubernetes.service - Icinga for Kubernetes
Loaded: loaded (/etc/systemd/system/icinga-kubernetes.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/icinga-kubernetes.service.d
└─env.conf
Active: failed (Result: exit-code) since Thu 2024-07-25 10:58:12 UTC; 3s ago
Process: 249820 ExecStart=/usr/sbin/icinga-kubernetes --config /etc/icinga-kubernetes/config.yml (code=exited, status=2)
Main PID: 249820 (code=exited, status=2)
CPU: 655ms
Jul 25 10:58:12 dev-icinga2 icinga-kubernetes[249820]: github.com/icinga/icinga-kubernetes/pkg/sync/controller.go:55 +0x369
Jul 25 10:58:12 dev-icinga2 icinga-kubernetes[249820]: github.com/icinga/icinga-kubernetes/pkg/sync/v1.(*Sync).sync.func3()
Jul 25 10:58:12 dev-icinga2 icinga-kubernetes[249820]: github.com/icinga/icinga-kubernetes/pkg/sync/v1/sync.go:98 +0x46
Jul 25 10:58:12 dev-icinga2 icinga-kubernetes[249820]: golang.org/x/sync/errgroup.(*Group).Go.func1()
Jul 25 10:58:12 dev-icinga2 icinga-kubernetes[249820]: golang.org/x/sync@v0.6.0/errgroup/errgroup.go:78 +0x56
Jul 25 10:58:12 dev-icinga2 icinga-kubernetes[249820]: created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 6
Jul 25 10:58:12 dev-icinga2 icinga-kubernetes[249820]: golang.org/x/sync@v0.6.0/errgroup/errgroup.go:75 +0x96
Jul 25 10:58:12 dev-icinga2 systemd[1]: icinga-kubernetes.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 25 10:58:12 dev-icinga2 systemd[1]: icinga-kubernetes.service: Failed with result 'exit-code'.
Jul 25 10:58:12 dev-icinga2 systemd[1]: Failed to start Icinga for Kubernetes.
root@dev-icinga2:/etc/icinga-kubernetes#
It dosen’t matter if I try it with or without password, with another or empty config file. I tried various versions. Only with a wron password it says me (what it shoud do, that the connection could not be made. I don’t get any error about an INVALIDARGUMENT then. Can anyone tell me what the problem is with the arguments (that I pasted from the example config file)?
My other enviroment variables are stored here:
etc/systemd/system/icinga-kubernetes.service:
[Unit]
Description=Icinga for Kubernetes
After=syslog.target network-online.target mariadb.service postgresql.service
[Service]
Type=notify
User=icinga-kubernetes
Environment="KUBECONFIG=/etc/kubernetes/kubeconfig/kubeconfig-icinga.yaml"
Environment="KUBERNETES_MASTER=https://path-to-my-aks-cluster.hcp.westeurope.azmk8s.io:443"
#ExecStartPre=/bin/sh -c 'echo "KUBECONFIG=$KUBECONFIG" >> /tmp/icinga-kubernetes-env.log'
#ExecStartPre=/bin/sh -c 'ls -l /etc/kubernetes/kubeconfig/kubeconfig-icinga.yaml >> /tmp/icinga-kubernetes-env.log'
ExecStart=/usr/sbin/icinga-kubernetes --config /etc/icinga-kubernetes/config.yml
#ExecStartPost=/bin/sh -c 'cat /tmp/icinga-kubernetes-env.log'
[Install]
WantedBy=multi-user.target
If you need any further informations, please let me know.
Kind regards
Tobias