3.6 to4.0containeragentaction-failaction-getaction-logaction-setapplication-version-setclose-portconfig-getcredential-getgoal-stateis-leaderjuju-logjuju-rebootleader-getleader-setnetwork-getopen-portopened-portspayload-registerpayload-status-setpayload-unregisterrelation-getrelation-idsrelation-listrelation-model-getrelation-setresource-getsecret-addsecret-getsecret-grantsecret-idssecret-info-getsecret-removesecret-revokesecret-setstate-deletestate-getstate-setstatus-getstatus-setstorage-addstorage-getstorage-listunit-getjuju CLIjuju CLI commandsjujuactionsjujuadd-cloudjujuadd-credentialjujuadd-k8sjujuadd-machinejujuadd-modeljujuadd-secretjujuadd-secret-backendjujuadd-spacejujuadd-ssh-keyjujuadd-storagejujuadd-unitjujuadd-userjujuagreejujuagreementsjujuattach-resourcejujuattach-storagejujuautoload-credentialsjujubindjujubootstrapjujucancel-taskjujuchange-user-passwordjujucharm-resourcesjujucloudsjujuconfigjujuconstraintsjujuconsumejujucontroller-configjujucontrollersjujucreate-backupjujucreate-storage-pooljujucredentialsjujudashboardjujudebug-codejujudebug-hooksjujudebug-logjujudefault-credentialjujudefault-regionjujudeployjujudestroy-controllerjujudestroy-modeljujudetach-storagejujudiff-bundlejujudisable-commandjujudisable-userjujudisabled-commandsjujudocumentationjujudownloadjujudownload-backupjujuenable-commandjujuenable-destroy-controllerjujuenable-hajujuenable-userjujuexecjujuexport-bundlejujuexposejujufindjujufind-offersjujufirewall-rulesjujugrantjujugrant-cloudjujugrant-secretjujuhelpjujuhelp-action-commandsjujuhelp-hook-commandsjujuimport-filesystemjujuimport-ssh-keyjujuinfojujuintegratejujukill-controllerjujuloginjujulogoutjujumachinesjujumigratejujumodel-configjujumodel-constraintsjujumodel-defaultsjujumodelsjujumove-to-spacejujuofferjujuoffersjujuoperationsjujupayloadsjujurefreshjujuregionsjujuregisterjujureload-spacesjujuremove-applicationjujuremove-cloudjujuremove-credentialjujuremove-k8sjujuremove-machinejujuremove-offerjujuremove-relationjujuremove-saasjujuremove-secretjujuremove-secret-backendjujuremove-spacejujuremove-ssh-keyjujuremove-storagejujuremove-storage-pooljujuremove-unitjujuremove-userjujurename-spacejujuresolvedjujuresourcesjujuresume-relationjujuretry-provisioningjujurevokejujurevoke-cloudjujurevoke-secretjujurunjujuscale-applicationjujuscpjujusecret-backendsjujusecretsjujuset-application-basejujuset-constraintsjujuset-credentialjujuset-firewall-rulejujuset-model-constraintsjujushow-actionjujushow-applicationjujushow-cloudjujushow-controllerjujushow-credentialjujushow-machinejujushow-modeljujushow-offerjujushow-operationjujushow-secretjujushow-secret-backendjujushow-spacejujushow-status-logjujushow-storagejujushow-taskjujushow-unitjujushow-userjujuspacesjujusshjujussh-keysjujustatusjujustoragejujustorage-poolsjujusubnetsjujususpend-relationjujuswitchjujusync-agent-binaryjujutrustjujuunexposejujuunregisterjujuupdate-cloudjujuupdate-credentialjujuupdate-k8sjujuupdate-public-cloudsjujuupdate-secretjujuupdate-secret-backendjujuupdate-storage-pooljujuupgrade-controllerjujuupgrade-machinejujuupgrade-modeljujuusersjujuversionjujuwait-forjujuwait-for_applicationjujuwait-for_machinejujuwait-for_modeljujuwait-for_unitjujuwhoamijuju environment variablesjuju-metadatajuju-dashboard (The Juju dashboard)juju web CLIjujucjujudSee also:Cloud (substrate)
This document shows how to manage your existing cloud(s) with Juju.
See also:List of supported clouds
The procedure for how to add a cloud definition to Juju depends on whether the cloud is a machine (traditional, non-Kubernetes) cloud or a Kubernetes cloud – more below.
In either case, the cloud definition is saved to the directory defined in
theJUJU_DATA environment variable or, if that is not defined,
$XDG_DATA_HOME/juju or, if that is not defined,
~/.local/share/juju
in a file calledclouds.yaml.
First, check thelist of supported machine clouds to see if your cloud is supported, or the cloud-specific doc linked from there to see if your cloud must meet any prerequisites.
Then, if your cloud is a public cloud or a localhost LXD cloud: Juju likely already knows about it, so you can skip this step; runjujuclouds to verify.
Otherwise, to add a machine cloud to Juju, run theadd-cloud command:
juju add-cloud
This will start an interactive session where you’ll be asked to choose a cloud type (from a given list), the name that you want to use for your cloud, the API endpoint, the authentication type, etc. Juju will use this to create a cloud definition.
The command also has a manual mode where you can specify the desired cloud name and cloud definition file in-line; whether you want this definition to be known just to the Juju client or also to an existing controller (the latter creates what is known as a multi-cloud controller); etc.
See more:juju add-cloud,Cloud definition
First, check thelist of supported clouds to see if your cloud is supported, or the cloud-specific doc linked from there to see if your cloud must meet any prerequisites.
Then, if you’re using a localhost MicroK8s cloud installed from a strictly confined snap: Juju likely already knows about it, so you can skip this step; runjujuclouds to verify.
Otherwise, to add a Kubernetes cloud to Juju:
Prepare your kubeconfig file.
Run theadd-k8s command followed by the desired cloud name:
Important
If you have a Juju 3.0+ CLI client installed from snap and you’re using a public Kubernetes cloud (AKS, EKS, GKE):
Run this command with the ‘raw’ (not strictly confined) snap:/snap/juju/current/bin/jujuadd-k8s<cloudname>.
This is required because, starting with Juju 3.0, thejuju CLI client snap is a strictly confined snap, whereas the public cloud CLIs are not (seediscussion), and it is only necessary for this step – for any other step you can go back to using the client from the strictly confined snap (so, you can keep typing justjuju).
juju add-k8s <cloud name>
Juju will check the default location for the kubeconfig file and use the information in there to create a cloud definition.
The command also allows you to specify a non-default kubeconfig file path (via theKUBECONFIG environment variable); in the case where you have multiple cluster definitions and credentials in your kubeconfig file, which cluster and credential to use; what name you want to assign to your new cloud; whether you want to make this cloud known just to the client or also to an existing controller (the latter gives rise to what is known as a multi-cloud controller); etc.
See more:juju add-k8s
To get a list of all the clouds that your Juju client is currently aware of, run theclouds command with the--client and-all flags:
juju clouds --client --all
You can bootstrap a new controller using one of these clouds...Clouds available on the client:Cloud Regions Default Type Credentials Source Descriptionaws 22 us-east-1 ec2 0 public Amazon Web Servicesaws-china 2 cn-north-1 ec2 0 public Amazon Chinaaws-gov 2 us-gov-west-1 ec2 0 public Amazon (USA Government)azure 43 centralus azure 0 public Microsoft Azureazure-china 4 chinaeast azure 0 public Microsoft Azure Chinaequinix 25 px equinix 0 publicgoogle 25 us-east1 gce 0 public Google Cloud Platformlocalhost 1 localhost lxd 1 built-in LXD Container Hypervisormicrok8s 1 localhost k8s 1 built-in A Kubernetes Clusteroracle 4 us-phoenix-1 oci 0 public Oracle Compute Cloud Service
In the output, each line represents a cloud that Juju can interact with – the cloud name (that you will have to use to interact with the cloud), the number of cloud regions Juju is aware of, the default region (for the current Juju client), the type/API used to control it, the number of credentials associated with a cloud, the source of the cloud, and a brief description.
By omitting the flags, you will see a list of the clouds available on the client for which you have also registered the credentials. Alternatively, by passing other flags you can specify an output format or file, etc.
See more:juju clouds
To get more detail about a particular cloud, run theshow-cloud command followed by the cloud name. For example:
juju show-cloud azure
The command also has flags that allow you to specify whether you want this information from the client or a controller; whether you want the output to include the configuration options specific to the cloud; an output format or file; etc.
See more:juju show-cloud
To see which regions Juju is aware of for any given cloud, use theregions command. For example, for theaws cloud, run:
juju regions aws
Client Cloud Regionsus-east-1us-east-2us-west-1us-west-2ca-central-1eu-west-1eu-west-2eu-west-3eu-central-1eu-north-1eu-south-1af-south-1ap-east-1ap-south-1ap-southeast-1ap-southeast-2ap-southeast-3ap-northeast-1ap-northeast-2ap-northeast-3me-south-1sa-east-1
The command also has flags that allow you to select a specific controller, choose an output format or file, etc.
See more:juju regions
Set the default region. To set the default region for a cloud, run thedefault-region command followed by the name of the cloud and the name of the region that you want to start using as a default. For example:
juju default-region aws eu-central-1
If at any point you want to reset this value, drop the region argument and pass the--reset flag.
See more:juju default-region
Get the default region. To get the current default region for a cloud, run thedefault-region command followed by the name of the cloud. For example:
juju default-region azure-china
See more:juju default-region
The procedure for how to update a cloud on Juju depends on whether the cloud is public or private.
To synchronise the Juju client with changes occurring on public clouds (e.g. cloud API changes, new cloud regions) or on Juju’s side (e.g. support for a new cloud), run theupdate-public-clouds command:
juju update-public-clouds
The command also allows you to specify whether you want this update to happen on the client or a controller.
See more:juju update-public-clouds
To update Juju’s definition for a private cloud, run theupdate-cloud command followed by the cloud name and the-f flag followed by the path to the new cloud definition file. For example:
juju update-cloud mymaas -f path/to/maas.yaml
The command also allows you to indicate whether the update should happen on the client or the controller; to update the definition on a controller to match the one on the client; etc.
See more:juju update-cloud
See also:Removing things
Given a cloud definition that you’ve added explicitly to Juju viaadd-cloud oradd-k8s, to remove that definition from Juju, run theremove-cloud command followed by the name of the cloud. For example:
juju remove-cloud lxd-remote
The command also allows you to specify whether this operation should be performed on the client or a on a specific controller.
See more:juju remove-cloud