PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select...

24
DECEMBER 21, 2018 VMWARE PKS vSphere PKS Plugin User Guide VMware Cloud Native Applications Overview The vSphere PKS Plugin provides a user interface for viewing Kubernetes workloads managed by PKS. This document provides instructions for installing and using the PKS Plugin, including: Plugin Requirements Deploy the Plugin Register the Plugin Troubleshoot Plugin Registration Add PKS to the Plugin Use the Plugin to View PKS Clusters Launch K8S Dashboard from the Plugin Remove PKS Instance from the Plugin Additional Resources Plugin Requirements The PKS Plugin is intended for use with the vSphere Client (HTML5) and supports the following software versions: PKS v1.2.x NSX-T v2.3 vSphere v6.7.x, v6.5 U1, U2 Deploy the Plugin The PKS Plugin is provided as an OVA file that you deploy to your vSphere environment, register with vCenter, and associate with a PKS instance. Complete the following steps to deploy the PKS Plugin: 1) Download the OVA file from https://labs.vmware.com/flings/vsphere-pks-plugin. 2) Log in to vSphere using the vSphere Client.

Transcript of PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select...

Page 1: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

D E C E M B E R 2 1 , 2 0 1 8

VMW ARE PKS

vSphere PKS Plugin User Guide VMware Cloud Native Applications

Overview

The vSphere PKS Plugin provides a user interface for viewing Kubernetes workloads managed by PKS.

This document provides instructions for installing and using the PKS Plugin, including:

• Plugin Requirements

• Deploy the Plugin

• Register the Plugin

• Troubleshoot Plugin Registration

• Add PKS to the Plugin

• Use the Plugin to View PKS Clusters

• Launch K8S Dashboard from the Plugin

• Remove PKS Instance from the Plugin

• Additional Resources

Plugin Requirements

The PKS Plugin is intended for use with the vSphere Client (HTML5) and supports the following software versions:

• PKS v1.2.x

• NSX-T v2.3

• vSphere v6.7.x, v6.5 U1, U2

Deploy the Plugin

The PKS Plugin is provided as an OVA file that you deploy to your vSphere environment, register with vCenter, and

associate with a PKS instance.

Complete the following steps to deploy the PKS Plugin:

1) Download the OVA file from https://labs.vmware.com/flings/vsphere-pks-plugin.

2) Log in to vSphere using the vSphere Client.

Page 2: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 2

VSPHERE PKS PLUGIN USER GUIDE

3) Import the OVA file into vSphere by selecting Actions > Deploy OVF Template.

4) Select an OVF template. Browse to and select the OVA file you downloaded.

Page 3: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 3

VSPHERE PKS PLUGIN USER GUIDE

5) Select a name and folder. Name the VM and put it in the Datacenter where PKS is installed.

6) Select a compute resource. Select the resource pool where PKS, Ops Manager, and BOSH are deployed.

Typically, this will be the PKS Management resource pool.

Page 4: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 4

VSPHERE PKS PLUGIN USER GUIDE

7) Review details. Verify the details of the OVA deployment up to this point.

8) License Agreements. Read and accept all license agreements.

Page 5: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 5

VSPHERE PKS PLUGIN USER GUIDE

9) Select storage. Select the storage type and location for the VM.

10) Select networks. For the VM Network choose the PKS management network where PKS components are

deployed.

11) Customize template. Provide the following configurations for the deployment of the plugin VM:

a) VC Address where the UI plugin will be running. Enter the IP address of vCenter Server.

b) Root password. Enter the password for “root” user of the plugin VM.

c) Permit Root Login. Check the option to permit root login to the VM.

d) Appliance TLS Certificate, Key, and CA Certificate. Leave these fields blank to have the plugin generate

the required TLS objects for the VM. Alternatively, provide your own.

Page 6: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 6

VSPHERE PKS PLUGIN USER GUIDE

Page 7: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 7

VSPHERE PKS PLUGIN USER GUIDE

12) Enter Networking Properties.

a) Network IP Address. Enter the IP address for the VM, such as 30.0.0.9 if you are using PKS NAT-mode, or

a routable IP address if you are using no-NAT. (This is an example IP; the static IP to use will be specific to

your deployment of PKS.)

