In this part, you must install VirtualBox, Vagrant, create a Vagrantfile which, using the “vagrant up” command, will launch two virtual machines and use your scripts to install k3s master and worker on these virtual machines.
- Install VirtualBox
- Install Vagrant
2.1 vagrant init - initialize Vagrantfile
2.2 vim Vagrantfile - open Vagrantfile -> describe the configuration -> save -> vagrant up - Installing K3s mater and K3s agent
3.1 Documentation for flags Master - example
3.2 Documentation for flags Worker - example
To complete this part, you must install VirtualBox, Vagrant, create a Vagrantfile which, using the “vagrant up” command, will launch virtual machine and use your script to install k3s master on these virtual machine (see the installation description in PART 1).
The next step is to write a K8S manifest, which will be launched by Vagrant inside the virtual machine.
The K8S manifest consists of:
- Deployment - in Kubernetes manages Pods and ReplicaSets, ensuring the desired number of pod replicas, specified in its configuration, are running and up-to-date. Volume inside Deployment manifest plays a key role in managing data storage and availability within pods. Our pods which contains nginx are linked with our applications.
- Services - in Kubernetes acts as a stable network interface to a dynamic set of Pods, facilitating internal or external network communication to these Pods.
- Ingress - in Kubernetes is a way to route external HTTP and HTTPS traffic to internal Services, providing features like URL routing, load balancing, and SSL termination.
The last step is to use the script on the local machine to add hosts - to view our applications through the browser.
Consistently following the links from our description will allow you to understand how this and the bonus part are performed. We have made comments in our scripts that contain all the links to the documentations.
For this part you need to install K3S in Docker = K3D. Install ArgoCD into the K3S cluster. Run the ArgoCD script which start manifest to deploy the application, using the manifest (see what consist K8S manifest in PART 2) which is located in a specially created github repository = CI/CD. In the bonus part we used helm, you need to install git, helm and deploy gitlab to the k3s cluster. Create a project manually and put the manifest there, which is in our github.
- vagrant - vagrant manual
- vagrant init - initialize the Vagrantfile
- vim Vagrantfile - configure Vagrantfile
- vagrant up - raise virtual machines
- vagrant destroy - destroy virtual machines
- vagrant status - shows the current status of virtual machines
- vagrant global status - shows the status of active virtual machines
- vagrant validate - checking the validity of Vagrantfile
- vagrant ssh <machine name> - to connect to the machine via ssh
- nc -vz 192.168.56.110 6443 - Check connection availability
- ss -tlnp - show listening ports - views open ports
- cat /etc/netplan - nets configs
- kubectl get all -n [namespace-name] - view all resources in a specific namespace
- kubectl get all --all-namespaces - view all resources in all namespaces
- kubectl get [pod, ingress, or another Kubernetes resource] -n [namespace-name] -o yaml - show YAML manifest information about a specific Kubernetes resource in some namespace
- kubectl describe [pod, ingress, or another essence of k8s] -n [namespace-name] - show detailed information about a specific Kubernetes resource in some namespace
- kubectl exec -it [pod-name] -- /bin/sh - access the Pod
Actual Status : finished. Result : 125%
This is my inception project from the 42 cursus, if you need help write to me or cdarrell (SLACK). My contacts here: https://github.com/SavchenkoDV.