The COVID-19 pandemic has created unusually challenging and dangerous workplace conditions for key workers. This has prompted calls for key workers to receive a variety of special benefits over and above their normal pay. Here, we consider whether two such benefits are justified: a no-fault compensation scheme for harm caused by an epidemic and hazard pay for the risks and burdens of working during an epidemic. Both forms of benefit are often made available to members of the armed forces for the harms, risks and burdens that come with military service. We argue from analogy that these benefits also ought to be provided to key workers during an epidemic because, like the military, key workers face unavoidable harms, risks and burdens in providing essential public good. The amount of compensation should be proportional to the harm suffered and the amount of hazard pay should be proportional to the risk and burden endured. Therefore, key workers should receive the same amount of compensation and hazard pay as the military where the harms, risks and burdens are equivalent. In the UK, a form of no-fault compensation has recently been made available to the surviving families of key workers who suffer fatal COVID-19 infections. According to our argument, however, it is insufficient because it offers less to key workers than is made available to the families of armed services personnel killed on duty.