Skip to content

Provision

What Will You Do

In this part, you will provision an Amazon EKS cluster with AWS Fargate profiles.


Update Cluster Specification

  • Open a suitable YAML editor and copy/paste the example EKS cluster specification provided below.
  • Save the file as "fargate-demo.yaml" (an example)

Cluster Spec Explained

In the example cluster spec provided,

  • The name of the EKS cluster will be "fargate-demo" and it is configured to be provisioned in the "defaultproject" in your Org.
  • The EKS cluster is configured with one managed node group (i.e. "managed") and two Fargate profiles (i.e. "fp-dev" and "fp-demo")

The following items in the declarative cluster specification will need to be updated/customized for your environment.

  • cluster name: "fargate-demo"
  • project: "defaultproject"
  • cloud credential: "aws-cc"
  • region: "us-west-2"
  • AWS Tags as required in your AWS account
apiVersion: infra.k8smgmt.io/v3
kind: Cluster
metadata:
  # The name of the cluster
  name: fargate-demo
  # The name of the project the cluster will be created in
  project: defaultproject
spec:
  blueprintConfig:
    # The name of the blueprint the cluster will use
    name: minimal
    # The version of the blueprint the cluster will use
    version: latest
  # The name of the cloud credential that will be used to create the cluster 
  cloudCredentials: aws-cc
  config:
    # Defines the settings used to schedule workload onto Fargate
    fargateProfiles:
    - name: fp-dev
      selectors:
      - namespace: dev
    - name: fp-demo
      selectors:
      - labels:
          env: demo
        namespace: 
    # The EKS addons that will be applied to the cluster    
    addons:
    - name: kube-proxy
      version: latest
    - name: vpc-cni
      version: latest
    - name: coredns
      version: latest
    managedNodeGroups:
      # The AWS AMI family type the nodes will use
    - amiFamily: AmazonLinux2
      # The desired number of nodes that can run in the node group  
      desiredCapacity: 1
      # The AWS EC2 instance type that will be used for the nodes
      instanceType: t3.large
      # The maximum number of nodes that can run in the node group
      maxSize: 3
      # The minimum number of nodes that can run in the node group
      minSize: 1
      # The name of the node group that will be created in AWS
      name: managed
    metadata:
      # The name of the cluster
      name: fargate-demo
      # The AWS region the cluster will be created in
      region: us-west-2
      # The tags that will be applied to the AWS cluster resources
      tags:
        email: user@rafay.co
        env: qa
      # The Kubernetes version that will be installed on the cluster
      version: latest
    vpc:
      # AutoAllocateIPV6 requests an IPv6 CIDR block with /56 prefix for the VPC
      autoAllocateIPv6: false
      clusterEndpoints:
        # Enables private access to the Kubernetes API server endpoints
        privateAccess: true
        # Enables public access to the Kubernetes API server endpoints
        publicAccess: false
      # The CIDR that will be used  by the cluster VPC
      cidr: 192.168.0.0/16
  type: aws-eks

Provision EKS Cluster

  • Type the command below to provision the EKS cluster
rctl apply -f fargate-demo.yaml

If there are no errors, you will be presented with a "Task ID" that you can use to check progress/status. Note that this step requires creation of infrastructure in your AWS account and can take ~20-30 minutes to complete.

{
  "taskset_id": "lk5opd2",
  "operations": [
    {
      "operation": "NodegroupCreation",
      "resource_name": "managed",
      "status": "PROVISION_TASK_STATUS_PENDING"
    },
    {
      "operation": "ClusterCreation",
      "resource_name": "fargate-demo",
      "status": "PROVISION_TASK_STATUS_PENDING"
    }
  ],
  "comments": "The status of the operations can be fetched using taskset_id",
  "status": "PROVISION_TASKSET_STATUS_PENDING"
}
  • Navigate to the specified "project" in your Org
  • Click on Infrastructure -> Clusters.

The provisioning process can take approximately 30 minutes to fully complete. Once provisioning is complete, you should see a healthy cluster in the project in your Org

Provisioned Cluster