EKS Cluster

Used to connect to an AWS’s Elastic Kubernetes Service (EKS) cluster.

Property Description
Resource type k8s-cluster
Account type aws, aws-role

Inputs

Values

Name Type Description
name string The name of the cluster.
region string The AWS region of the cluster.
loadbalancer string [Optional] The IP or DNS name representing the Load Balancer.
loadbalancer_hosted_zone string [Optional] The Load Balancer Hosted Zone.
proxy_url string [Optional] The Proxy URL if used.

Secrets

Name Type Description
credentials object Provider’s credentials as JSON object.
agent_url object [Optional] The signed URL produced by the humanitec/agent driver. It is expected to be a reference to the url output of a Agent resource.

Examples

Following the instructions provided here , it should be possible to retrieve the secret inputs needed to configure the access to the cluster properly.

Set the following environment variables for the CLI and API commands:

Variable Example Description
HUMANITEC_TOKEN my-token The authentication token for accessing the Humanitec API.
HUMANITEC_ORG my-org-id The unique identifier for the organization in Humanitec.

Use the command below for the interface of your choice.

  1. Create a file defining the Resource Definition you want to create. Adjust or remove the loadbalancer and the loadbalancer_hosted_zone items as needed.
cat << EOF > k8s-cluster.yaml
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: my-eks-cluster
entity:
  driver_type: humanitec/k8s-cluster-eks
  name: My EKS Cluster
  type: k8s-cluster
  driver_inputs:
    secrets:
      credentials:
        aws_access_key_id: AAABBBCCCDDDEEEFFFGGG
        aws_secret_access_key: zZxXyY123456789aAbBcCdD
    values:
      name: my-cluster
      region: eu-central-1
      loadbalancer: 10.10.10.10
      loadbalancer_hosted_zone: ABC0DEF5WYYZ00
  criteria:
  - env_type: development
EOF
  1. Use the humctl create command to create the Resource Definition in the Organization defined by your configured context:
humctl create -f k8s-cluster.yaml
rm k8s-cluster.yaml

curl https://api.humanitec.io/orgs/${HUMANITEC_ORG}/resources/defs \
  -X POST \
  -H "Authorization: Bearer ${HUMANITEC_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '
{
  "id": "my-eks-cluster",
  "name": "My EKS Cluster",
  "type": "k8s-cluster",
  "criteria": [
    {
      "env_type": "development"
    }
  ],
  "driver_type": "humanitec/k8s-cluster-eks",
  "driver_inputs": {
    "values": {
      "name": "my-cluster",
      "region": "eu-central-1",
      "loadbalancer": "10.10.10.10",
      "loadbalancer_hosted_zone": "ABC0DEF5WYYZ00"
    },
    "secrets": {
      "credentials": {
        "aws_access_key_id": "AAABBBCCCDDDEEEFFFGGG",
        "aws_secret_access_key": "zZxXyY123456789aAbBcCdD"
      }
    }
  }
}'
Top