How to assign static ip address in Ubuntu 17.10 (Artful Aardvark)

From ubuntu 17.10 he package ifupdown and so /etc/network/interfaces are no longer used. Ubuntu 17.10 Server uses the package netplan instead, which configures systemd-networkd.