You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: datacenter/ucp/2.0/guides/access-ucp/cli-based-access.md
+22-36Lines changed: 22 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,10 @@ For this reason, when running docker commands on a UCP node, you need to
11
11
authenticate your request using client certificates. When trying to run docker
12
12
commands without a valid certificate, you get an authentication error:
13
13
14
-
```markdown
14
+
```none
15
15
$ docker ps
16
16
17
-
An error occurred trying to connect: Get https://ucp:443/v1.22/containers/json: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" when trying to verify candidate authority certificate "UCP Client Root CA")
17
+
x509: certificate signed by unknown authority
18
18
```
19
19
20
20
There are two different types of client certificates:
@@ -26,8 +26,8 @@ controller node.
26
26
27
27
## Download client certificates
28
28
29
-
To download a client certificate bundle, **log into UCP**, and navigate to your
30
-
**profile page**.
29
+
To download a client certificate bundle, log into the **UCP web UI**, and
30
+
navigate to your user **profile page**.
31
31
32
32

33
33
@@ -36,66 +36,52 @@ Click the **Create a Client Bundle** button, to download the certificate bundle.
36
36
37
37
## Use client certificates
38
38
39
-
Once you've downloaded a client certificate bundle, you can use it to
40
-
authenticate your requests.
39
+
Once you've downloaded a client certificate bundle to your local computer, you
40
+
can use it to authenticate your requests.
41
41
42
-
Navigate to the directory where you downloaded the bundle, and unzip it. Then
43
-
run the `env.sh` script to start using the client certificates.
42
+
Navigate to the directory where you downloaded the user bundle, and unzip it.
43
+
Then source the `env.sh` script.
44
44
45
-
```bash
45
+
```none
46
46
$ unzip ucp-bundle-dave.lauper.zip
47
47
$ cd ucp-bundle-dave.lauper
48
48
$ eval $(<env.sh)
49
49
```
50
50
51
-
The env.sh script updates the `DOCKER_HOST` and `DOCKER_CERT_PATH`
52
-
environment variables to use the certificates you downloaded.
51
+
The `env.sh` script updates the `DOCKER_HOST` environment variable to make your
52
+
local Docker CLI communicate with UCP. It also updates the `DOCKER_CERT_PATH`
53
+
environment variables to use the client certificates that are included in the
54
+
client bundle you downloaded.
53
55
54
56
From now on, when you use the Docker CLI client, it includes your client
55
-
certificates as part of the request to the Docker Engine. You can now use the
56
-
`docker info` command to see if the certificates are being sent to the Docker
57
-
Engine.
58
-
59
-
```markdown
60
-
$ docker info
61
-
62
-
Containers: 11
63
-
Nodes: 2
64
-
ucp: 192.168.99.100:12376
65
-
└ Status: Healthy
66
-
ucp-node: 192.168.99.101:12376
67
-
└ Status: Healthy
68
-
Cluster Managers: 1
69
-
192.168.99.104: Healthy
70
-
└ Orca Controller: https://192.168.99.100:443
71
-
└ Swarm Manager: tcp://192.168.99.100:3376
72
-
└ KV: etcd://192.168.99.100:12379
73
-
```
74
-
57
+
certificates as part of the request to the Docker Engine.
58
+
You can now use the Docker CLI to create services, networks, volumes and other
59
+
resources on a swarm managed by UCP.
75
60
76
61
## Download client certificates using the REST API
77
62
78
-
You can also download client certificate bundles using the UCP REST API. In
63
+
You can also download client bundles using the UCP REST API. In
79
64
this example we'll be using `curl` for making the web requests to the API, and
80
65
`jq` to parse the responses.
81
66
82
-
To install these tools on an Ubuntu distribution, you can run:
67
+
To install these tools on a Ubuntu distribution, you can run:
83
68
84
-
```bash
69
+
```none
85
70
$ sudo apt-get update && apt-get install curl jq
86
71
```
87
72
88
73
Then you get an authentication token from UCP, and use it to download the
89
74
client certificates.
90
75
91
-
```bash
76
+
```none
92
77
# Create an environment variable with the user security token
0 commit comments