Links

EKS Containers and Services

Managing Containers and Service with EKS and Native Docker Services
For an end-to-end example of creating an EKS Service, see this tutorial.
For a Native Docker Services example, see this tutorial.

Services

Using the Services tab in the DuploCloud Portal (Kubernetes -> Services), you can display and manage the Services you have defined.
For EKS Services, select the Service Name and click the Actions menu to Edit or Delete Services, in addition to performing other actions, as shown below.
Actions menu for EKS Service

Adding a DuploCloud EKS Service

  1. 1.
    In the DuploCloud Portal, navigate to Kubernetes -> Services for an EKS Service.
  2. 2.
    Click Add. The Basic Options section of the Add Service page displays.
  3. 3.
    Complete the fields on the page, including Service Name, Docker Image name, and number of Replicas. Use Allocation Tags to deploy the container in a specific set of hosts.
  4. 4.
    To force the creation of Kubernetes StatefulSets, select Yes in the Force StatefulSets field.
Add Service page
  1. 5.
    Click Next. The Advanced Options section of the Add Service page displays.
  2. 6.
    Configure advanced options as needed. For example, you can implement Kubernetes Lifecycle Hooks, by adding the YAML to the Other Container Config field (optional).
  3. 7.
    Click Create. The Service is created.
Do not use spaces when creating Service or Docker image names.
The number of Replicas you define must be less than or equal to the number of hosts in the fleet.

Displaying Services

Once the deployment commands run successfully, navigate to Administrator -> Tenants. Select the Tenant from the NAME column. Your deployments are displayed and you can now attach load balancers for the Services.
Tenants page with Services tile

Starting, stopping, and restarting multiple DuploCloud Services

Using the Services page, you can start, stop, and restart multiple services simultaneously.
  1. 1.
    In the DuploCloud Portal, navigate to Kubernetes -> Services.
  2. 2.
    Use the checkbox column to select multiple services you want to start or stop at once.
  3. 3.
    From the Service Actions menu, select Start Service, Stop Service, or Restart Service.
Your selected services are started, stopped, or restarted as you specified.

Importing a Native Kubernetes Service

Using the Import Kubernetes Deployment pane, you can add a Service to an existing Kubernetes namespace using Kubernetes YAML.
  1. 1.
    In the DuploCloud Portal, select Kubernetes -> Services from the navigation pane.
  2. 2.
    Click Add. The Add Service page displays.
  3. 3.
    Click the Import Kubernetes Deployment button in the upper right. The Import Kubernetes Deployment pane displays.
  4. 4.
    Paste the deployment YAML code, as in the example below, into the Import Kubernetes Deployment pane.
  5. 5.
    Click Import.
  6. 6.
    In the Add Service page, click Next.
  7. 7.
    Click Create. Your Native Kubernetes Service is created.
YAML code for importing a Native Kubernetes Service
Sample YAML code
//apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: duploservices-my-tenant
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx1
image: nginx:1.14.2
ports:
- containerPort: 80

Advanced configurations with EKS

You can supply advanced configuration options with EKS in the DuploCloud Portal in several ways, including the advanced use cases in this section.

Enable DuploCloud Master IP access to an EKS Security Group

  1. 1.
    In the DuploCloud Portal, navigate to Administrator -> System Settings.
  2. 2.
    Click the System Config tab.
  3. 3.
    Click Add. The Add Config pane displays.
  4. 4.
    From the Config Type list box, select, Flags.
  5. 5.
    From the Key list box, select Block Master VPC CIDR Allow in EKS SG.
    Add Config pane with Block Master VPC CIDR Allow in EKS SG setting
  6. 6.
    From the Value list box, select True.
  7. 7.
    Click Submit. The setting is displayed as BlockMasterVpcCidrAllowInEksSg in the System Config tab.
    System Config tab with Flag BlockMasterVpcCidrAllowInEksSg set to true

Kubernetes Containers

You can display and manage the Containers you have defined in the DuploCloud portal. Navigate to Kubernetes -> Containers.
Use the Options Menu (
) in each Container row to display Logs, State, Container Shell, Host Shell, and Delete options.
Option
Functionality
Logs
Displays container logs. When you select this option, the Container Logs window displays. Use the Follow Logs option (enabled by default) to monitor logging in real-time for a running container. See the graphic below for an example of the Container Logs window.
State
Displays container state configuration, in YAML code, in a separate window.
Container Shell
Accesses the Container Shell. To access the Container Shell option, you must first set up Shell access for Docker.
Host Shell
Accesses the Host Shell.
Delete
Deletes the container.
Containers page displaying defined containers with highlighted Options Menu

Downloading the Kubectl Token and KubeConfig

Container Logs window with Follow Logs option enabled

Downloading the Kubectl Token and KubeConfig

DuploCloud provides you with a Just-In-Time (JIT) security token, for fifteen minutes, to access the kubectl cluster.
  1. 1.
    In the DuploCloud Portal, select Administrator -> Infrastructure from the navigation pane.
  2. 2.
    Select the Infrastructure in the Name column.
  3. 3.
    Click the EKS tab.
  4. 4.
    Copy the temporary Token and the Server Endpoint (Kubernetes URL) Values from the Infrastructure that you created. You can also download the complete configuration by clicking the Download Kube Config button.
    EKS tab with Download KubeConfig button
  5. 5.
    Run the following commands, in a local Bash shell instance:
> kubectl config --kubeconfig=config-demo set-cluster EKS_CLUSTER --server=[EKS_API_URL] --insecure-skip-tls-verify
> kubectl config --kubeconfig=config-demo set-credentials tempadmin --token=[TOKEN]
> kubectl config --kubeconfig=config-demo set-context EKS --cluster=EKS_CLUSTER --user=tempadmin --namespace=duploservices-[TENANTNAME]
> export KUBECONFIG=config-demo
> kubectl config use-context EKS
You have now configured kubectl to point and access the Kubernetes cluster. You can apply deployment templates by running the following command:
> kubectl apply -f nginx.yaml
nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment-g
labels:
app: nginx-deployment-g
spec:
replicas: 1
selector:
matchLabels:
app: nginx-deployment-g
template:
metadata:
labels:
app: nginx-deployment-g
spec:
nodeSelector:
tenantname: "duploservices-stgeast1"
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
If you need security tokens of a longer duration, create them on your own. Secure them outside of the DuploCloud environment.

Passing Kubernetes Configs and Secrets

See this section in the Duplocloud Kubernetes documentation.

Downloading and configuring KubeCtl Token

See this section in the DuploCloud Kubernetes documentation.

Setting Up Docker Registry Credentials

See this section in the DuploCloud documentation.

Add Pod Toleration spec to a Container configuration

See Kubernetes Pod Toleration for examples of specifying K8s YAML for Pod Toleration.