How to auto add leaf cluster

I have one pod in k8s the pod is mian cluster.
I went the pod auto generate token to add leaf cluster.

I have 2 question

  1. the teleport demo login is use tsh client

tsh ssh tekeport@teleport.test.com

could i use curl to keep login to generate token

  1. if couldn’t use curl login

how to auto login OTP or just off OTP

No, it isn’t possible to automate the use of Teleport with curl in the way I think you want to.

I think what you’re asking is how to disable OTP - you can disable this with a setting in the teleport.yaml configuration file:

teleport:
  auth_service:
      authentication:
        second_factor: none

Restart Teleport after making this change.

Alternatively, if you want to be able to keep OTP enabled for users but generate long-lived certificates for automation (say for automatic use with Ansible or Jenkins) then you can follow the instructions here: https://gravitational.com/teleport/docs/user-manual/#ssh-certificates-for-automation

Please let us know if you have any more questions.

In terms of automating adding a leaf cluster, we do a similar thing for our automated Teleport demo environments.

You can see the script here which runs inside a Teleport sidecar container to automatically generate a token for adding a leaf cluster, then publish that token as a Kubernetes secret for others to use: https://github.com/gravitational/teleport/blob/master/examples/chart/teleport-demo/docker/teleport-sidecar/rootfs/usr/bin/teleport-publish-tokens#L22-L23