Adding Tenants, Hosts, and Services with EKS
Each tenant is mapped to a Namespace in Kubernetes. For example, if a Tenant is called Analytics in DuploCloud, the Kubernetes Namespace is called
All application components within the Analytics Tenant are placed in the
duploservices-analyticsnamespace. Since nodes cannot be part of a Kubernetes Namespace, DuploCloud creates a
tenantnamelabel for all the nodes that are launched within the Tenant. For example, a node launched in the Analytics Tenant is labeled
Any pods that are launched using the DuploCloud UI have an appropriate Kubernetes nodeSelector that ties the Pod to the nodes within the tenant. If you are deploying via
kubectl,ensure that your deployment is using the proper nodeSelector.
Once the tenant is created, navigate to DevOps in the DuploCloud Portal and select the Tenant that you created from the Tenant list box.
Tenant list box in the DevOps section
In DevOps -> Hosts, create new nodes (Hosts).
Set Docker registry credentials and Kubernetes secrets by selecting DevOps -> Containers -> EKS/Native from the navigation pane in the DuploCloud Portal and choosing the EKS/Native option. Docker registry credentials are passed to the Kubernetes cluster as
kubernetes.io/dockerconfigjson. In addition, you can set and reference Kubernetes secrets in your deployment by configuring them with the EKS/Native option.
Deploying DuploCloud Services, by clicking the Add button in the EKS/Native tab, implicitly converts Services into either a deployment set or a StatefulSet. If there are no volume mappings, then the service is mapped to a deployment set. Otherwise, it is mapped to a StatefulSet. Most configuration values are self-explanatory, such as Images, Replicas, and Environmental Variables.
You can supply advanced configuration options in the Other K8 Config field. The content of this field maps one-to-one with the Kubernetes API. Configurations for deployment are StatefulSets and are supported by placing the appropriate JSON code in the Other K8 Config section. For example, to reference Kubernetes Secrets using a YAML config map, create the following JSON code:
You can deploy any native Docker container in a virtual machine (VM) with the DuploCloud platform.
- 1.In the DuploCloud Portal, select DevOps -> Containers -> EKS/Native from the navigation pane.
- 2.Click Add. The Add Service page displays.
- 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.To force the creation of Kubernetes StatefulSets, select Yes in the Force StatefulSets field.
Add Service page
Use the K8s Admin dashboard to monitor the number and availability of StatefulSets for your service.
- 1.In the DuploCloud Portal, select Administrator -> Diagnostics -> Metrics.
- 2.Click the k8s tab. The K8s Admin dashboard displays.
K8s Admin dashboard
DuploCloud provides support for pulling images from multiple docker registries.
Add multiple Docker Registry Credentials:
- 1.In the DuploCloud Portal, select Administrator-> Plan from the navigation pane. The Plans page displays.
- 2.Select the Plan in the Name column.
- 3.Click the Config tab.
- 4.Click Add. The Add Config pane displays.
Add Config pane
DuploCloud supports Elastic Kubernetes Service (EKS/AKS) out of the box.
Kubernetes clusters are created during Infrastructure setup using the Administrator -> Infrastructure option in the DuploCloud Portal. The cluster is created in the same Virtual Private Cloud (VPC) as the Infrastructure. Building an Infrastructure with an AKS/EKS cluster may take some time.
Next, you deploy an application within a Tenant in Kubernetes. The application contains a set of VMs, a Deployment set (Pods), and an application load balancer. Pods can be deployed either through the DuploCloud Portal or through
DuploCloud provides you with a Just-In-Time (JIT) security token, for fifteen minutes, to access the
- 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, locally:
> 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
kubectlto point and access the Kubernetes cluster. You can apply deployment templates by running the following command:
> kubectl apply -f nginx.yaml
- name: nginx
- containerPort: 80
If you need security tokens of a longer duration, create them on your own. Secure them outside of the DuploCloud environment.
Once the deployment commands run successfully, click the Services tile on the Tenants page. Your deployments are displayed and you can now attach load balancers for the services.
Tenants page with Services tile
These do not need to be changed. See the following sections for more information:
Fargate is a technology that you can use with ECS to run containers without having to manage servers or clusters of EC2 instances.