UncleNUC Wiki

Second chance for NUCs

User Tools

Site Tools


lab:kubernetes_app:step_1_-_set_up_the_host

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
lab:kubernetes_app:step_1_-_set_up_the_host [2024/02/12 23:00] – [Install Ubuntu 22.04 Desktop] userlab:kubernetes_app:step_1_-_set_up_the_host [2024/05/13 18:16] (current) – removed user
Line 1: Line 1:
-====== Step 1 - Set up the Host ====== 
-You will need to set up a large-ish Ubuntu system. This will be home to the Oracle VirtualBox virtual machines (VM's). You can use any Ubuntu system, but you get points for using a NUC. This system will also be the Ansible controller for this lab. 
  
-====== Install Ubuntu 22.04 Desktop ====== 
-The first step is to install Ubuntu 22.04 Desktop on the host system. It's a good idea to use a "minimal installation" of Ubuntu for this Lab. If you need help with this step, see the tutorial below. Since this is a Lab, sometimes break and it's really helpful to be able to use the Oracle VirtualBox GUI to access the consoles of your VMs. 
- 
-// See [[https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview|Tutorial: Install Ubuntu Desktop]] // 
- 
-====== Update and Install Packages ====== 
-Once installation is complete, follow best practice to upgrade software packages on the system. Open Terminal and enter the commands below. 
- 
-<code bash> 
-sudo apt update 
-sudo apt upgrade -y 
-</code> 
- 
-Next we will add the ppa:ansible repository and install a number of packages. 
-<code bash> 
-sudo apt-add-repository ppa:ansible/ansible 
-sudo apt update 
-sudo apt install openssh-server vim ansible p7zip-full xorriso ansible python3-passlib -y 
-</code> 
- 
-You should now be able to ssh to your host. 
- 
-// See [[https://linuxize.com/post/how-to-enable-ssh-on-ubuntu-20-04/|Tutorial: Enable SSH]] // 
- 
-====== Configure the ansible User and Generate Keys ====== 
-  - Create the user ansible and give sudo permission (and enter a password for the user when prompted) 
-    * <code> 
-sudo useradd -m -s /bin/bash ansible 
-sudo usermod -aG sudo ansible 
-sudo passwd ansible 
-</code> 
-    * // See [[https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/|How to Create Users in Linux (useradd Command)]] // 
-  - Test the new user 
-    * From your regular login switch to the ''ansible'' user 
-      * ''su - ansible'' 
-      * Enter the password 
-      * ''sudo uptime'' 
-      * exit 
-    * Test connecting to your host via SSH with user ''ansible'' 
-    * For the rest of the lab, we will be logged in as the ''ansible'' user 
-  - Create Keys for Ansible Management 
-    * Ensure you are logged as the user ''ansible'' 
-    * <code>ssh-keygen -o</code> 
-    * __Do not__ enter a passphrase 
-    * View the public key and __save it for a later step__ 
-      * <code>cat ~/.ssh/id_rsa.pub</code> 
-      * It will look like this: 
-        * <code>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKwEYxgppj+um+/W8LLxRpwZ2887IJirfJjFBkE30UeCZ0D1JS2RTMn4QEK1EAphByGxnmCruTL36aLMTO0FNH4IW+017/7wNY4JjRzRssZSMqmdjH4nhYV22JDIWh428p93FLsgqM+ud0Mj06KgJfa4BQtSvnR/p/4AXYzFTwzE+kyussIiOi+uT20AXNEIxk4ps39xhLGc6XNFo1xhtGvTZ9+Jx7AanVht090HuRuxNmOTd260mbeBJUKRF57d9tzZ68YRQiokIunkNF2skfJOZEUaIOWUoGGIWPMlEUEC0RhyW+7Ljmp7RbIOZ45CV0MYZEpKx4KQ61/CoMY4wKBCM90SwxJQwM3CZCseqcVnpFYKpFd6dnn0v0XsmINCU+y1RXYLfsOHEhLTm5WK9ERi5yr/1OjKkId+xZrf7D/v2soQdHsc82d+otbTDXzHYPduc2DfstJg5QFCECNrsEPRishAh2Lm2GJ3h0Pj20loyYeKWlUJpbLjd5A5Mnk9E= ansible@labbox</code> 
- 
-====== Install Oracle VirtualBox Using Ansible====== 
-NOTE There are many references out there if you don't want to use Ansible to install VirtualBox (e.g., [[https://linuxconfig.org/install-virtualbox-on-ubuntu-22-04-jammy-jellyfish-linux]]) 
- 
-Run the following playbook to install VirtualBox. 
- 
-<file yaml install-virtualbox.yml> 
---- 
-- hosts: localhost 
-  connection: local 
-  become: true 
-  tasks: 
-    - name: Add Oracle apt key 
-      apt_key: 
-        url: https://www.virtualbox.org/download/oracle_vbox_2016.asc 
-        state: present 
-    - name: Add Virtualbox repo 
-      apt_repository: 
-        repo: "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian {{ ansible_distribution_release }} contrib" 
-        state: present 
-    - name: Install Virtualbox 
-      apt: 
-        pkg: 
-          - virtualbox 
-        state: present 
-        update_cache: true 
-    - name: Ensure vboxdrv kernel module is loaded (optional) 
-      modprobe: 
-        name: vboxdrv 
-        state: present 
-</file> 
- 
-Run as <code>ansible-playbook install-virtualbox.yml --ask-become-pass</code> 
-Enter the password for the user ''ansible'' when prompted. 
- 
-====== Restart the Host ====== 
-Run ''sudo reboot'' and wait for the host to reboot. 
- 
-====== Next Step ====== 
-Continue to [[Step 2 - Deploy the VMs]] 
- 
-Or back to [[lab:kubernetes_app:start|Start]] 
lab/kubernetes_app/step_1_-_set_up_the_host.1707778852.txt.gz · Last modified: 2024/02/12 23:00 by user