PUMaC 2017 Individual A Problem 1

Let \mathcal{X}=\{1,2, \ldots, 2017\}. Let k be a positive integer. Given any r such that 1 \leq r \leq k, there exist k subsets of \mathcal{X} such that the union of any r of them is equal to \mathcal{X}, but the union of any fewer than r of them is not equal to \mathcal{X}. Find, with proof, the greatest possible value for k.