As explained in the answer above, your process is equivalent
to build all possible binary strings of length $n=m+s$ , with $m$ zeros = blue balls and $s$ ones = red balls.
Each different string is considered equi-probable.
Let me use the parameters $n,m,s$ defined as above (instead of your $n, n-k,k$) so as
to keep congruency with the reference I am going to cite.
Now we want to count the strings having at least one run of $r$ consecutive ones and no longer than that.
This will include the strings in which the $r$ run occurs at the beginning and/or at the end of the string, in which case
such runs will not be comprised between two zeros.
I will explain later how to account for only the runs comprised between two zeros, if that is what you need.
Then, as explained in my answer to this other post, the
number of binary strings, with $s$ ones and $m$ zeros, having at least one run of $r$ consecutive ones, and not longer
is given by
$$N_b(s,r,m+1)-N_b(s,r-1,m+1)$$
where
$$N_{\,b} (s,r,m+1) = \text{No}\text{. of solutions to}\;\left\{ \begin{gathered}
0 \leqslant \text{integer }x_{\,j} \leqslant r \hfill \\
x_{\,1} + x_{\,2} + \cdots + x_{\,m+1} = s \hfill \\
\end{gathered} \right.$$
which as explained in this other post is expressed as
$$
N_b (s,r,m + 1)\quad \left| {\;0 \leqslant \text{integers }s,m,r} \right.\quad = \sum\limits_{\left( {0\, \leqslant } \right)\,\,k\,\,\left( { \leqslant \,\frac{s}
{r}\, \leqslant \,m + 1} \right)} {\left( { - 1} \right)^k \left( \begin{gathered}
m + 1 \\
k \\
\end{gathered} \right)\left( \begin{gathered}
s + m - k\left( {r + 1} \right) \\
s - k\left( {r + 1} \right) \\
\end{gathered} \right)}
$$
whose generating function in $s$ is
$$
F_b (x,r,m + 1) = \sum\limits_{0\,\, \leqslant \,\,s\,\,\left( { \leqslant \,\,r\,\left( {m + 1} \right)} \right)} {N_b (s,r,m + 1)\;x^{\,s} } = \left( {\frac{{1 - x^{\,r + 1} }}
{{1 - x}}} \right)^{m + 1}
$$
If, instead, you want to count the strings in which the runs are only those comprised between two zeros,
then take $2$ of the $m$ zeros and fix them to be at the beginning and at the end of the actual sub-string to be considered for counting the runs.
After that put $p$ ones at the beginning (before the zero), $q$ ones at the very end, and $s-p-q$ in the substring.
That means to count as above for the strings with $s-p-q$ ones and $m-2$ zeros, and sum over $p$ and $q$.
So, the
number of binary strings, with $s$ ones and $m$ zeros, having runs of consecutive ones with length up to $r$ ,
but counting only the runs comprised between two zeros
will be
$$
\begin{gathered}
N(s,r,m) = \sum\limits_{\left\{ \begin{subarray}{l}
p,q \\
0\, \leqslant \,p + q\, \leqslant \,s
\end{subarray} \right.} {N_b (s - p - q,r,m - 1)} = \hfill \\
= \sum\limits_{\left\{ \begin{subarray}{l}
p,q \\
\,p + q\, = \,t
\end{subarray} \right.} {\sum\limits_{0\, \leqslant \,t\, \leqslant \,s} {N_b (s - t,r,m - 1)} } = \sum\limits_{\left\{ \begin{subarray}{l}
p,q \\
\,p + q\, = \,s - t
\end{subarray} \right.} {\sum\limits_{0\, \leqslant \,t\, \leqslant \,s} {N_b (t,r,m - 1)} } = \hfill \\
= \sum\limits_{0\, \leqslant \,t\, \leqslant \,s} {\left( {t + 1} \right)N_b (s - t,r,m - 1)} = \sum\limits_{0\, \leqslant \,t\, \leqslant \,s} {\left( {s - t + 1} \right)N_b (t,r,m - 1)} = \hfill \\
= \sum\limits_{\left( {0\, \leqslant } \right)\,\,k\,\,\left( { \leqslant \,t/r\, \leqslant \,m - 1} \right)} {\left( { - 1} \right)^k \left( \begin{gathered}
m - 1 \\
k \\
\end{gathered} \right)\sum\limits_{0\, \leqslant \,t\, \leqslant \,s} {\left( {s - t + 1} \right)\left( \begin{gathered}
t + m - 2 - k\left( {r + 1} \right) \\
t - k\left( {r + 1} \right) \\
\end{gathered} \right)} } = \hfill \\
= \sum\limits_{\left( {0\, \leqslant } \right)\,\,k\,\,\left( { \leqslant \,t/r\, \leqslant \,m - 1} \right)} {\left( { - 1} \right)^k \left( \begin{gathered}
m - 1 \\
k \\
\end{gathered} \right)\sum\limits_{\left( {0\, \leqslant } \right)\,t\,\left( { \leqslant \,s} \right)} {\left( \begin{gathered}
s - t + 1 \\
s - t \\
\end{gathered} \right)\left( \begin{gathered}
t + m - 2 - k\left( {r + 1} \right) \\
t - k\left( {r + 1} \right) \\
\end{gathered} \right)} } = \hfill \\
= \sum\limits_{\left( {0\, \leqslant } \right)\,\,k\,\,\left( { \leqslant \,t/r\, \leqslant \,m - 1} \right)} {\left( { - 1} \right)^k \left( \begin{gathered}
m - 1 \\
k \\
\end{gathered} \right)\left( \begin{gathered}
s + m - k\left( {r + 1} \right) \\
s - k\left( {r + 1} \right) \\
\end{gathered} \right)} \hfill \\
\end{gathered}
$$
Also, since we may write $N(s,r,m)$ as a double summation of $N_b(s,r,m-1)$
$$
\begin{gathered}
N(s,r,m) = \sum\limits_{\left\{ \begin{subarray}{l}
p,q \\
0\, \leqslant \,p + q\, \leqslant \,s
\end{subarray} \right.} {N_b (s - p - q,r,m - 1)} = \hfill \\
= \sum\limits_{0\, \leqslant \,s - p\, \leqslant \,s} {\sum\limits_{0\, \leqslant \,a\, \leqslant \,s - p} {N_b (a,r,m - 1)} } = \sum\limits_{0\, \leqslant \,b\, \leqslant \,s} {\sum\limits_{0\, \leqslant \,a\, \leqslant \,b} {N_b (a,r,m - 1)} } \hfill \\
\end{gathered}
$$
then its generating function will be
$$
G(x,r,m) = \sum\limits_{0\,\, \le \,\,s\,\,\left( { \le \,\,r\,\left( {m - 1} \right)} \right)} {N(s,r,m)\;x^{\,s} } = \frac{1}{{\left( {1 - x} \right)^2 }}\left( {\frac{{1 - x^{\,r + 1} }}{{1 - x}}} \right)^{m - 1}
$$
confirming that given by Fimpellizieri.
Finally, the number of strings whose maximum run length is exactly $r$ will obviously be $N(s,r,m)-N(s,r-1,m)$.