Client setup and testing
This page covers basic client testing; including setting up and testing Triton using the CloudAPI endpoint and the sdc-docker
endpoint.
Important Note
The steps and examples below assume that your client is macOS, Linux, or another Unix-like OS that will allow the installation of Node.js, the Triton CLI and related tools, and the Docker client suite. Although Windows is supported, it is strongly recommended that you use an environment like Cygwin.
Prerequisites
- An installation of the current LTS version of Node.js.
- The following node modules; instructions on installing these tools can be reviewed on the pages linked below. Additionally, a full review of the smartdc toolset is available at this link Triton CloudAPI Documentation.
- Installation of the Docker Client Tools
- Additional information on Docker is available at the Docker User Guide.
- Information on the Triton docker implementation, including information on tested versions of the client toolset, is available here.
Testing CloudAPI using the Triton CLI
-
- The
-i
or--insecure
option can be used to suppress validation of the CloudAPI SSL certificate, as can be necessary for testing Triton installs. Set theTRITON_TLS_INSECURE=1
environment variable for the same effect.
- The
-
Validate a connection to the endpoint using
triton datacenters
$ triton datacenters NAME URL cak-1 https://cloudapi.cak-1.virington.com
-
List the packages available in the data center using
triton packages
$ triton packages SHORTID NAME DEFAULT MEMORY SWAP DISK VCPUS 726f0c30 sample-128M false 128M 512M 3G - 98fd1e97 sample-256M false 256M 1G 6G - cc9eaeea sample-512M false 512M 2G 12G - 81f72f43 sample-1G true 1G 4G 25G - 70da1b03 sample-2G false 2G 8G 50G - c0b6ee04 sample-4G false 4G 16G 100G - 6c1376cf sample-8G false 8G 32G 200G - c2bea4a5 sample-16G false 16G 64G 400G - 11ff7224 sample-32G false 32G 128G 800G - 14626eca sample-64G false 64G 256G 1.5T -
-
List the images available in the data center using
triton images
$ triton images SHORTID NAME VERSION STATE FLAGS OS PUBDATE 1bd84670 minimal-64-lts 14.4.2 active P smartos 2015-05-28 b67492c2 base-64-lts 14.4.2 active P smartos 2015-05-28 8b05ccbe elasticsearch 15.1.1 active P smartos 2015-06-01 5c7d0d24 base-64 15.2.0 active P smartos 2015-07-27 234c4a6e centos-6 20150811 active P linux 2015-08-11 52be84d0 ubuntu-14.04 20151005 active P linux 2015-10-05 842e6fa6 base-64 15.3.0 active P smartos 2015-10-09 ffe82a0a ubuntu-15.04 20151105 active P linux 2015-11-05 1adf7176 debian-8 20151109 active P linux 2015-11-09
-
List the networks available in the data center using
triton networks
$ triton networks SHORTID NAME SUBNET GATEWAY FABRIC VLAN PUBLIC 50c018d7 My-Fabric-Network 192.168.128.0/22 192.168.128.1 true 2 false 12d9a2ef public - - - - true
-
Provision a test instance using the values above; for our test we we use the
base-64-lts
image and thesample-1g
package. By default, our instance will be provisioned with the public network and our fabric network. The-w
flag tells the command to wait for the image to be created.$ triton create -w -n test-inst base-64-lts sample-1G Creating instance test-inst (d1bd4cdc-ed4c-e42b-9d5c-e625d33634c8, base-64-lts@14.4.2, sample-1G) Created instance test-inst (d1bd4cdc-ed4c-e42b-9d5c-e625d33634c8) in 19s
-
List current instances for your account.
$ triton insts SHORTID NAME IMG STATE PRIMARYIP AGO d1bd4cdc test-inst base-64-lts@14.4.2 running 64.30.138.53 4m
-
Log into the instance you just created.
$ triton ssh d1bd4cdc The authenticity of host '64.30.138.53 (64.30.138.53)' can't be established. RSA key fingerprint is SHA256:RS/ko4Q38OD0bnJ4AvA8T9A5aClU1vu3A6cpdEj/3HM. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '64.30.138.53' (RSA) to the list of known hosts. __ . . _| |_ | .-. . . .-. :--. |- |_ _| ;| || |(.-' | | | |__| `--' `-' `;-| `-' ' ' `-' / ; Instance (base-64-lts 14.4.2) `-' https://docs.tritondatacenter.com/images/smartos/base [root@d1bd4cdc-ed4c-e42b-9d5c-e625d33634c8 ~]# uptime 19:10pm up 0:05, 1 user, load average: 0.00, 0.01, 0.00 [root@d1bd4cdc-ed4c-e42b-9d5c-e625d33634c8 ~]# exit logout Connection to 64.30.138.53 closed.
-
Destroy the instance you created; once again, the
-w
tells the command to wait for the desired action to complete.$ triton delete d1bd4cdc -w Delete instance d1bd4cdc (d1bd4cdc-ed4c-e42b-9d5c-e625d33634c8, 3s)
Testing sdc-docker
-
Configuring Docker for Triton requires the Triton CLI tool. With that installed, you can connect Docker on your laptop to the Triton Compute Service using the
triton env
command in Triton CLI version 4.9 or newer:eval $(triton env)
Further details about Docker access are in the Triton Compute Service documentation.
- If you are using a self signed certificate with TLS and an IP address (rather than a fully qualified hostname), you will be given instructions on adding the IP address of the docker endpoint in order to use TLS security in the above output.
-
Test access to your docker installation using the
docker info
command.$ docker info Containers: 0 Images: 0 Storage Driver: sdc SDCAccount: jay.schmidt Execution Driver: sdc-0.3.0 Logging Driver: json-file Kernel Version: 3.12.0-1-amd64 Operating System: SmartDataCenter CPUs: 0 Total Memory: 0 B Name: us-sw-1 ID: 65698e31-2754-4e86-9d05-bfc881037812
-
Test provision a docker container using the
docker run
command.- We will use the lightweight
busybox
container for our test.
$ docker run -it --rm busybox Unable to find image 'busybox:latest' locally fc0db02f3072: Pulling dependent layers fc0db02f3072: Activating image fc0db02f3072: Pull complete Digest: sha256:e4f93f6ed15a0cdd342f5aae387886fba0ab98af0a102da6276eaf24d6e6ade0 Status: Downloaded newer image for busybox:latest / # exit
- We will use the lightweight
-
Still using your busybox container, check your networking configuration.
- If you have fabric networks enabled you should see an address on a 192.168.128.1/23 network.
- If you have enabled NAT zones you should be able to ping an external address, such as google's DNS services.
/ # ifconfig eth0 eth0 Link encap:Ethernet HWaddr 90:B8:D0:04:D0:FF inet addr:192.168.128.28 Bcast:192.168.131.255 Mask:255.255.252.0 inet6 addr: fe80::92b8:d0ff:fe04:d0ff/10 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:8500 Metric:1 RX packets:20 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:1052 (1.0 KiB) TX bytes:1072 (1.0 KiB) / # ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8): 56 data bytes 64 bytes from 8.8.8.8: seq=0 ttl=56 time=18.349 ms 64 bytes from 8.8.8.8: seq=1 ttl=56 time=8.172 ms ^C --- 8.8.8.8 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max = 8.172/13.260/18.349 ms / #
-
In another window, spin up a second busybox container and ping across on the fabric network using the IP of your first container as the target.
-
Exit from your containers; since you specified the
--rm
option, your containers will be deleted automatically, but you can verify using thedocker ps -a
command.$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $