Skip to content

IoT: System Administration related project (Vagrant, K3s, K3d, Argo CD)

Notifications You must be signed in to change notification settings

ilkou/Inception-of-Things

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inception-of-Things

Part 1

Test

run following commands in p1 directory:

vagrant up

vagrant ssh oouklichS

k get nodes -o wide

Some resources

Vagrant

Vagrant enables you to create and configure reproducible, and portable development environments using Virtual machine images called Boxes.

With Vagrant, you can setup your development environments in seconds on various virtualization platforms such as VirtualBox, KVM, VMware, Hyper-V, e.t.c.

VBoxManage Customizations

VBoxManage is a utility that can be used to make modifications to VirtualBox virtual machines from the command line.

Vagrant exposes a way to call any command against VBoxManage just prior to booting the machine:

config.vm.provider "virtualbox" do |v|
  v.customize ["modifyvm", :id, "--name", "ilkou"]
end

which is equivalent to:

VBoxManage modifyvm "id-of-vm=being-created" --name ilkou

There are some convenience shortcuts for memory and CPU settings:

config.vm.provider "virtualbox" do |v|
  v.memory = 512
  v.cpus = 1
end

the bare minimum in terms of resources

The following NAT networking settings are available through VBoxManage modifyvm. With all these settings, the decimal number directly following the option name, 1-N in the list below, specifies the virtual network adapter whose settings should be changed.

--natdnsproxy<1-N> on|off: Makes the NAT engine proxy all guest DNS requests to the host's DNS servers. See Section 9.8.5, “Enabling DNS Proxy in NAT Mode”.

--natdnshostresolver<1-N> on|off: Makes the NAT engine use the host's resolver mechanisms to handle DNS requests. See Section 9.8.6, "Using the Host's Resolver as a DNS Proxy in NAT Mode".

reason-behind

  • Overview of Networking Modes

table

K3S

Uninstalling K3s

Installation Options

K3s Server Configuration Reference

Part 2

in this part we will expose 3 web apps hosted with nginx by using the K3s built-in ingress controller “Traefik”.

first, we should turn off both options of the virtual box --natdnsproxy1 --natdnshostresolver1 ; issue link

Examples

Docs

Useful commands

  • after running the machine we should be able to view ingress by typing the following command

kubectl describe ingress

  • to debug and see if the deployment is doing well (logs kinda thing)

sudo journalctl -u k3s | tail -n 20

  • to delete a deployment

kubectl delete -f deployment.yaml

Part 3

Examples

Configure VM

Update packages

sudo apt update -y
sudo apt upgrade -y

Grant ur user with sudo permissions

su

apt install sudo

usermod -aG sudo ilkou

su ilkou

Install ur favorite text editor

sudo apt install vim -y

Set a static IP address

ilkou@iot:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug enp0s3
#iface enp0s3 inet dhcp
auto enp0s3
iface enp0s3  inet static
 address 192.168.1.253
 netmask 255.255.255.0
 gateway 192.168.1.1
 dns-domain sweet.home
 dns-nameservers 192.168.1.1

Restart networking service on Debian Linux to switch from DHCP to static IP config

$ sudo systemctl restart networking.service

Bonus

deploy gitlab

About

IoT: System Administration related project (Vagrant, K3s, K3d, Argo CD)

Resources

Stars

Watchers

Forks