Сonsider the "maximal" case $\dim K=n-1$. That is, $$K=\{a\}^\perp:=\{x\in\mathbb{R}^n:(a,x)=0\}\quad\text{for some}\quad a\in\mathbb{R}^n,\ a\neq 0.$$
If $a_j=0$ for some $j$, then the choice $x_j=-1$ and $x_i=0$ for $i\neq j$ violates the conditions on $K$. Similarly, if $a_j<0<a_k$ for some $j\neq k$, choose $x_j=-a_k$, $x_k=a_j$, and $x_i=0$ for $i\notin\{j,k\}$. Thus, replacing $a$ by $-a$ if necessary, we may assume that $a_i>0$ for each $i$.
For $\lambda>0$, the function $t\mapsto e^t-\lambda t$ (here $t\in\mathbb{R}$) has a global minimum at $t=\log\lambda$. Hence the function $f(x)-\lambda(a,x)$ has a global minimum (in $\mathbb{R}^n$) at $x=x^\star$, where $x_i^\star=\log(\lambda a_i)$.
Now choose $\lambda$ so that $x^\star\in K$. That is, take $$\lambda=\exp\left(-\frac{\sum_{i=1}^n a_i\log a_i}{\sum_{i=1}^n a_i}\right).$$ Then for $x\in K$ $$f(x)=f(x)-\lambda(a,x)\geqslant f(x^\star)-\lambda(a,x^\star)=f(x^\star).$$
To be continued, to consider the general case...