aztk icon indicating copy to clipboard operation
aztk copied to clipboard

Is there a way to change DOCKER_OPTS ?

Open tadas-subonis opened this issue 7 years ago • 8 comments

I would like to change the subnet for docker0 interfaces as it overlaps with my subnets in other VNETs.

Is there a way to do that somehow when creating a cluster?

Thanks

tadas-subonis avatar May 10 '18 19:05 tadas-subonis

There is not currently a way to do this. For now, you would have to make sure that your other subnets don't overlap.

This is currently outside the capabilities of plugins, too, since this would need to occur before we start docker (or else it would require a restart).

jafreck avatar May 10 '18 19:05 jafreck

Thanks.

Maybe there would be a way to put a file like the one mentioned here: https://success.docker.com/article/how-do-i-configure-the-default-bridge-docker0-network-for-docker-engine-to-a-different-subnet before docker starts? Or maybe this functionality could be built in as a part of docker configuration in cluster.yml?

Also, is there a way, to restart an entire cluster from the command line?

Thanks

On Thu, May 10, 2018 at 9:42 PM Jacob Freck [email protected] wrote:

There is not currently a way to do this. For now, you would have to make sure that your other subnets don't overlap.

This is currently outside the capabilities of plugins, too, since this would need to occur before we start docker (or else it would require a restart).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Azure/aztk/issues/550#issuecomment-388163284, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPFspf0j8g0K7UP-jaB982hD2Z6IT1hks5txJgwgaJpZM4T6ayA .

--

Kind Regards, Tadas Šubonis

tadas-subonis avatar May 10 '18 20:05 tadas-subonis

We'll look into supporting that natively as well as adding more functionality to the plugins to be able to run before we start docker.

What do you mean by restart. Do you want to actually reboot all the nodes and go through the init process again or do you just want restart spark?

timotheeguerin avatar May 10 '18 20:05 timotheeguerin

I want to restart Docker so it would pickup the changes from /etc/docker/daemon.json file that I've uploaded through a custom script.

tadas-subonis avatar May 10 '18 21:05 tadas-subonis

what you could do(Though I would not recommend) in the meantime is in a plugin(Custom script are deprecated) write your doc opts then run docker restart spark (Still inside your plugin) This should work as a workaround

timotheeguerin avatar May 10 '18 21:05 timotheeguerin

That sounds good - I'll try.

If that doesn't work, I guess

systemctl restart docker

will do the job.

tadas-subonis avatar May 10 '18 21:05 tadas-subonis

yeah you might actually have to do that

timotheeguerin avatar May 10 '18 21:05 timotheeguerin

For those that are interested, I got it to work with a plugin like this:

plugins:
  - name: docker-bip
    script: custom-scripts/create-docker-config.sh
    target: host
    target_role: all-nodes

and its content:

#!/bin/bash


cat << EOF > /etc/docker/daemon.json
{
  "bip": "172.26.0.1/16"
}
EOF

systemctl restart docker
docker start spark

In the end, that didn't solve my problem, as it seems that Azure Batch has some connectivity issues with peered VNETs (or unless I messed something up).

tadas-subonis avatar May 11 '18 16:05 tadas-subonis