containers: {
  "icinga2-master": {
    image: "ghcr.io/acorn-io/images-mirror/nginx:latest"
    dirs: {
      "/data/var": "volume://icinga-data"
    }
    files: {
      "/data/etc/icinga2/constants.conf": "secret://icinga2-master-constants-file/template"
      "/data/etc/icinga2/conf.d/api-users.conf": "secret://icinga2-master-api-user-file/template"
    }
    env: {
      "ICINGA_MASTER": "1"
      "ICINGA_CN": "icinga2-master"
      "ICINGA_ZONE": "master"
    }
  }
}

volumes: {
  "icinga-data": {
    size: 5G
    accessModes: ["readWriteOnce"]
  }
}

secrets: {
  "icinga2-master-constants-file": {
    type: "template"
    data: {
      template: """
        const PluginDir = "/usr/lib/nagios/plugins"
        const ManubulonPluginDir = "/usr/lib/nagios/plugins"
        const PluginContribDir = "/usr/lib/nagios/plugins"
        const NodeName = "icinga2-master"
        const ZoneName = "master"
        const TicketSalt = "${secret://icinga2-master-ticketsalt/token}"
        """
    }
  }
  "icinga2-master-ticketsalt": {
    type: "token"
    data: {
      token: ""
    }
  }
  "icinga2-master-api-user-file": {
    type: "template"
    data: {
      template: """
        object ApiUser "${secret://icinga2-master-api-user/username}" {
          password = "${secret://icinga2-master-api-user/password}"
          permissions = ["*"]
        }
        """
    }
  }
  "icinga2-master-api-user": {
    type: "basic"
    data: {
      username: "root"
      password: ""
    }
  }
}