b) Network Netmask. Enter 255.255.255.0, for example.

c) Default Gateway. Enter the gateway IP address for your environment.

d) Domain Name Servers. Enter the IP address of the DNS server for your environment.

e) Domain Search Path. Enter an example path for your environment.

f) FQDN. Enter the fully qualified domain name for the PKS Plugin VM.

g) Alernate IP Address. Enter an alternate address that can be used to connect to the appliance.

h) Enable second network interface. Leave this option unchecked if you have provided an alternate address.

i) Register UI plugin via second network interface. Select if you enabled a second network interface.

j) Developer mode. Leave this option deselected.

Page 8: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 8

VSPHERE PKS PLUGIN USER GUIDE

Page 9: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 9

VSPHERE PKS PLUGIN USER GUIDE

Example NSX DNAT rule for the vSphere UI plugin:

13) Ready to complete. Review the configuration of the plugin VM and click Finish.

Page 10: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 0

VSPHERE PKS PLUGIN USER GUIDE

14) Use the Recent Tasks panel at the bottom of the client to check the status.

a) It will take a few minutes to deploy.

b) If the VM fails to deploy, verify the configuration settings and try again.

15) Start the plugin VM.

16) If you are using vCenter 6.5:

a) Right-click the plugin VM.

b) Select Edit Settings.

c) Update the Network adapter to use the logical switch for the PKS Management Plane.

d) Start the plugin VM.

Page 11: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 1

VSPHERE PKS PLUGIN USER GUIDE

Register the Plugin

Complete these steps to register the plugin with vCenter.

1) Once the PKS Plugin VM is successfully deployed, power it on.

2) Using a new browser session, navigate to the plugin VM using the HTTPS URL: https://<ip-of-plugin-vm>.

(NOTE: You must use HTTPS; the URL http://<ip-of-plugin-vm> will not work.)

3) At the Plugin Registration screen, provide your vCenter credentials and click Login.

Page 12: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 2

VSPHERE PKS PLUGIN USER GUIDE

4) You will be presented with a dialog to verify the thumbprint of the vCenter Server with which the plugin will be

registered. Click Continue.

Page 13: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 3

VSPHERE PKS PLUGIN USER GUIDE

5) On confirmation you will be presented with a dialog to agree to registering the plugin. Click Register.

Page 14: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 4

VSPHERE PKS PLUGIN USER GUIDE

6) On success, you are presented with dialog indicating that the plugin is registered with vSphere.

7) To complete the plugin registration process, click Logout.

Page 15: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 5

VSPHERE PKS PLUGIN USER GUIDE

8) Verify registration of the PKS Plugin.

a) Log in to vCenter using the vSphere Client.

b) Launch the PKS Plugin using the menu item or shortcut VMware Pivotal Container Service.

i) If the PKS menu option or shortcut is available, proceed with Add PKS to the Plugin.

ii) If the PKS menu option or shortcut is not available, see Troubleshoot Plugin Registration.

Page 16: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 6

VSPHERE PKS PLUGIN USER GUIDE

Troubleshoot Plugin Registration

After registering the plugin and logging in to vCenter, there may be some delay before the PKS Plugin shortcut or

menu item is available. If no shortcut/menu item appears after some time, logout and log back in to vCenter.

If you still do not see the shortcut/menu item to launch the PKS plugin, restart the vSphere Client (HTML5) using the

vCenter Applicance Management UI (VAMI) which is running on port 5480 of the vCenter Server. To do this:

• Navigate to the VAMI URL at https://vcaddress:5480/, for example https://10.19.18.24:5480.

• Log in to the VAMI UI using your vCenter administrative user credentials.

• Select Services > VMware vSphere Client.

• Scroll to the top and select Restart.

• When prompted, confirm restart of the vSphere Client Service.

Page 17: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 7

VSPHERE PKS PLUGIN USER GUIDE

Add PKS to the Plugin

The initial release of the plugin supports adding a single PKS instance. Once you have installed and registered the plugin, add the PKS instance to the plugin as follows. 1) Log in to vCenter using the vSphere Client.

2) Launch the plugin using the menu item or shortcut VMware Pivotal Container Service.

