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