Currently, there is a project to build a MAAS + kubernetes environment in-house.
I will describe what I did and what I stumbled upon. P>
Build a server on Ubuntu and deploy Ubuntu OS in an independent network via PXE boot. P>
Make sure that DHCP does not exist on the network where the MAAS server exists.
When DHCP builds a MAAS server on an existing network, it conflicts with the existing DHCP because the MAAS server will become a DHCP server in later settings.
When DHCP conflicts, terminals in the network will not be able to communicate outside the network if they get it from the MAAS server when reacquiring an IP address.
Also, terminals that are supposed to be MAAS clients will not be able to communicate stably with the MAAS server.
(I checked various articles, but the current situation is unsolved) p>
Download the Ubuntu Server ISO image from the URL below. P>
Burn the Ubuntu ISO image to your USB stick to create the installation media. P>
After inserting the USB memory into the MAC, start up the terminal and check the location of the disk. P>
figure>
When the command was executed, the USB memory was / dev / disk2, so format this once in MS-DOS format. P>
diskutil eraseDisk MS-DOS UNTITLED /dev/disk2
Unmount the formatted USB stick and create a boot disk with the dd command. P>
diskutil unmountDisk /dev/disk2
sudo dd if=./Downloads/ubuntu-18.04-live-server-amd64.iso of=/dev/disk2 bs=4028
Coffee time because it takes some time.
Remove the device when the image is complete. P>
If you're stuck, p>
diskutil eject /dev/disk2
Execute
to remove the USB memory. </ P>
Install Ubuntu image h1>
Plug the USB created earlier into the terminal for the MAAS server, specify USB boot on the BOOT screen, and start the installation.
Specifying the BOOT device differs depending on the machine, so it is omitted. P>
Installation options are optional. P>
MAAS installation h1>
Install the MAAS package on the server. P>
$ sudo apt -y update
$ sudo apt -y upgrade
$ sudo apt -y install maas
Create an administrator user when the installation is complete.
Set required user name, password, address, etc.
Since the SSH key will be registered later, leave it blank and enter through. P>
$ sudo maas createadmin
When the creation is completed, log in with "MAAS server address: 5240 / MAAS /". P>
MAAS settings h1>
The login screen will appear, so
Log in as the created user. P>
figure>
After logging in, the intro page will appear.
You don't have to mess with the settings. P>
In the latter image, select the Ubuntu OS image to download.
If you check the version you want, the download will start automatically, so wait for a while. P>
Click Continue when the download is complete and the "Status" is "Synced" p>
figure>
figure>
Generate a key on the Ubuntu server side to move to the screen for entering the private key.
Enter repeatedly without specifying anything. P>
$ sudo ssh-keygen -t rsa
Because the key is generated in the .ssh folder on the server,
Copy the contents of your public key. P>
cat .ssh/id_rsa.pub
After copying, return to the MAAS management server, change Source to Upload, paste the contents of the key you copied earlier on the next input screen, and click Import.
If there is no problem, click "Go to dashboard". P>
figure>
As a preparation, select untagged for the network VLAN you want to deploy in the "Subnets" page at the top of the MAAS top page. P>
figure>
Select "Provide DHCP" from "Take action" at the top of the screen. P>
figure>
The DHCP range of the MAAS server will appear, so if you specify an arbitrary number and select "Provide DHCP", the DHCP item on the same page will be enabled, and the network range added to "Reserved ranges" will be Is displayed.
This completes the preparations. P>
Deploy MAAS client h1>
Move the PXE boot item to the first place in the boot order in the BOOT order of the terminal that will be the MAAS client.
After that, when the client is turned on, it automatically starts communicating with the MAAS server and turns off.
After the power is turned off, the terminal will be added to "Machines" on the management screen of MAAS.
(The name of the terminal is tentative and the name of the animal is entered)
Select the added machine and rename it first.
figure>
Select the power option in "Power configuration" in "Configration".
This time, select "Manual".
On the "Machines" page, check the checkbox of the terminal, select "Commission" from "Take action", and then turn on the power of the client terminal.
Communication with the server will start again, so wait until the end.
When the Commission is completed successfully, "Status" will be "Ready" on the server management screen.
Select "Deploy" from "Take action", select any OS, start the deployment, and turn on the client. P>
Since the OS is deployed from the server, wait for a while, and if the Status column changes to the OS name on the management screen, it will succeed
.
About network settings of client terminal h1>
The client terminal of MAAS is basically DHCP, but it can also be specified as Static. P>
In that case, before deploying the OS, select "Actions"-"Edit Physical" in "Interfaces" in the information page of the terminal, change "Auto assign" to "Static", and specify an arbitrary address. To. P>
figure>
figure>
I stumbled h1>
After installing the MAAS server, DHCP is Enabled on the setting screen, but the address is not distributed to the client. H3>
Solution
Select the machine in "Name" in "Controllers" at the top of the management screen (there should be only one at the beginning)
In the Services item in the moved page, "dhcpd" may not have a green mark, so once MAAS is restarted, it will have a green mark. P>
If that doesn't work, p>
sudo dpkg-reconfigure maas-rack-controller
sudo apt-get install maas-rack-controller
sudo maas-rack register --url http: // MAAS server address: 5240 / code> pre>
Sometimes it was cured with . P>
Reference page
Create a Bootable USB from an ISO image on Mac OS X-only one stronger per day < br>
MAAS environment construction and Ubuntu deployment --Qiita
SSH connection using public key cryptography (Kihon) --Qiita p>