Incorporated patchset 1 review comments Updated patchset 5 review comments Updated patchset 6 review comments Fixed merge conflicts Updated patchset 8 review comments Change-Id: Icd7b08ab69273f6073b960a13cf59905532f851a Signed-off-by: Juanita-Balaraj <juanita.balaraj@windriver.com>
2.0 KiB
For Kubernetes CLI from a Local LDAP Linux Account Login
You can establish credentials for executing Kubernetes (kubectl and helm) for a Local user, if required; this is not setup by default.
For more information about ldapusersetup, see Creating LDAP
Linux Accounts <create-ldap-linux-accounts>.
- You must have a Kubernetes Service Account.
- See
Creating an Admin Type Service Account <create-an-admin-type-service-account>for details on how to create an admin level service account. For more clarifications, ask your 'sysadmin'.
It is recommended to use the same username for both your Local user and your Kubernetes Service Account.
Add your Local user account to the 'root' group in order to get access to execute
kubectl.If you have sudo permissions, run the following command first, and then re-ssh to your local user account, otherwise the 'sysadmin' will have to execute this step.
$sudo usermod -a -G root <ldapusername>Configure
kubectlaccess.Note
Your 'sysadmin' should have given you a TOKEN while setting up your Kubernetes Service Account.
Execute the following commands:
$ kubectl config set-cluster mycluster --server=https://192.168.206.1:6443 --insecure-skip-tls-verify $ kubectl config set-credentials joe-admin@mycluster --token=$TOKEN $ kubectl config set-context joe-admin@mycluster --cluster=mycluster --user joe-admin@mycluster $ kubectl config use-context joe-admin@myclusterYou now have admin access to Kubernetes cluster.