Adding a Kubernetes Compute Service to Torque

  • 1 November 2021
  • 0 replies
  • 62 views

Adding a Kubernetes compute service to Torque is a 3-step process:

  1. Create the Kubernetes compute service
  2. Select the cloud account and specify the compute service details
  3. Connect the cluster’s agent to Torque

Create the Kubernetes compute service

To create the Kubernetes compute service:

  1. Log in to Torque.
  2. Go to the Administration > Cloud Accounts page.
  3. Click Add New > Kubernetes Cluster.
  4. Choose the type of cluster you wish to add.
    The Add Kubernetes Cluster dialog box is displayed.
  5. Next, select the cloud account.

Select the cloud account and specify the compute service details

To set up the compute service:

  1. Select the cloud account you want to connect to the Kubernetes cluster.

    Some of Torque’s sample blueprints are defined to run on EKS. For this to work, make sure you select the default AWS cloud account named “AWS”.

  2. Click Next.
    The Service Details page is displayed.
  3. Provide the following details:
    • Cluster name: Display name for the Kubernetes compute service.

      To use your EKS compute service in the sample blueprints, make sure the compute service is associated to the “AWS” cloud account and is called “EKS”.

    • Agent Namespace: The Kubernetes agent’s namespace.
    • Sandbox Namespaces: Any of the cluster’s namespaces that should be available for sandbox/production deployments. When you associate the Kubernetes compute service to a space, you will decide which of these namespaces will be used in that space.
    • (For EKS only) Optionally specify a Kubernetes ingress to load balance application traffic using the Application Load Balancer that is deployed by Torque for the environment:
      1. Select Configure Ingress.
      2. Specify the Ingress Controller Type. “alb” is currently supported.
      3. In the Ingress Class field, specify the --ingress-class value of the application load balancer’s ingress controller in the Kubernetes cluster. 

        You can find this value in the Kubernetes deployment YAML of the ALB Controller with the following command:

        kubectl -n <namespace> get deployment <resource Name> -o yaml

        Where:

        • namespace is the namespace name where the ALB controller was deployed
        • resource Name is the deployment name of the ALB controller
  4. Click Create. At this point, the Kubernetes compute service is created but the cluster’s agent is not connected to Torque.
    The Create Stack page is displayed, where you can optionally set the compute service to run Terraform services on your AWS account.
  5. Next, do one of the following:
    • For EKS: Optionally set the compute service to run Terraform services.
    • For AKS or self-managed Kubernetes clusters: Connect the cluster’s agent to Torque.

(For EKS only) Optionally enable the compute service to run Terraform services

To enable the compute service to run Terraform services:

  1. Set Would you like to run Terraform services on your AWS account to Yes.
    A section explaining how to set this up is displayed on Torque.
  2. In the IAM OIDC Provider field, specify your OIDC ARN. For details, see this official AWS docs page: Create an IAM OIDC provider for your cluster.
  3. Click Launch Stack and follow the instructions in the Torque section.
  4. In the Role ARN field, specify the RoleArm key that is displayed in the stack’s Outputs section.
  5. Click Next.
    The Deploy Agent page is displayed, presenting a YAML code block. This code block provides the definition of the agent. 
  6. Next, connect the cluster’s agent to Torque.

Connect the cluster’s agent to Torque

To connect the cluster’s agent to Torque:

  1. Click Copy to clipboard and paste the YAML code block in your preferred text editor.
  2. Save it as a YAML file.
  3. Open a terminal such as PowerShell inside your cluster (where the file is located) and run the following command:
    kubectl apply -f <file-name>
    For example: 
    kubectl apply -f "C:\Temp\agent.yaml"
  1. Return to Torque and click the Verify Connectivity to make sure the agent was installed correctly and can connect to Torque.
  2. Once verified, click Finish in the window that pops up.
  3. Next, associate the Kubernetes compute service to spaces.

This topic has been closed for comments