App Policy-Rule Web Application App Service

ROLE Usage for K2HR3 Web Application

This section explains how to operate ROLE using the K2HR3 Web Application.

Display of ROLE

If ROLE has not yet been registered in TENANT(when using the K2HR3 system for the first time), registration of ROLE is required first.
If ROLE data already exists, you can check registered ROLE by selecting ROLE in the left tree.

K2HR3 Usage Application - Role Top

Registering ROLE

To register ROLE, select ROLE in the left tree, then click the K2HR3 Add Button button next to [ROLE] at the top.
To register a hierarchical ROLE(ROLE with parent), select the existing ROLE to be made a parent from the left tree and click the button.

After clicking the button, a dialog for registering ROLE is displayed.

K2HR3 Usage Application - Role Create Dialog

Enter the ROLE name in the displayed dialog and click the K2HR3 OK Button button to register ROLE.

Items displayed in dialog and their contents are shown below.

After registered ROLE, you can see by deploying ROLE in the left tree.

Editing of ROLE

To edit the contents of already registered ROLE, first select ROLE to edit in the left tree.
After selection, the data of the ROLE data is displayed in the main area of K2HR3 Web Application.

You can directly edit, add, or delete this ROLE data.
After editing, you can save the ROLE data by clicking the K2HR3 SAVE Button button. To discard the editing, please click the K2HR3 CANCEL Button button.

K2HR3 Usage Application - Role Page

After selecting ROLE, the items displayed in the main area will be explained.

Attribute information of ROLE

To display ROLE attribute information, first select ROLE in the left tree.
After selection, click K2HR3 Path Button on the left side of [ROLE] to display the ROLE attribute information(Selected Path Information) dialog.
The attribute information of ROLE is displayed in this dialog.

K2HR3 Usage Application - Role Information

The following describes attribute information of ROLE.

Manage ROLE TOKENs

Click K2HR3 Role Token Function Manage role tokens button in the ROLE attribute information(Selected Path Information) dialog, you can manage ROLE TOKENs.
In the Manage Role Tokens dialog shown below, you can check the list of ROLE TOKENs that have been issued for the target ROLE.

K2HR3 Usage Application - Manage role tokens

This dialog has K2HR3 Create new role token create a new ROLE TOKEN button, K2HR3 Delete role token delete a ROLE TOKEN button, and K2HR3 Automatically registration codes display detail of ROLE TOKEN and automatically registration codes for IaaS(OpenStack and kubernetes) button.
The operation of each button is shown below.

Create a new ROLE TOKEN

You can issue a new ROLE TOKEN by clicking the K2HR3 Create new role token Create a new ROLE TOKEN button.
You can specify a new ROLE TOKEN to be either expiration date(default 24 hours) or indefinite(10 years).
The expiration date can be set in the K2HR3 Web Application config.
When this button is clicked, the following pop-up is displayed.

K2HR3 Usage Application - Create role token popup

Click K2HR3 Create new role token button in this popup to create a new ROLE TOKEN.
Immediately after a new creation, the created ROLE TOKEN is displayed in bold at the top of the Manage Role Tokens dialog.

Delete a existing ROLE TOKEN

You can delete(disable) a ROLE TOKEN by clicking K2HR3 Delete role token button in the ROLE TOKEN column.

To display datail of ROLE TOKEN and automatically registoration codes

Click K2HR3 Automatically registration codes button in the ROLE TOKEN column to display the details of ROLE TOKEN and the code for automatic registration for IaaS(OpenStack and kubernetes).

Role Token / Registration code

K2HR3 Role Token Function Creating a new role token(expire) and registration code button in the ROLE attribute information(Selected Path Information) dialog, or click K2HR3 Automatically registration codes button on the Manage ROLE TOKENs dialog page to display this dialog page.

K2HR3 Usage Application - Role token detail and registration codes

The following items are displayed on this dialog page.

ROLE TOKEN

A ROLE TOKEN is displayed.(All character strings are displayed.)
You can specify this TOKEN when using the K2HR3 REST API.
For details, please refer to K2HR3 REST API.

Creation date ( Expiration date )

The date and time when the ROLE TOKEN was created and its expiration date are displayed.

Registration code

Displays information on the automatic registration code for IaaS(OpenStack and kubernetes) using this ROLE TOKEN, and Custom Registration Code(CRC) specified by user.
There are the following types of automatic registration codes to be displayed according to IaaS(OpenStack and kubernetes).

K2HR3 Usage Application - Select registration codes

In addition to the above, if a Custom Registration Code(CRC) has been set in configuration, all Custom Registration Code(CRC) will be displayed as well.

How to use USER DATA SCRIPT for OpenStack

This section describes how to automatically register an OpenStack Virtual Machine(VM) as a ROLE member.
You can display USER DATA SCRIPT by selecting User Data Script for OpenStack on the Role Token / Registration code dialog page described above.
This USER DATA SCRIPT can be copied using the K2HR3 Copy to clipboard Copy to Clipboard button.

Specify this USER DATA SCRIPT when launching an OpenStack Virtual Machine(VM).
As a result, when the Virtual Machine(VM) starts up, its IP address is registered as a member of this ROLE automatically.
The following is a dialog for specifying USER DATA SCRIPT of OpenStack. (The page varies slightly depending on the version of OpenStack.)

K2HR3 Usage Application - OpenStack User Data Script

How to use Yaml templates for kubernetes

This section explains how to automatically register kubernetes Pods(Containers) as ROLE members.
Select Secret Yaml for kubernetes and Sidecar Yaml for kubernetes in Role Token / Registration code dialog page above and copy their yaml contents.
You can copy these Yaml templates with the K2HR3 Copy to clipboard Copy to Clipboard button.

Secret Yaml template

The yaml contents displayed in Secret Yaml for kubernetes is a sample(template) code for registering k2hr3-secret as Secret in kubernetes.
In K2HR3 system, ROLE TOKEN is stored in Secret of kubernetes.
The following yaml code is displayed. You can modify namespace etc. according to your environment, and create Secret using kubectl etc.

apiVersion: v1
kind: Secret
metadata:
  name: k2hr3-secret
  namespace: <input your name space>
type: Opaque
data:
  K2HR3_ROLETOKEN: ****************************************************

The following is an example of a command that creates Secret.

$ kubectl create --save-config -f secret.yaml

Sidecar Yaml template

The contents displayed in Sidecar Yaml for kubernetes is a sample(template) code for starting Sidecar dedicated to K2HR3 when kubernetes Pods(Containers) is started.
** Sidecar** dedicated to K2HR3 registers k2hr3-volume as volume and runs k2hr3-sidecar as sidecar container.

You can modify this yaml template code to suit your environment and use it to run Pods(Conatiners).
The yaml template code contains the minimum necessary K2HR3 specific Sidecar yaml code.
** Sidecar** for K2HR3 uses docker.io/antpickax/k2hr3.sidecar image which is minimum ALPINE image.

If you can create Secret and run Sidecar for K2HR3, kubernetes Pods(Containers) will automatically be registered as members of this ROLE.

App Policy-Rule Web Application App Service