Deploy Checkmk as a Web App for Containers in Azure?


Wondering if someone has been able to do this? Can’t seem to make it work. I’m using this image checkmk/check-mk-raw. It works fine but once I use an Azure storage account and mount it to /omd/sites (as suggested here), I’m getting application error.

I don’t experience this issue when I deploy it in my machine and mounting a path from my computer to the container as a volume.

Logs from the App service:

2019-12-17T02:52:32.123316065Z ### CREATING SITE ‘cmk’
2019-12-17T02:54:05.460462194Z Adding /opt/omd/sites/cmk/tmp to /etc/fstab.
2019-12-17T02:54:05.460508695Z Going to set TMPFS to off.
2019-12-17T02:54:05.461520617Z Traceback (most recent call last):
2019-12-17T02:54:05.461963927Z File “/usr/bin/omd”, line 4676, in
2019-12-17T02:54:05.463480460Z command_function(args, command_options)
2019-12-17T02:54:05.463987571Z File “/usr/bin/omd”, line 2875, in main_create
2019-12-17T02:54:05.465083895Z admin_password = init_site(config_settings, options)
2019-12-17T02:54:05.465575006Z File “/usr/bin/omd”, line 2973, in init_site
2019-12-17T02:54:05.470441012Z chown_tree(g_sitedir, g_sitename)
2019-12-17T02:54:05.471073326Z File “/usr/bin/omd”, line 888, in chown_tree
2019-12-17T02:54:05.471921944Z os.lchown(dirpath + “/” + entry, uid, gid)
2019-12-17T02:54:05.472749963Z OSError: [Errno 1] Operation not permitted: ‘/omd/sites/cmk/bin’

2019-12-17T02:54:24.203780147Z ### STARTING SITE
2019-12-17T02:54:30.391394583Z Creating temporary filesystem /omd/sites/cmk/tmp…mount: can’t find /opt/omd/sites/cmk/tmp in /etc/fstab
2019-12-17T02:54:30.391442484Z WARNING: Could not mount tmpfs. You may either start the container in privileged mode or use the “docker run” option “–tmpfs” to make docker do the tmpfs mount for the site.
2019-12-17T02:54:30.391453684Z WARNING: You may continue without tmpfs, but the performance of Check_MK may be degraded.
2019-12-17T02:54:30.392159800Z Traceback (most recent call last):
2019-12-17T02:54:30.392437306Z File “/usr/bin/omd”, line 4676, in
2019-12-17T02:54:30.393885037Z command_function(args, command_options)
2019-12-17T02:54:30.394199644Z File “/usr/bin/omd”, line 4307, in
2019-12-17T02:54:30.395511673Z lambda args, opts: main_init_action(“start”, args, opts), [
2019-12-17T02:54:30.395833380Z File “/usr/bin/omd”, line 3539, in main_init_action
2019-12-17T02:54:30.398999549Z exit_status = init_action(command, args, options)
2019-12-17T02:54:30.399308156Z File “/usr/bin/omd”, line 2393, in init_action
2019-12-17T02:54:30.400611284Z prepare_and_populate_tmpfs(g_sitename)
2019-12-17T02:54:30.400909891Z File “/usr/bin/omd”, line 1675, in prepare_and_populate_tmpfs
2019-12-17T02:54:30.401810210Z chown_tree(tmp, sitename)
2019-12-17T02:54:30.402111217Z File “/usr/bin/omd”, line 888, in chown_tree
2019-12-17T02:54:30.402731531Z os.lchown(dirpath + “/” + entry, uid, gid)
2019-12-17T02:54:30.403503847Z OSError: [Errno 1] Operation not permitted: ‘/omd/sites/cmk/tmp/icinga’

2019-12-17T02:54:49.531010786Z ### STARTING SITE
2019-12-17T02:54:54.943796199Z /omd/sites/cmk/etc/rc.d/10-mkeventd: line 13: /omd/sites/cmk/etc/omd/site.conf: No such file or directory
2019-12-17T02:57:51.564719861Z Creating temporary filesystem /omd/sites/cmk/tmp…Starting mkeventd…OK
2019-12-17T02:57:52.278311844Z /omd/sites/cmk/etc/rc.d/20-rrdcached: line 16: /omd/sites/cmk/etc/omd/site.conf: No such file or directory
2019-12-17T02:57:55.989211882Z rrdcached: bind(/omd/sites/cmk/tmp/run/rrdcached.sock) failed: Operation not permitted.
2019-12-17T02:57:55.990038800Z rrdcached: FATAL: cannot open any listen sockets
2019-12-17T02:57:56.021870895Z rrdcached: daemonize failed, exiting.
2019-12-17T02:57:56.056630154Z Starting rrdcached…Error
2019-12-17T02:57:56.620166360Z /omd/sites/cmk/etc/rc.d/50-npcd: 20: .: Can’t open etc/omd/site.conf
2019-12-17T02:57:57.499350460Z /omd/sites/cmk/etc/rc.d/52-pnp_gearman_worker: line 18: etc/omd/site.conf: No such file or directory
2019-12-17T02:57:59.973303285Z /omd/sites/cmk/etc/rc.d/80-icinga: line 40: etc/omd/site.conf: No such file or directory
2019-12-17T02:58:02.765741966Z /omd/sites/cmk/etc/rc.d/80-nagios: line 40: etc/omd/site.conf: No such file or directory

When I go back to my storage account, I can see the cmk folder and subfolders created.

Thanks in advance.