This is not a complete answer to your question but only works under the extra condition that $n\leq2k$.
Flip a fair coin again and again (so do not stop).
Let $A_{k,n}$ denote the event that among the first $n$ tosses there is a consecutive sequence of at least $k$ heads.
Let $T$ denote the index of the first occurence of a tail (so e.g. $T=4$ iff the sequence starts with $HHHT$).
Then $P(T=t)=2^{-t}$.
We find that $P(A_{k,n}\mid T=t)=1$ if $t>k$ and $P(A_{k,n}\mid T=t)=P(A_{k,n-t})$ otherwise.
Based on that we find:$$P(A_{k,n})=\sum_{t=1}^{\infty}P(A_{k,n}\mid T=t)P(T=t)=\sum_{t=1}^kP(A_{k,n-t})2^{-t}+\sum_{t=k+1}^{\infty}2^{-t}=\sum_{t=1}^kP(A_{k,n-t})2^{-t}+2^{-k}$$where $A_{k,n-t}=\varnothing$ and consequently $P(A_{k,n-t})=0$ if $k>n-t$.
Based on this equality by induction it can be proved that:
$$P(A_{k,n})=2^{-k}\left(\frac12n-\frac12k+1\right)\text{ for }n\in\{k,k+1,\dots,2k\}\tag1$$
As base case we have $P(A_{k,k})=2^{-k}$ by substitution $n=k$ and it is evident that this is correct.
Presupposing that the equality holds for every $n\in\{k,k+1,\dots,m-1\}$ where $k<m\leq2k$ we find:$$P(A_{k,m})=\sum_{t=1}^kP(A_{k,m-t})2^{-t}+2^{-k}=\sum_{t=1}^{m-k}P(A_{k,m-t})2^{-t}+2^{-k}=\sum_{n=k}^{m-1}P(A_{k,n})2^{n-m}+2^{-k}=$$$$2^{-k}\sum_{n=k}^{m-1}\left(\frac12n-\frac12k+1\right)2^{n-m}+2^{-k}=2^{-k}\left(\frac12m-\frac12k+1\right)$$
If the coin is unfair and there is a probability of $p$ on heads and $q=1-p$ on tails then the same route can be followed to arrive at the more general formula:
$$P\left(A_{k,n}\right)=p^{k}\left(\left(n-k\right)q+1\right)\text{ for }n\in\{k,k+1,\dots,2k\}$$
Also see this question.