Set up an existing Kubernetes Cluster > Edge Agent Standard.

Give it a name.

(you may need to use the Portainer host IP, rather than FQDN, if DNS is not properly set up in your Kubernetes cluster)

Click 'Create'.

Download the provided install script locally and execute once to generate the manifest.

wget https://downloads.portainer.io/<version>/portainer-edge-agent-setup.sh

Edit the setup script and comment out the lines which download the K8s manifest

#info "Downloading agent manifest..."
#curl -L  https://downloads.portainer.io/<version>/portainer-agent-edge-k8s.yaml -o portainer-agent-edge-k8s.yaml || errorAndExit "Unable to download agent manifest"

Manually download the manifest file yourself.

curl -L  https://downloads.portainer.io/<version>/portainer-agent-edge-k8s.yaml -o portainer-agent-edge-k8s.yaml

Edit the manifest and change the AGENT_CLUSTER_ADDR to localhost

- name: AGENT_CLUSTER_ADDR
  value: "localhost"

Execute the local modified setup script with the additional command parameteres as provided in Portainer. This time it will use your modified manifest rather than download it.

cat portainer-edge-agent-setup.sh  | bash -s -- "<EDGE_ID>" "<EDGE_KEY>" "0" "" ""