How to upgrade a charm


#1

The process to upgrade a charm to an specific revision is very straight forward, and the main purpose of this feature is to be able to make bugfixes to an already deployed Canonical Distribution of OSM.

Let’s imagine you are in this status:

grafana-k8s              active      1  grafana-k8s     jujucharms   13  kubernetes  10.152.183.74   
kafka-k8s                active      1  kakfa-k8s       jujucharms    8  kubernetes  10.152.183.5    
keystone-k8s             active      1  keystone-k8s    jujucharms    8  kubernetes  10.152.183.218  
lcm-k8s                  active      1  lcm-k8s         jujucharms   10  kubernetes  10.152.183.59   
manodb                   active      1  mariadb-k8s     jujucharms    9  kubernetes  10.152.183.87   
mon-k8s                  active      1  mon-k8s         jujucharms    9  kubernetes  10.152.183.62   
mongodb-k8s              active      1  mongodb-k8s     jujucharms    8  kubernetes  10.152.183.107  
nbi-k8s                  active      1  nbi-k8s         jujucharms   10  kubernetes  10.152.183.131  
pol-k8s                  active      1  pol-k8s         jujucharms    9  kubernetes  10.152.183.158  
prometheus-k8s           active      1  prometheus-k8s  jujucharms    9  kubernetes  10.152.183.96   
ro-k8s                   active      1  ro-k8s          jujucharms    9  kubernetes  10.152.183.6    
ui-k8s                   active      1  ui-k8s          jujucharms   21  kubernetes  10.152.183.99   
vimdb                    active      1  mariadb-k8s     jujucharms    9  kubernetes  10.152.183.186  
zookeeper-k8s            active      1  zookeeper-k8s   jujucharms   11  kubernetes  10.152.183.57   

Unit               Workload  Agent  Address     Ports                       Message
grafana-k8s/1*     active    idle   10.1.1.107  3000/TCP                    configured
kafka-k8s/1*       active    idle   10.1.1.101  9092/TCP                    configured
keystone-k8s/1*    active    idle   10.1.1.100  5000/TCP                    configured
lcm-k8s/1*         active    idle   10.1.1.108  80/TCP                      configured
manodb/1*          active    idle   10.1.1.94   3306/TCP                    configured
mon-k8s/1*         active    idle   10.1.1.103  8000/TCP                    configured
mongodb-k8s/1*     active    idle   10.1.1.95   27017/TCP                   configured
nbi-k8s/1*         active    idle   10.1.1.105  9999/TCP                    configured
pol-k8s/1*         active    idle   10.1.1.104  80/TCP                      configured
prometheus-k8s/1*  active    idle   10.1.1.106  9090/TCP                    configured
ro-k8s/1*          active    idle   10.1.1.102  9090/TCP                    configured
ui-k8s/1*          active    idle   10.1.1.109  80/TCP                      configured
vimdb/1*           active    idle   10.1.1.99   3306/TCP                    configured
zookeeper-k8s/1*   active    idle   10.1.1.98   2181/TCP,2888/TCP,3888/TCP  configured

If you want to upgrade the ui-k8s to the revision number 22, you just need to execute the following command:

$ juju upgrade-charm ui-k8s --revision 22

You will see this result after a minute:

grafana-k8s              active      1  grafana-k8s     jujucharms   13  kubernetes  10.152.183.74   
kafka-k8s                active      1  kakfa-k8s       jujucharms    8  kubernetes  10.152.183.5    
keystone-k8s             active      1  keystone-k8s    jujucharms    8  kubernetes  10.152.183.218  
lcm-k8s                  active      1  lcm-k8s         jujucharms   10  kubernetes  10.152.183.59   
manodb                   active      1  mariadb-k8s     jujucharms    9  kubernetes  10.152.183.87   
mon-k8s                  active      1  mon-k8s         jujucharms    9  kubernetes  10.152.183.62   
mongodb-k8s              active      1  mongodb-k8s     jujucharms    8  kubernetes  10.152.183.107  
nbi-k8s                  active      1  nbi-k8s         jujucharms   10  kubernetes  10.152.183.131  
pol-k8s                  active      1  pol-k8s         jujucharms    9  kubernetes  10.152.183.158  
prometheus-k8s           active      1  prometheus-k8s  jujucharms    9  kubernetes  10.152.183.96   
ro-k8s                   active      1  ro-k8s          jujucharms    9  kubernetes  10.152.183.6    
ui-k8s                   active      1  ui-k8s          jujucharms   22  kubernetes  10.152.183.99   
vimdb                    active      1  mariadb-k8s     jujucharms    9  kubernetes  10.152.183.186  
zookeeper-k8s            active      1  zookeeper-k8s   jujucharms   11  kubernetes  10.152.183.57   

Unit               Workload  Agent  Address     Ports                       Message
grafana-k8s/1*     active    idle   10.1.1.107  3000/TCP                    configured
kafka-k8s/1*       active    idle   10.1.1.101  9092/TCP                    configured
keystone-k8s/1*    active    idle   10.1.1.100  5000/TCP                    configured
lcm-k8s/1*         active    idle   10.1.1.108  80/TCP                      configured
manodb/1*          active    idle   10.1.1.94   3306/TCP                    configured
mon-k8s/1*         active    idle   10.1.1.103  8000/TCP                    configured
mongodb-k8s/1*     active    idle   10.1.1.95   27017/TCP                   configured
nbi-k8s/1*         active    idle   10.1.1.105  9999/TCP                    configured
pol-k8s/1*         active    idle   10.1.1.104  80/TCP                      configured
prometheus-k8s/1*  active    idle   10.1.1.106  9090/TCP                    configured
ro-k8s/1*          active    idle   10.1.1.102  9090/TCP                    configured
ui-k8s/2*          active    idle   10.1.1.109  80/TCP                      configured
vimdb/1*           active    idle   10.1.1.99   3306/TCP                    configured
zookeeper-k8s/1*   active    idle   10.1.1.98   2181/TCP,2888/TCP,3888/TCP  configured