Is it necessary to open port 22 at the service's level in Kubernetes for SSH access to a container via `ssh`?

Yes.
If you do not do it, the command:

kubectl port-forward svc/<service> <client port>:22 -n <namespace>

will result in the error: «Service does not have a service port 22»:
2024-10-21--03-38-55

You will also need to: