2. Place the vertices of a triangle on the surface of a sphere so that its smallest side is as large as possible.
Solution. Let the edge length of the cube $K$ be equal to 2. We introduce a rectangular coordinate system such that the points $O(0,0,0), X(2,0,0), Y(0,2,0)$, and $Z(0,0,2)$ are vertices of the cube. The triangle $X Y Z$ is contained within the cube and it holds that

$$
X Y=Y Z=Z X=2 \sqrt{2}
$$

Let us assume that the triangle $A B C$ is contained within the given cube $K$. The planes $x=1, y=1, z=1$ divide the cube into eight smaller cubes with edge length 1. These eight smaller cubes share a common vertex $(1,1,1)$, some of these cubes share a common edge, and some share a common face (see the diagram on the right). Let us consider two of these smaller cubes whose only common point is the vertex $(1,1,1)$. Each of the remaining six smaller cubes shares a common face with one of these two smaller cubes. Therefore, it follows that: If there are two unit cubes whose only common point is the vertex $(1,1,1)$, such that each of them contains at least one vertex of the triangle $A B C$, then some two of the unit points have a common edge and contain at least two vertices of the triangle $A B C$, for example, $A$ and $B$. Then

$$
\min \{A B, B C, C A\} \leq A B \leq \sqrt{1^{2}+1^{2}+2^{2}}=\sqrt{6}<2 \sqrt{2}
$$

It remains to consider the case where each parallelepiped formed by two unit cubes with a common face contains at most one vertex of the triangle $A B C$. Without loss of generality, we can assume that

$$
\begin{aligned}
& A \in\{(1+x, y, z) \mid 0 \leq x \leq 1,0 \leq y \leq 1,0 \leq z \leq 1\} \\
& B \in\{(a, 1+b, c) \mid 0 \leq a \leq 1,0 \leq b \leq 1,0 \leq c \leq 1\} \\
& C \in\{(p, q, 1+r) \mid 0 \leq p \leq 1,0 \leq q \leq 1,0 \leq r \leq 1\}
\end{aligned}
$$

Then

$$
\begin{aligned}
A B^{2}+B C^{2}+C A^{2}= & (1+x-a)^{2}+(y-1-b)^{2}+(z-c)^{2} \\
& +(a-p)^{2}+(1+b-q)^{2}+(c-1-r)^{2} \\
& +(p-1-x)^{2}+(q-y)^{2}+(1+r-z)^{2} \\
= & S_{1}+S_{2}+S_{3}
\end{aligned}
$$

where

$$
\begin{aligned}
& S_{1}=(1+x-a)^{2}+(p-1-x)^{2}+(a-p)^{2} \\
& S_{2}=(y-1-b)^{2}+(1+b-q)^{2}+(q-y)^{2} \\
& S_{3}=(1+r-z)^{2}+(c-1-r)^{2}+(z-c)^{2}
\end{aligned}
$$

Since $x, a, p \in[0,1]$, it holds that $|x-a| \leq 1,|a-p| \leq 1,|p-x| \leq 1$, so

$$
\begin{aligned}
S_{1} & =2+(x-a)^{2}+(a-p)^{2}+(p-x)^{2}+4 x-2 a-2 p \\
& \leq 2+|x-a|+|a-p|+|p-x|+4 x-2 a-2 p
\end{aligned}
$$

Let $a \leq p$ (the case $p \leq a$ is considered similarly). If $x \leq a \leq p$, then

$$
S_{1} \leq 2+(a-x)+(p-a)+(p-x)+4 x-2 a-2 p=2+2 x-2 a \leq 4
$$

If $a<x \leq p$, then

$$
S_{1} \leq 2+(x-a)+(p-a)+(p-x)+4 x-2 a-2 p=2+4 x-4 a \leq 6
$$

If $a \leq p<x$, then

$$
S_{1} \leq 2+(x-a)+(p-a)+(x-p)+4 x-2 a-2 p=2+6 x-4 a-2 p \leq 8
$$

In any case, $S_{1} \leq 8$ and similarly $S_{2} \leq 8, S_{3} \leq 8$. Therefore,

$$
A B^{2}+B C^{2}+C A^{2} \leq 24
$$

Thus, at least one of the numbers $A B^{2}, B C^{2}, C A^{2}$ is less than or equal to 8, so

$$
\min \{A B, B C, C A\} \leq 2 \sqrt{2}
$$

Equality is achieved if $x=1, a-p=0, b=1, y=q=0, r=1, z=c=0$, i.e., if $A=X, B=Y, C=Z$. Therefore, the maximum $M$ of the set containing all numbers of the form $\min \{A B, B C, C A\}$, where $A B C$ is a triangle contained within the cube $K$, is equal to $2 \sqrt{2}$ units of length.