
Added said note as a prereq. Cleaned up some incidental formatting errors. Incorporated patchset 1 review comments. Incorporated patchset 2 review comments. Incorporated patchset 3 review comments. Signed-off-by: Ron Stone <ronald.stone@windriver.com> Change-Id: I0e2096eb999e2a156d82680e340f769cf33acdd8
8.8 KiB
Configure Container-backed Remote CLIs
The command lines can be accessed from remote computers running Linux, MacOS, and Windows.
This functionality is made available using a docker container with pre-installed and clients. The container's image is pulled as required by the remote CLI/client configuration scripts.
You must have Docker installed on the remote systems you connect from. For more information on installing Docker, see https://docs.docker.com/install/. For Windows remote workstations, Docker is only supported on Windows 10.
Note
You must be able to run docker commands using one of the following options:
- Running the scripts using sudo
- Adding the Linux user to the docker group
For more information, see, https://docs.docker.com/engine/install/linux-postinstall/
For Windows remote workstations, you must run the following commands from a Cygwin terminal. See https://www.cygwin.com/ for more information about the Cygwin project.
For Windows remote workstations, you must also have
winpty
installed. Download the latest release tarball for Cygwin from https://github.com/rprichard/winpty/releases. After downloading the tarball, extract it to any location and change the Windows <PATH> variable to include its bin folder from the extracted winpty folder.You will need a kubectl config file containing your user account and login credentials from your administrator.
The following procedure helps you configure the Container-backed remote and clients for a non-admin user.
Copy the remote client tarball file from to the remote workstation, and extract its content.
- The tarball is available from the area on .
- You can extract the tarball contents anywhere on your client system.
$ cd $HOME $ tar xvf -remote-clients-<version>.tgz
Download the user/tenant openrc file from the Horizon Web interface to the remote workstation.
Log in to Horizon as the user and tenant that you want to configure remote access for.
In this example, we use 'user1' user in the 'tenant1' tenant.
Navigate to
Project --> API Access --> Download Openstack RC file
.Select
Openstack RC file
.The file
my-openrc.sh
downloads.
Note
For a Distributed Cloud system, navigate to
Project --> Central Cloud Regions --> RegionOne
and download the Openstack RC file.Copy the user-kubeconfig file received from your administrator containing your user account and credentials to the remote workstation.
You can copy the file to any location on the remote workstation. For convenience, this example assumes that it is copied to the location of the extracted tarball.
Note
Confirm that the user-kubeconfig file has 666 permissions after copying the file to the remote workstation. If necessary, use the following command to change permissions,
chmod 666 user-kubeconfig
.On the remote workstation, configure the client access.
Change to the location of the extracted tarball.
$ cd $HOME/-remote-clients-<version>/
Create a working directory that will be mounted by the container implementing the remote .
See the description of the
configure\_client.sh
-w
optionbelow <kubernetes-user-tutorials-configuring-container-backed-remote-clis-and-clients-w-option>
for more details.$ mkdir -p $HOME/remote_cli_wd
Run the
configure\_client.sh
script.starlingx
$ ./configure_client.sh -t platform -r my_openrc.sh -k user-kubeconfig -w $HOME/remote_cli_wd
partner
If you specify repositories that require authentication, as shown above, you must remember to perform a
docker login
to that repository before using remote for the first time.The options for configure_client.sh are:
- -t
-
The type of client configuration. The options are platform (for and clients) and openstack (for application and clients).
The default value is platform.
- -r
-
The user/tenant RC file to use for
openstack
commands.The default value is admin-openrc.sh.
- -k
-
The kubernetes configuration file to use for
kubectl
andhelm
commands.The default value is temp-kubeconfig.
- -o
-
The remote CLI/client RC file generated by this script.
This RC file needs to be sourced in the shell to set up required environment variables and aliases before running any remote commands.
For the platform client setup, the default is remote_client_platform.sh. For the openstack application client setup, the default is remote_client_app.sh.
- -w
-
The working directory that will be mounted by the container implementing the remote . When using the remote , any files passed as arguments to the remote commands need to be in this directory in order for the container to access the files. The default value is the directory from which the
configure\_client.sh
command was run. - -p
-
Override the container image for the platform and clients.
By default, the platform and clients container image is pulled from docker.io/starlingx/stx-platformclients.
For example, to use the container images from the WRS AWS ECR:
$ ./configure_client.sh -t platform -r my-openrc.sh -k user-kubeconfig -w $HOME/remote_cli_wd -p /starlingx/stx-platformclients:stx.5.0-v1.4.3
If you specify repositories that require authentication, you must perform a
docker login
to that repository before using remote . - -a
-
Override the OpenStack application image.
By default, the OpenStack and clients container image is pulled from docker.io/starlingx/stx-openstackclients.
The
configure-client.sh
command will generate a remote_client_platform.sh RC file. This RC file needs to be sourced in the shell to set up required environment variables and aliases before any remote commands can be run.
After configuring the platform's container-backed remote CLIs/clients, the remote platform can be used in any shell after sourcing the generated remote CLI/client RC file. This RC file sets up the required environment variables and aliases for the remote commands.
Note
Consider adding this command to your .login or shell rc file, such that your shells will automatically be initialized with the environment variables and aliases for the remote commands.
See Using Container-backed Remote CLIs and Clients
<using-container-based-remote-clis-and-clients>
for
details.
Using Container-backed Remote CLIs and Clients <using-container-based-remote-clis-and-clients>
Installing Kubectl and Helm Clients Directly on a Host <kubernetes-user-tutorials-installing-kubectl-and-helm-clients-directly-on-a-host>
Configuring Remote Helm Client <configuring-remote-helm-client>