forked from pivotal-cf/docs-pks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installing-pks-cli.html.md.erb
84 lines (67 loc) · 4.26 KB
/
installing-pks-cli.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
title: Installing the PKS CLI
owner: PKS
---
<strong><%= modified_date %></strong>
This topic describes how to install the Pivotal Container Service Command Line Interface (PKS CLI).
To install the PKS CLI, follow the procedures for your operating system to download the PKS CLI from [Pivotal Network](https://network.pivotal.io/products/pivotal-container-service). Binaries are only provided for 64-bit architectures.
##<a id='mac'></a> Mac OS X
<ol><li>Navigate to <a href="https://network.pivotal.io/">Pivotal Network</a> and log in.</li>
<li>Click <strong>Pivotal Container Service (PKS)</strong>.</li>
<li>Select your desired release version from the <strong>Releases</strong> dropdown.
<li>Click <strong>PKS CLI</strong>.</li>
<li>Click <strong>PKS CLI - Mac</strong> to download the Mac OS X binary.</li>
<li>Rename the downloaded binary file to <code>pks</code>.</li>
<li>On the command line, run the following command to make the PKS binary act as an executable file:
<pre class="terminal">$ chmod +x pks</pre></li>
<li>Move the binary file into your <code>PATH</code>.<br><br>For example, you can run the following command:
<pre class="terminal">$ mv pks /usr/local/bin/pks</pre></li>
</ol>
##<a id='linux'></a> Linux
<ol><li>Navigate to <a href="https://network.pivotal.io/">Pivotal Network</a> and log in.</li>
<li>Click <strong>Pivotal Container Service (PKS)</strong>.</li>
<li>Select your desired release version from the <strong>Releases</strong> dropdown.
<li>Click <strong>PKS CLI</strong>.</li>
<li>Click <strong>PKS CLI - Linux</strong> to download the Linux binary.</li>
<li>Rename the downloaded binary file to <code>pks</code>.</li>
<li>On the command line, run the following command to make the PKS binary executable:
<pre class="terminal">$ chmod +x pks</pre></li>
<li>Move the binary file into your <code>PATH</code>.<br><br>For example, you can run the following command:
<pre class="terminal">$ mv pks /usr/local/bin/pks</pre></li>
</ol>
##<a id='windows'></a> Windows
<ol><li>Navigate to <a href="https://network.pivotal.io/">Pivotal Network</a> and log in.</li>
<li>Click <strong>Pivotal Container Service (PKS)</strong>.</li>
<li>Select your desired release version from the <strong>Releases</strong> dropdown.
<li>Click <strong>PKS CLI</strong>.</li>
<li>Click <strong>PKS CLI - Windows</strong> to download the Windows executable file.</li>
<li>Rename the downloaded binary file to <code>pks.exe</code>.</li>
<li>Move the binary file into your <code>PATH</code>.</li>
</ol>
##<a id='login'></a> Log in to PKS CLI
Use the command in this section to log in as an individual user.
The login procedure is the same for users created in UAA or users from external LDAP groups.
On the command line, run the following command in your terminal to log in to the PKS CLI:
<pre>
pks login -a PKS-API -u USERNAME -p PASSWORD --ca-cert CERT-PATH
</pre>
Replace the placeholder values in the command as follows:
* `PKS-API` is the domain name for the PKS API that you entered in **Ops Manager** > **Pivotal Container Service** > **PKS API** > **API Hostname (FQDN)**.
For example, `api.pks.example.com`.
* `USERNAME` and `PASSWORD` belong to the account you created in the [Grant PKS Access to a User](manage-users.html#uaa-user) section of _Managing Users in PKS with UAA_.
If you do not use `-p` to provide a password, the CLI prompts for the password interactively.
Pivotal recommends running the login command without the `-p` flag for added security.
* `CERT-PATH` is the path to your root CA certificate.
Provide the certificate to validate the PKS API certificate with SSL.<br><br>
For example:
<pre class="terminal">
$ pks login -a api.pks.example.com -u alana \
--ca-cert /var/tempest/workspaces/default/root_ca_certificate
</pre>
If you are logging in to a trusted environment, you can use `-k` to skip SSL verification instead of `--ca-cert CERT-PATH`.<br><br>
For example:
<pre class="terminal">
$ pks login -a api.pks.example.com -u alana -k
Upon successful login, the PKS CLI generates a `creds.yml` file containing the API endpoint, CA certificate (if applicable), refresh token, and access token.
By default, `creds.yml` is saved in your `~/.pks` directory.
You can use the `PKS_HOME` environment variable to override this location and use `creds.yml` from any directory.