On a day-to-day basis, continuous deployment is designed to be used through the GUI.

However during set up and sometimes when requiring more information that the UI provides, fluxctl provides a more comprehensive API. The --help for fluxctl is described below.

Workflow:
  fluxctl list-services                                        # Which services are running?
  fluxctl list-images --service=default/foo                    # Which images are running/available?
  fluxctl release --service=default/foo --update-image=bar:v2  # Release new version.
  fluxctl history --service=default/foo                        # Review what happened

Usage:
  fluxctl [command]

Available Commands:
  automate      Turn on automatic deployment for a service.
  check-release Check the status of a release.
  deautomate    Turn off automatic deployment for a service.
  get-config    display configuration values for an instance
  history       Show the history of a service or all services
  list-images   Show the deployed and available images for a service.
  list-services List services currently running on the platform.
  lock          Lock a service, so it cannot be deployed.
  release       Release a new version of a service.
  set-config    set configuration values for an instance
  status        display current system status
  unlock        Unlock a service, so it can be deployed.
  version       Output the version of fluxctl

Viewing Services

The first thing to do is to check whether Flux can see any running services. To do this, use the list-services subcommand:

$ fluxctl list-services                   
SERVICE                           CONTAINER             IMAGE                                                       RELEASE  POLICY
default/fluxsvc                   fluxd                 weaveworks/fluxd:test                                                
                                  fluxsvc               weaveworks/fluxsvc:test                                              
default/kubernetes                                                                                                           
default/memcached                 memcached             memcached:1.4.25                                                     
kube-system/kube-dns              kubedns               gcr.io/google_containers/kubedns-amd64:1.9                           
                                  dnsmasq               gcr.io/google_containers/kube-dnsmasq-amd64:1.4                      
                                  healthz               gcr.io/google_containers/exechealthz-amd64:1.2                       
kube-system/kubernetes-dashboard  kubernetes-dashboard  gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1      

Inspecting the Version of a Container

With a list of services, you can begin to inspect which versions of the image are running.

$ fluxctl list-images --service kube-system/kube-dns
SERVICE               CONTAINER  IMAGE                                        CREATED
kube-system/kube-dns  kubedns    gcr.io/google_containers/kubedns-amd64       
                                 '-> 1.9                                      19 Nov 16 00:06 UTC
                                     1.8                                      29 Sep 16 16:43 UTC
                                     1.7                                      24 Aug 16 21:39 UTC
                                     1.6-test                                 02 Jul 16 02:05 UTC
                                     1.6                                      29 Jun 16 22:05 UTC
                                     1.5                                      24 Jun 16 06:26 UTC
                                     1.4                                      22 Jun 16 19:41 UTC
                                     1.3                                      04 Jun 16 03:29 UTC
                                     1.2                                      02 Jun 16 22:12 UTC
                                     1.2.test                                 28 May 16 01:19 UTC
                      dnsmasq    gcr.io/google_containers/kube-dnsmasq-amd64  
                                 :                                            
                                 '-> 1.4                                      29 Sep 16 16:26 UTC
                      healthz    gcr.io/google_containers/exechealthz-amd64   
                                 :                                            
                                 '-> 1.2                                      22 Sep 16 22:25 UTC

The arrows will point to the version that is currently running alongside a list of other versions and their timestamps.

Releasing a Service

Update a service with the release subcommand. This checks whether each service needs to be updated, and if so, it also writes the new configuration to the repository.

$ fluxctl list-images --service default/helloworld 
SERVICE             CONTAINER   IMAGE                          CREATED
default/helloworld  helloworld  quay.io/weaveworks/helloworld  
                                |   master-9a16ff945b9e        20 Jul 16 13:19 UTC
                                |   master-b31c617a0fe3        20 Jul 16 13:19 UTC
                                '-> master-a000002             12 Jul 16 17:17 UTC
                                    master-a000001             12 Jul 16 17:16 UTC
                    sidecar     quay.io/weaveworks/sidecar     
                                '-> master-a000002             23 Aug 16 10:05 UTC
                                    master-a000001             23 Aug 16 09:53 UTC

$ fluxctl release --service=default/helloworld --update-all-images
Submitting release job...
Release job submitted, ID c5e39f46-171d-349e-ac43-fbbc17018848
Status: Complete.

Here's what happened:
 1) Queued.
 2) Calculating release actions.
 3) Release latest images to default/helloworld
 4) Service default/helloworld image quay.io/weaveworks/sidecar:master-a000002 is already the latest one; skipping.
 5) Clone the config repo.
 6) Clone OK.
 7) Update 1 images(s) in the resource definition file for default/helloworld: helloworld (quay.io/weaveworks/helloworld:master-a000002 -> quay.io/weaveworks/helloworld:master-9a16ff945b9e).
 8) Update pod controller OK.
 9) Commit and push the config repo.
 10) Pushed commit: Release latest images to default/helloworld
 11) Release 1 service(s): default/helloworld.
Took 8.306013228s

$ fluxctl list-images --service default/helloworld    
SERVICE             CONTAINER   IMAGE                          CREATED
default/helloworld  helloworld  quay.io/weaveworks/helloworld  
                                '-> master-9a16ff945b9e        20 Jul 16 13:19 UTC
                                    master-b31c617a0fe3        20 Jul 16 13:19 UTC
                                    master-a000002             12 Jul 16 17:17 UTC
                                    master-a000001             12 Jul 16 17:16 UTC
                    sidecar     quay.io/weaveworks/sidecar     
                                '-> master-a000002             23 Aug 16 10:05 UTC
                                    master-a000001             23 Aug 16 09:53 UTC

See fluxctl release --help for more information.

Turning on Automation

Automation can be easily controlled from within Weave Cloud by selecting the “Automate” button when inspecting a service. But we can also do this from fluxctl with the automate subcommand.

$ fluxctl automate --service=default/helloworld

$ fluxctl list-services                                                 
SERVICE                           CONTAINER             IMAGE                                                       RELEASE  POLICY
default/fluxsvc                   fluxd                 weaveworks/fluxd:test                                                
                                  fluxsvc               weaveworks/fluxsvc:test                                              
default/helloworld                helloworld            quay.io/weaveworks/helloworld:master-9a16ff945b9e                    automated
                                  sidecar               quay.io/weaveworks/sidecar:master-a000002                            
default/kubernetes                                                                                                           
default/memcached                 memcached             memcached:1.4.25                                                     
kube-system/kube-dns              kubedns               gcr.io/google_containers/kubedns-amd64:1.9                           
                                  dnsmasq               gcr.io/google_containers/kube-dnsmasq-amd64:1.4                      
                                  healthz               gcr.io/google_containers/exechealthz-amd64:1.2                       
kube-system/kubernetes-dashboard  kubernetes-dashboard  gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1           

The list-services subcommand reports that the helloworld application is automated. Deploy automatically releases and deploys a new version of a service whenever one is available and also updates the configuration to the version control system.

Further Reading

Managing & Automating Releases