AKS Cluster

Used to connect to a Kubernetes Azure cluster.

Property Description
Resource type k8s-cluster
Account type None

Inputs

Values

Name Type Description
name string The name of the cluster.
resource_group string The Azure Resource Group.
subscription_id string The Azure Subscription ID.
loadbalancer string [Optional] The IP address or hostname that ingress should be configured for in the cluster.
server_app_id string [Optional] AAD server application ID. Needed for clusters with Microsoft EntraID (former AAD) enabled.
proxy_url string [Optional] The Proxy URL if used.

Secrets

Name Type Description
credentials object Contains appId, displayName, password and tenant of the Service Principal to access the cluster.
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 server_app_id items as needed.
cat << EOF > k8s-cluster.yaml
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: my-aks-cluster
entity:
  driver_type: humanitec/k8s-cluster-aks
  name: My AKS Cluster
  type: k8s-cluster
  driver_inputs:
    secrets:
      credentials:
        appId: my-app-id
        displayName: my-service-principal-name
        password: my-service-password
        tenant: my-tenant-id
    values:
      loadbalancer: 10.10.10.10
      name: my-cluster
      resource_group: my-azure-resource-group
      subscription_id: 123456-1234-1234-1234-123456789
      server_app_id: 654321-4321-4321-4321-987654321
  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-aks-cluster",
  "name": "My AKS Cluster",
  "type": "k8s-cluster",
  "criteria": [
    {
      "env_type": "development"
    }
  ],
  "driver_type": "humanitec/k8s-cluster-aks",
  "driver_inputs": {
    "values": {
      "loadbalancer": "10.10.10.10",
      "name": "my-cluster",
      "resource_group": "my-azure-resource-group",
      "subscription_id": "123456-1234-1234-1234-123456789",
      "server_app_id": "654321-4321-4321-4321-987654321"
    },
    "secrets": {
      "credentials": {
        "appId": "my-app-id",
        "displayName": "my-service-principal-name",
        "password": "my-service-password",
        "tenant": "my-tenant-id"
      }
    }
  }
}'
Top