Page 18: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 8

VSPHERE PKS PLUGIN USER GUIDE

3) You are presented with the Add Instances page to provide endpoint information for the PKS instance to add.

4) Enter the Ops Manager endpoint information, including hostname, user name, and password.

5) Click Add.

6) Verify the endpoint fingerprints and click Continue.

Page 19: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 1 9

VSPHERE PKS PLUGIN USER GUIDE

7) Create hostname:ip mapping (if necessary).

The PKS API hostname must be resolvable by the plugin VM. Likewise, if PKS is configured to use an FQDN for the NSX Manager, this hostname must be resolvable by the plugin VM. If the PKS API server or NSX Manager hostname is not resolvable, you can use a script provided on the plugin VM to add the required mapping.

To establish the necessary mapping, run the add-host-mapping.sh script as follows:

a) Using the vSphere Client, launch a remote console session for the plugin VM. b) Log in to the VM as the “root” user with the password set during installation of the plugin VM. c) Run the script with one or more hostname:ip arguments:

/etc/vmware/add-host-mapping.sh <HOSTNAME1>:<IP1> <HOSTNAME2>:<IP2> <HOSTNAME3>:<IP3>

For example:

/etc/vmware/add-host-mapping.sh api.pks.local:30.0.0.3 manager.nsx.local:10.196.168.21

Page 20: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 2 0

VSPHERE PKS PLUGIN USER GUIDE

Use the Plugin to View PKS Clusters

Once the PKS instance is registered with the plugin, follow these steps to use it. 1) Click the link for the PKS instance.

2) The PKS Instances Summary screen gives you a summary of the PKS instance you selected, including:

• The UUIDs for the PKS Control Plane VM

• The number of Kubernetes clusters deployed by this PKS instance

• The CNI used for this deployment

• The UUID for the T0 router

• The UUID for the Node IP Block

• The UUID for the Pod IP Block

• The UUID for the Floating IP Pool

• The Admin Network

Page 21: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 2 1

VSPHERE PKS PLUGIN USER GUIDE

3) At the top of the Summary page you see tabs for the following:

• K8s Clusters – Details on each Kubernetes cluster deployed

• Nodes – Details on the nodes for all Kubernetes clusters

• Configuration details for the parameters specified when registering the PKS instance with the plugin

Page 22: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 2 2

VSPHERE PKS PLUGIN USER GUIDE

Launch K8S Dashboard from the Plugin

To access the Kubernetes Dashboard for a cluster, complete the following steps.

1) Install the Kubectl CLI as described here.

2) In the plugin UI, click the link for the PKS instance.

3) At the PKS Instances screen, click the K8s Clusters tab.

4) Select a cluster among the list of Kubernetes clusters associated with this PKS instance.

Page 23: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 2 3

VSPHERE PKS PLUGIN USER GUIDE

5) At the Summary screen, click the Open K8S UI button in the upper right.

6) Copy the script in the “Set context” field to a shell where kubectl is installed and execute it.

7) Run the kubectl proxy using the command provided in the Run Proxy field.

8) Click Open to launch the Kubernetes Dashboard.

9) When prompted, copy/paste the token to log in to the Dashboard.

10) Click Access Cluster at the Summary screen and use kubectl to connect to the cluster using the script provided.

.

Page 24: PKS Plugin for vSphere User Guide - VMware · P K S | 5 VSPHERE PKS PLUGIN USER GUIDE 9) Select storage.Select the storage type and location for the VM. 10) Select networks.For the

P K S | 2 4

VSPHERE PKS PLUGIN USER GUIDE

Remove PKS from the Plugin

To remove a PKS instance from the plugin, follow these steps. 1) At the PKS Instances screen, select the vertical ellipses icon to the left of the PKS instance ID.

2) Click Remove.

3) Confirm your decision and click Remove.

Additional Resources

For additional resources for installing, troubleshooting, and using the vSphere PKS Plugin, refer to this GitHub repository: https://github.com/CNA-Tech/PKS-Ninja/tree/master/LabGuides/Lab15-PksTroubleshooting#20-accelerating-planning-operations-and-problem-resolution-with-the-vsphere-pks-plugin.