Launch the K8 Dashboard-Gitlab files
I thought I'd make it easy and create the files needed and code to launch the K8 Dashboard. https://gitlab.petermatra.design/gitlab-instance-5e679b60/K8-Dashboard
I thought I'd make it easy and create the files needed and code to launch the K8 Dashboard. https://gitlab.petermatra.design/gitlab-instance-5e679b60/K8-Dashboard
Launching K3s with Ansible- https://github.com/k3s-io/k3s-ansible I'm testing this script out with my Proxmox Terraform plan.
This blog article describes the AutoDevOps in Gitlab for AWS EKS CI/CD. https://about.gitlab.com/blog/2020/05/05/deploying-application-eks/
AWS Documentation provides a tutorial on how to integrate SQS messages with Lambda. https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-example.html
https://gitlab.petermatra.design/gitlab-instance-5e679b60/Sample-SQS-Lambda-code
Google's Container Tools has Kaniko which allows you to build containers using Docker compose files without using Docker. https://github.com/GoogleContainerTools/kaniko These are great to use with Rancher K3's when you don't have a Docker environment to work with.
This is a good article I found about AWS, Lambda and SMS messages. Worth a read https://mkdev.me/posts/how-to-send-sms-messages-with-aws-lambda-sns-and-python-3
https://gitlab.petermatra.design/gitlab-instance-5e679b60/Lamda-Send-SMS-messages
This is my Terraform plan for K8 server deployment with two nics. https://gitlab.petermatra.design/gitlab-instance-5e679b60/Terraform-K8-multinic-promox
Cloud images inherently come with one NIC. Once you create you cloud init image below create it in ProxMox as a machine, not a template and run it. This multi-nic image works for other providers as well. You will want to install netplugd to make this work.
sudo apt-get install netplug
wget https://raw.githubusercontent.com/barakm/Netplug-config/master/netplug
sudo mv netplug /etc/netplug/netplug
sudo chmod +x /etc/netplug/netplug
Spin up the machine and add an extra network port in Proxmox and test it if you want. Otherwise you can turn it into a template.
This code is also available here: https://gitlab.petermatra.design/gitlab-instance-5e679b60/How-to-create-ubuntu-cloudinit-image
Ubuntu images are available here: https://cloud-images.ubuntu.com
wget https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
You need to install libguestfstools to customize the image.
sudo apt update -y && sudo apt install libguestfs-tools -y
Once the tools are installed you can start customizing your image:
sudo virt-customize -a focal-server-cloudimg-amd64.img --install qemu-guest-agent
sudo virt-customize -a focal-server-cloudimg-amd64.img --run-command 'useradd pmatra'
sudo virt-customize -a focal-server-cloudimg-amd64.img --run-command 'mkdir -p /home/pmatra/.ssh'
sudo virt-customize -a focal-server-cloudimg-amd64.img --ssh-inject pmatra:file:/home/pmatra/.ssh/authorized_keys
sudo virt-customize -a focal-server-cloudimg-amd64.img --run-command 'chown -R pmatra:pmatra /home/pmatra'
sudo virt-customize -a focal-server-cloudimg-amd64.img --root-password password:PASSWORD
sudo virt-customize -a focal-server-cloudimg-amd64.img --run-command 'echo /etc/sudoers >> pmatra ALL=(ALL) NOPASSWD:ALL'
After all of that is done if you want to load it into Proxmox as a template, you need to upload it to your Proxmox Server and run this code.
qm create 9000 --name "ubuntu20-cloudinit-template" --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0
qm importdisk 9000 focal-server-cloudimg-amd64.img local-lvm
qm set 9000 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-9000-disk-0
qm set 9000 --boot c --bootdisk scsi0
qm set 9000 --ide2 local-lvm:cloudinit
qm set 9000 --serial0 socket --vga serial0
qm set 9000 --agent enabled=1
qm template 9000
If you want to clone the image manually you can do it this way via ProxMox Shell or SSH
sudo qm clone 9000 999 --name test-clone-cloud-init
sudo qm set 999 --ipconfig0 ip=10.98.1.96/24,gw=10.98.1.1
sudo qm start 999
I did an Ansible Kubernetes deployment to 4 ProxMox hosts successfully after using my Terraform K8 plan. I use WSL Ubuntu on Windows to do the deployment. I actually used WSL through MobaXTerm which makes things a lot easier with a built in SFTP. Ansible also install the Kubernetes Dashboard for you. The instructions are in the Readme.md in Gitlab. https://gitlab.petermatra.design/gitlab-instance-5e679b60/ansible-k8-proxmox-servers
I added Terraform to my Proxmox setup using Telmate. I can now launch multiple VMs in a few minutes. I took cloud images and injected SSH keys, root passwords, Qemu Guest Agent software. The Terraform plans are here- https://gitlab.petermatra.design/gitlab-instance-5e679b60/Proxmox-Terraform-plan-testVM I created the cloud init images from some help off the web but I had to customize it. I will put the code up in the blog to show how to make it.
Also added this script to launch Kubernetes servers, nodes, and storage https://gitlab.petermatra.design/gitlab-instance-5e679b60/Terraform-k8-proxmox