Learn R Programming

AzureContainers (version 1.0.2)

aks: Azure Kubernetes Service class

Description

Class representing an Azure Kubernetes Service (AKS) resource. For working with the cluster endpoint itself, including deploying images, creating services etc, see kubernetes_cluster.

Usage

aks

Arguments

Format

An object of class R6ClassGenerator of length 24.

Methods

The following methods are available, in addition to those provided by the AzureRMR::az_resource class:

  • new(...): Initialize a new AKS object.

  • get_cluster(config, role): Return an object representing the Docker registry endpoint.

Details

Initializing a new object of this class can either retrieve an existing AKS resource, or create a new resource on the host. Generally, the best way to initialize an object is via the get_aks, create_aks or list_aks methods of the az_resource_group class, which handle the details automatically.

Note that this class is separate from the Kubernetes cluster itself. This class exposes methods for working with the Azure resource: updating resource tags, updating and deleting the resource (including updating the Kubernetes version), and so on.

For working with the cluster, including deploying images, services, etc use the object generated with the get_cluster method. This method takes two optional arguments:

  • config: The file in which to store the cluster configuration details. By default, this will be located in the AzureR configuration directory if it exists (see AzureAuth::AzureR_dir); otherwise, in the R temporary directory. To use the Kubernetes default ~/.kube/config file, set this argument to NULL. Note that any existing file in the given location will be overwritten.

  • role: This can be "User" (the default) or "Admin".

See Also

create_aks, get_aks, delete_aks, list_aks, AzureAuth::AzureR_dir

kubernetes_cluster for interacting with the cluster endpoint

AKS documentation and API reference

Examples

Run this code
# NOT RUN {
# recommended way of retrieving a cluster: via a resource group object
rg <- AzureRMR::az_rm$
    new(tenant="myaadtenant.onmicrosoft.com", app="app_id", password="password")$
    get_subscription("subscription_id")$
    get_resource_group("rgname")

myaks <- rg$get_aks("mycluster")

# sync with Azure: AKS resource creation can take a long time, use this to track status
myaks$sync_fields()

# get the cluster endpoint
kubclus <- myaks$get_cluster()

# }

Run the code above in your browser using DataLab