While there is a solution - i.e. the Kubernetes plugin - to provision on-demand Kubernetes agents, there might be scenarios where a dedicated agent is suitable. Following are some examples on how to deploy dedicated Agents in Kubernetes for different launcher:

The values for the variable JENKINS_URL, JENKINS_AGENT_NAME and JENKINS_SECRET must be set accordingly. Note that If Jenkins is running in the kubernetes cluster, the JENKINS_URL can be set to the name / kubernetes DNS name of the service exposing the Jenkins master.

Note: If Jenkins is running in the kubernetes cluster, the Host can be set to the name / kubernetes DNS name of the service (here jenkins-ssh-agent). Otherwise, the jenkins-ssh-agent would need to be exposed externally from the Kubernetes cluster. For that matter, the SSH launcher is more suitable when Jenkins is running aside in the same Kubernetes cluster.

For more information about the configuration, have a look at the base image jenkinsci/ssh-slave.

The values for the different variable MASTER, NAME, EXECUTORS, USERNAME, PASSWORD, FSROOT must be set accordingly. Note that If Jenkins is running in the kubernetes cluster, the MASTER variable can be set to the name / kubernetes DNS name of the service exposing the Jenkins master.