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