Click Open: If a PuTTY security alert about the servers host key appears, click Yes. Confirm that the Connection type radio button is set to SSH. In the Host Name (or IP address) text box, type your web sites domain name or IP address. In the example below, our application (container named "mariadb") is connecting to a remote MariaDB instance through SSH tunnel.įor that, first create the SSH key as a secret:Ĭonfig: | Host mysql-tunnel # You can use any name HostName # Tunnel IdentityFile ~/. Click Add : In the Category pane, click Session. If your application requires connecting to a remote resource through a SSH tunnel, you can place this container as a sidecar container to your application and let your application connect to this resource securely. ![]() It is perfectly possible to use this container in Kubernetes and actually the sidecar pattern is very suitable for Kubernetes. Leave it empty if you want to access all the databases on the remote server. Select the remote database that you want to access. This command will succeed because hostname is set to 127.0.0.1. The commands below assume you have added the appropriate userhost entry to the er table in the destination server. mysql -host127.0.0.1 -port3307 MySQL command to connect via SSH tunnel. Of course you can also expose port 3306 to be able to access to tunneled resource from your host machine. Set the Network type to MariaDB or MySQL (SSH tunnel) Set the Hostname / IP to 127.0.0.1 Set the Port to 3306 Enter the database username and password credentials. Use the command below to test the MySQL connection over the SSH tunnel. ![]() REMOTE_HOST: Īfter you start up docker containers, any container in the same container network will be able to access to tunneled mysql instance using tcp://mysql:3306.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |