Page MenuHomePhabricator

[tbs.harbor] Rebuild toolsbeta-harborweb-2 with debian 11(bullseye)
Closed, ResolvedPublic

Description

Create a new 'toolsbeta-harborweb-3' directly with debian 11 and start the docker-compose setup there.

We might want to rename the VM to something like 'toolsbeta-harbor-1' instead.

The steps would be:

  • Create the new VM (with the debian-11 image, same specs, security groups default + harbor)
  • Setup the docker-compose stuff there (hopefully with puppet, from the puppetization task)
  • Start the containers (if puppet did not do it)
  • At this point, you can try to access the instance using an ssh tunnel or similar (not really needed, though would be nice)

The next is the tricky part:

  • Swap the instance that is being pointed to by the harbor.toolsbeta.wmflabs.org floating IP (that is done in the horizon UI, under Network->Floating IPs), you have to dissasociate it, and then associate it with the new instance
  • Make sure that the new instance is in the 'harbor' security group too

All this (except the floating ip) can be done also with the cookbook:

dcaro@vulcanus$ cookbook wmcs.vps.create_instance_with_prefix -h
usage: cookbooks.wmcs.vps.create_instance_with_prefix [-h] [--project PROJECT] [--task-id TASK_ID] [--no-dologmsg] [--prefix PREFIX] [--flavor FLAVOR] [--image IMAGE] [--network NETWORK] [--security-group SECURITY_GROUP]
                                                      [--server-group SERVER_GROUP] [--server-group-policy {soft-anti-affinity,anti-affinity,affinity,soft-affinity}] [--ssh-retries SSH_RETRIES]

WMCS Toolforge - Add a new instance to the given prefix.

It will make sure to use the same flavor, network, groups and increment the
index of the existing instance with the same prefix unless you pass a specific
one.

Usage example:
    cookbook wmcs.vps.create_instance_with_prefix         --project toolsbeta         --prefix toolsbeta-k8s-test-etcd         --security-group toolsbeta-k8s-full-connectivity

options:
  -h, --help            show this help message and exit
  --project PROJECT     Relevant Cloud VPS openstack project (for operations, dologmsg, etc). If this cookbook is for hardware, this only affects dologmsg calls. Default is 'admin'.
  --task-id TASK_ID     Id of the task related to this operation (ex. T123456). (default: None)
  --no-dologmsg         To disable dologmsg calls (no SAL messages on IRC). (default: False)
  --prefix PREFIX       Prefix for the instance (ex. toolsbeta-test-k8s-etcd). (default: None)
  --flavor FLAVOR       Flavor for the new instance (will use the same as the latest existing one by default, ex. g2.cores4.ram8.disk80, ex. 06c3e0a1-f684-4a0c-8f00-551b59a518c8). (default: None)
  --image IMAGE         Image for the new instance (will use the same as the latest existing one by default, ex. debian-10.0-buster, ex. 64351116-a53e-4a62-8866-5f0058d89c2b) (default: None)
  --network NETWORK     Network for the new instance (will use the same as the latest existing one by default, ex. lan-flat-cloudinstances2b, ex. a69bdfad-d7d2-4cfa-8231-3d6d3e0074c9) (default: None)
  --security-group SECURITY_GROUP
                        Extra security group to put the instance in (will alway add the 'default' security group, and then this one, '<project>-k8s-full-connectivity' by default). If it does not exist it will be created allowing all traffic
                        between instances of the group (ex. ). (default: None)
  --server-group SERVER_GROUP
                        Server group to start the instance in. If it does not exist, it will create it with the given server-group-policy, will use the same as '--prefix' by default (ex. toolsbeta-test-k8s-etcd). (default: None)
  --server-group-policy {soft-anti-affinity,anti-affinity,affinity,soft-affinity}
                        Server group policy to start the instance in. If it does not exist, it will create it with anti-affinity policy, will use the same as '--prefix' by default (ex. toolsbeta-test-k8s-etcd). (default: anti-affinity)
  --ssh-retries SSH_RETRIES
                        Number of time that it will try to ssh to the new instance after starting it up, it will wait for 1min between tries. (default: 15)

Event Timeline

In the title, did you mean toolsbeta-harbordb-2?

In the title, did you mean toolsbeta-harbordb-2?

Jajajaja, yep xd

dcaro renamed this task from [tbs.harbor] Rebuild toolsbeta-harbordb-1 with debian 11(bullseye) to [tbs.harbor] Rebuild toolsbeta-harborweb-2 with debian 11(bullseye).Aug 29 2022, 2:11 PM

How complicated is this? Would I be able to do it if someone broke it down into a list of steps for me?

Should be fairly easy if everything goes well (what I expect), and could get complicated if we hit some weird bug/setup issue.

I'll update the task description a bit, no commitments though, feel free to ask for more details or do another task if you prefer.

  • Setup the docker-compose stuff there (hopefully with puppet, from the puppetization task)

So should we tackle that task first? The cookbook doesn't address this, right?

yes, that's the subtask (I have been adding subtasks as 'requirements' for the parent task)

dcaro changed the task status from Open to In Progress.Oct 24 2022, 8:57 AM
dcaro moved this task from To refine to Doing on the User-dcaro board.

Change 848354 had a related patch set uploaded (by David Caro; author: David Caro):

[operations/puppet@production] reprepro: add kubeadm-k8s-1-21/22 bullseye suite

https://gerrit.wikimedia.org/r/848354

Change 848356 had a related patch set uploaded (by David Caro; author: David Caro):

[operations/puppet@production] p::toolforge:harbor: use distro docker for bullseye

https://gerrit.wikimedia.org/r/848356

Change 848354 abandoned by David Caro:

[operations/puppet@production] reprepro: add kubeadm-k8s-1-21/22 bullseye suite

Reason:

Yep, this is not needed, replaced by If8fa5dd063e484004d315977a03b23314da73ae8

https://gerrit.wikimedia.org/r/848354

dcaro moved this task from Doing to Done on the User-dcaro board.

Change 848356 merged by David Caro:

[operations/puppet@production] p::toolforge:harbor: use distro docker for bullseye

https://gerrit.wikimedia.org/r/848356