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.

Creating a DuploCloud EKS Service

  1. In the DuploCloud Portal, navigate to Kubernetes -> Services.

  2. Click Add. The Basic Options section of the Add Service page displays.

  3. In the Service Name field, give the Service a name (without spaces).

  4. From the Cloud list box, select AWS.

  5. From the Platform list box, select EKS Linux.

  6. In the Docker Image field, enter the Docker image.

  7. Optionally, enter any allocation tags in the Allocation Tag field.

  8. From the Replica Strategy list box, select a replication strategy. Refer to the informational ToolTip ( ) for more information.

  9. Specify the number of replicas in the Replicas field (for Static replica strategy). The number of replicas you define must be less than or equal to the number of Hosts in the fleet.

  10. In the Replica Placement list box (for Static or Horizontal Pod Autoscaler replication strategies) select First Available, Place on Different Hosts, Spread Across Zones, or Different Hosts and Spread Across Zones. Refer to the informational ToolTip ( ) for more information.

  11. Optionally, enter variables in the Environmental Variables field.

  12. In the Force StatefulSets list box, select Yes or No (for Static or Horizontal Pod Autoscaler replication strategies).

  13. Optionally, select Tolerate spot instances (for Static or Horizontal Pod Autoscaler replication strategies)

  1. Click Next. The Add Service, Advanced Options page displays.

  2. Configure advanced options as needed. For example, you can implement Kubernetes Lifecycle Hooks in the Other Container Config field (optional).

  3. Click Create. The Service is created.

Viewing Services

From the DuploCloud Portal, navigate to Kubernetes -> Services. Select the Service from the NAME column. The Service details page displays.

Starting, Stopping, and Restarting Multiple DuploCloud Services

Using the Services page, you can start, stop, and restart multiple services simultaneously.

  1. In the DuploCloud Portal, navigate to Kubernetes -> Services.

  2. Use the checkbox column to select multiple services you want to start or stop at once.

  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. In the DuploCloud Portal, select Kubernetes -> Services from the navigation pane.

  2. Click Add. The Add Service page displays.

  3. Click the Import Kubernetes Deployment button in the upper right. The Import Kubernetes Deployment pane displays.

  4. Paste the deployment YAML code, as in the example below, into the Import Kubernetes Deployment pane.

  5. Click Import.

  6. In the Add Service page, click Next.

  7. Click Create. Your Native Kubernetes Service is created.

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 EKS Configurations

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. In the DuploCloud Portal, navigate to Administrator -> System Settings.

  2. Click the System Config tab.

  3. Click Add. The Add Config pane displays.

  4. From the Config Type list box, select, Flags.

  5. From the Key list box, select Block Master VPC CIDR Allow in EKS SG.

  6. From the Value list box, select True.

  7. Click Submit. The setting is displayed as BlockMasterVpcCidrAllowInEksSg in the System Config tab.

Managing Kubernetes Containers

You can display and manage the Containers you have defined in the DuploCloud portal. Navigate to Kubernetes -> Containers.

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.

Downloading the Kubectl Token and KubeConfig

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. In the DuploCloud Portal, select Administrator -> Infrastructure from the navigation pane.

  2. Select the Infrastructure in the Name column.

  3. Click the EKS tab.

  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.

  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.

Last updated

Logo

© DuploCloud, Inc. All rights reserved. DuploCloud trademarks used herein are registered trademarks of DuploCloud and affiliates