New 2.6 feature: Kubernetes cloud enhancements

In Juju v.2.6.0, the following enhancements to Kubernetes cloud support become available:

  • When Kubernetes clusters are added to Juju using the add-k8s command, storage classes and storage pools are set up automatically. It is also not necessary to request an explicit storage pool when deploying charms that have storage requirements. All this removes a lot of the heartache out of figuring out dynamic storage. The following tutorials show the way:

    If auto-configuration does not succeed then the operator will be asked to re-run add-k8s but with command options that will assist with either the querying of the cluster and/or the establishment of an actual storage class.

  • Kubernetes models are detected automatically and provisioner ‘kubernetes’ is assumed in the create-storage-pool command. This means shorter commands for operators.

  • A MicroK8s installation is detected automatically and added as a known cloud (‘microk8s’). Being a known cloud, a controller may now be created per usual (juju bootstrap microk8s). MicroK8s takes advantage of the previous enhancement as well. All this makes MicroK8s super easy to use with Juju. The Using Juju with MicroK8s tutorial has been updated to include these new features.

  • Kubernetes clusters from the below sources can be added as known clouds via the add-k8s command:

    • Azure Kubernetes Service (AKS)
    • Google Kubernetes Engine (GKE)
    • CDK (with an integrator charm) deployed to Amazon AWS, Microsoft Azure, or Google GCE
    • CDK or kubernetes-core deployed to LXD

    Like MIcroK8s, these being known clouds a controller may be created, per usual, with the bootstrap command.

    AKS and GKE have special helper modes that enable their respective, independently installed, CLI toolkits (az for AKS and gcloud for GKE). They are accessible via options --aks and --gke. Any other cluster type added manually still requires the kubeconfig file.

    For example, assuming we have a GKE-based cluster called ‘hello-cluster’, it can be added to the Juju client’s local list of clouds in this way:

    juju add-k8s --local --gke hello-cluster

    The cluster is now known to Juju as a cloud (i.e. it is included in the output for juju clouds --local) and so a controller, here named ‘k8s-hc’, can be created like so:

    juju bootstrap hello-cluster k8s-hc

    To get started with GKE, see appendix Installing a GKE cluster.