I have tried this setup and although it works and may be good for ceratin circumstances I would advise using ubuntu as the base with docker, docker-compose, and portainer. https://gist.github.com/mow4cash/626275e095f7f90898944a85d66b3be6
Link to my docker run file https://gist.github.com/mow4cash/6a25343cdeb0cd115f263dea0a3b623d
- Install Proxmox 6.X iso
- Console/SSH into Proxmox
- nano /etc/apt/sources.list
- edit the file to look like this
deb http://ftp.debian.org/debian buster main contrib
deb http://ftp.debian.org/debian buster-updates main contrib
# PVE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve buster pve-no-subscription
# security updates
deb http://security.debian.org buster/updates main contrib
- apt update && apt dist-upgrade -y
- reboot system
- Upload the RancherOS iso to (local)pve
- Setup a VM with RancherOS ISO as CD. Give it at least 3gb ram to start. Rancher Server failed with low ram
- Boot
- From Console change password -sudo bash -passwd rancher
- SSH to rancher@
- prepare your ssh keys with putty gen
-vi cloud-config.yml - paste the cloud config edited with your settings, make sure the pasted data is pated correctly, add your key in a single line and make sure the file has #cloud-config in the beginning
- press exit exit :wq to save
#cloud-config
rancher: rancheros
network:
interfaces:
eth0:
address: 10.68.69.92/24
gateway: 10.68.69.1
mtu: 1500
dhcp: false
dns:
nameservers:
- 1.1.1.1
- 8.8.4.4
ssh_authorized_keys:
- ssh-rsa <YOUR KEY>
- sudo ros config validate -i cloud-config.yml
- sudo ros install -c cloud-config.yml -d /dev/sda
- Remove CD Image from VM, and then reboot.
- SSH back into RancherOS (rancher@) using your new ssh private key
- create a unix dataset called appsNFS with root and wheel as the user, set a quota for 50gb
- create a nfs share to the dataset you created, select all dirs, mapall user:group to root:wheel
- enable nfs sharing and select nfsv4, allow non-root, nfsv3 ownership for nfsv4
- reboot freenas
sudo ros config set mounts '[["10.68.69.2:/mnt/myVol/appsNFS", "/mnt/appsNFS", "nfs4",""]]'
sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart always --name portainer -v /mnt/appsNFS/portainer:/data portainer/portainer
- Navigate to http://hostIP:9000 and select local
- When adding volumes to a container select bind and use the path /mnt/appsNFS/whateveryouwanthere
https://www.portainer.io/2018/09/using-macvlan-portainer-io/
- click add network
- select macvlan
- enter in your lan network
- select enable manual connection
- when creating a container select the network you just added and give it an availble static IP
sudo vi /var/lib/rancher/conf/cloud-config.yml ##edit config file
https://medium.com/the-code-review/clean-out-your-docker-images-containers-and-volumes-with-single-commands-b8e38253c271 https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
Your PVE GUI and slect the upgrade button
sudo ros os upgrade
docker stop portainer
docker rm portainer
docker pull portainer/portainer:latest
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart always --name portainer -v /mnt/appsNFS/portainer:/data portainer/portainer
-
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
-
log in to ranhcer thorugh the web browser
-
Add Cluster.
-
Choose Custom.
-
Enter a Cluster Name. Click Next.
-
From Node Role, select all the roles: etcd, Control, and Worker.
-
Copy the command displayed on screen to your clipboard.
-
Log in to your Rancher host with PuTTy. Run the command copied to your clipboard.
-
When you finish running the command on your Linux host, click Done.
-
Wait for your cluster to finish provisioning
-
Reboot to make sure everything is working right
Creating your first container
- In your cluster drop down tab select default then deploy
- give it a name and add the ports and env needed
You can do it. But I do not recommend it to you.
You have different possiblities.
EXCEPT: your SSH port :-)
I have in one VM a PFsense installed an all traffic will be redirected to this VM. This VM is the gateway between my VMs and LXCs and the Internet. :-)
Advantages: