github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/commands/deployment/promote.mdx (about) 1 --- 2 layout: docs 3 page_title: 'Commands: deployment promote' 4 sidebar_title: promote 5 description: | 6 The deployment promote command is used to promote canaries in a deployment. 7 --- 8 9 # Command: deployment promote 10 11 The `deployment promote` command is used to promote task groups in a deployment. 12 Promotion should occur when the deployment has placed canaries for a task group 13 and those canaries have been deemed healthy. When a task group is promoted, the 14 rolling upgrade of the remaining allocations is unblocked. If the canaries are 15 found to be unhealthy, the deployment may either be failed using the "nomad 16 deployment fail" command, the job can be failed forward by submitting a new 17 version or failed backwards by reverting to an older version using the 18 [`job revert`] command. 19 20 ## Usage 21 22 ```plaintext 23 nomad deployment promote [options] <deployment id> 24 ``` 25 26 The `deployment promote` command requires a single argument, a deployment ID or 27 prefix. When run without specifying any groups to promote, the promote command 28 promotes all task groups. The group flag can be specified multiple times to 29 select particular groups to promote. 30 31 ## General Options 32 33 @include 'general_options.mdx' 34 35 ## Promote Options 36 37 - `-group`: Group may be specified many times and is used to promote that 38 particular group. If no specific groups are specified, all groups are 39 promoted. 40 41 - `-detach`: Return immediately instead of monitoring. A new evaluation ID 42 will be output, which can be used to examine the evaluation using the 43 [eval status] command 44 45 - `-verbose`: Show full information. 46 47 ## Examples 48 49 Promote canaries in all groups: 50 51 ```shell 52 # Have two task groups waiting for promotion. 53 $ nomad status example 54 ID = example 55 Name = example 56 Submit Date = 07/25/17 18:35:05 UTC 57 Type = service 58 Priority = 50 59 Datacenters = dc1 60 Status = running 61 Periodic = false 62 Parameterized = false 63 64 Summary 65 Task Group Queued Starting Running Failed Complete Lost 66 cache 0 0 3 0 0 0 67 web 0 0 3 0 0 0 68 69 Latest Deployment 70 ID = 9fa81f27 71 Status = running 72 Description = Deployment is running but requires manual promotion 73 74 Deployed 75 Task Group Promoted Desired Canaries Placed Healthy Unhealthy 76 web false 2 1 1 0 0 77 cache false 2 1 1 0 0 78 79 Allocations 80 ID Node ID Task Group Version Desired Status Created At 81 091377e5 a8dcce2d web 1 run running 07/25/17 18:35:05 UTC 82 d2b13584 a8dcce2d cache 1 run running 07/25/17 18:35:05 UTC 83 4bb185b7 a8dcce2d web 0 run running 07/25/17 18:31:34 UTC 84 9b6811ee a8dcce2d cache 0 run running 07/25/17 18:31:34 UTC 85 e0a2441b a8dcce2d cache 0 run running 07/25/17 18:31:34 UTC 86 f2409f7d a8dcce2d web 0 run running 07/25/17 18:31:34 UTC 87 88 # Promote all groups within the deployment 89 $ nomad deployment promote 9fa81f27 90 ==> Monitoring evaluation "6c6e64ae" 91 Evaluation triggered by job "example" 92 Evaluation within deployment: "9fa81f27" 93 Allocation "8fa21654" created: node "a8dcce2d", group "web" 94 Allocation "9f6727a6" created: node "a8dcce2d", group "cache" 95 Evaluation status changed: "pending" -> "complete" 96 ==> Evaluation "6c6e64ae" finished with status "complete" 97 98 # Inspect the status and see both groups have been promoted. 99 $ nomad status example 100 ID = example 101 Name = example 102 Submit Date = 07/25/17 18:35:05 UTC 103 Type = service 104 Priority = 50 105 Datacenters = dc1 106 Status = running 107 Periodic = false 108 Parameterized = false 109 110 Summary 111 Task Group Queued Starting Running Failed Complete Lost 112 cache 0 0 2 0 2 0 113 web 0 0 2 0 2 0 114 115 Latest Deployment 116 ID = 9fa81f27 117 Status = successful 118 Description = Deployment completed successfully 119 120 Deployed 121 Task Group Promoted Desired Canaries Placed Healthy Unhealthy 122 web true 2 1 2 2 0 123 cache true 2 1 2 2 0 124 125 Allocations 126 ID Node ID Task Group Version Desired Status Created At 127 8fa21654 a8dcce2d web 1 run running 07/25/17 18:35:21 UTC 128 9f6727a6 a8dcce2d cache 1 run running 07/25/17 18:35:21 UTC 129 091377e5 a8dcce2d web 1 run running 07/25/17 18:35:05 UTC 130 d2b13584 a8dcce2d cache 1 run running 07/25/17 18:35:05 UTC 131 4bb185b7 a8dcce2d web 0 stop complete 07/25/17 18:31:34 UTC 132 9b6811ee a8dcce2d cache 0 stop complete 07/25/17 18:31:34 UTC 133 e0a2441b a8dcce2d cache 0 stop complete 07/25/17 18:31:34 UTC 134 f2409f7d a8dcce2d web 0 stop complete 07/25/17 18:31:34 UTC 135 ``` 136 137 Promote canaries in a particular group: 138 139 ```shell 140 # Have two task groups waiting for promotion. 141 $ nomad status example 142 ID = example 143 Name = example 144 Submit Date = 07/25/17 18:37:14 UTC 145 Type = service 146 Priority = 50 147 Datacenters = dc1 148 Status = running 149 Periodic = false 150 Parameterized = false 151 152 Summary 153 Task Group Queued Starting Running Failed Complete Lost 154 cache 0 0 3 0 0 0 155 web 0 0 3 0 0 0 156 157 Latest Deployment 158 ID = a6b87a6c 159 Status = running 160 Description = Deployment is running but requires manual promotion 161 162 Deployed 163 Task Group Promoted Desired Canaries Placed Healthy Unhealthy 164 cache false 2 1 1 1 0 165 web false 2 1 1 1 0 166 167 Allocations 168 ID Node ID Task Group Version Desired Status Created At 169 3071ab8f 6240eed6 web 1 run running 07/25/17 18:37:14 UTC 170 eeeed13b 6240eed6 cache 1 run running 07/25/17 18:37:14 UTC 171 0ee7800c 6240eed6 cache 0 run running 07/25/17 18:37:08 UTC 172 a714a926 6240eed6 cache 0 run running 07/25/17 18:37:08 UTC 173 cee52788 6240eed6 web 0 run running 07/25/17 18:37:08 UTC 174 ee8f972e 6240eed6 web 0 run running 07/25/17 18:37:08 UTC 175 176 # Promote only the cache canaries 177 $ nomad deployment promote -group cache a6b87a6c 178 ==> Monitoring evaluation "37383564" 179 Evaluation triggered by job "example" 180 Evaluation within deployment: "a6b87a6c" 181 Allocation "bbddf5c3" created: node "6240eed6", group "cache" 182 Evaluation status changed: "pending" -> "complete" 183 ==> Evaluation "37383564" finished with status "complete" 184 185 # Inspect the status and see that only the cache canaries are promoted 186 $ nomad status example 187 ID = example 188 Name = example 189 Submit Date = 07/25/17 18:37:14 UTC 190 Type = service 191 Priority = 50 192 Datacenters = dc1 193 Status = running 194 Periodic = false 195 Parameterized = false 196 197 Summary 198 Task Group Queued Starting Running Failed Complete Lost 199 cache 0 0 2 0 2 0 200 web 0 0 3 0 0 0 201 202 Latest Deployment 203 ID = a6b87a6c 204 Status = running 205 Description = Deployment is running but requires manual promotion 206 207 Deployed 208 Task Group Promoted Desired Canaries Placed Healthy Unhealthy 209 web false 2 1 1 1 0 210 cache true 2 1 2 2 0 211 212 Allocations 213 ID Node ID Task Group Version Desired Status Created At 214 bbddf5c3 6240eed6 cache 1 run running 07/25/17 18:37:40 UTC 215 eeeed13b 6240eed6 cache 1 run running 07/25/17 18:37:14 UTC 216 3071ab8f 6240eed6 web 1 run running 07/25/17 18:37:14 UTC 217 a714a926 6240eed6 cache 0 stop complete 07/25/17 18:37:08 UTC 218 cee52788 6240eed6 web 0 run running 07/25/17 18:37:08 UTC 219 ee8f972e 6240eed6 web 0 run running 07/25/17 18:37:08 UTC 220 0ee7800c 6240eed6 cache 0 stop complete 07/25/17 18:37:08 UTC 221 ``` 222 223 [`job revert`]: /docs/commands/job/revert 224 [eval status]: /docs/commands/eval-status