{"id":21340692,"url":"https://github.com/artainmo/ft_services","last_synced_at":"2026-05-06T11:34:06.109Z","repository":{"id":93053038,"uuid":"273251728","full_name":"artainmo/ft_services","owner":"artainmo","description":"42 school project.  Infrastructure setup of different services, with each having own unique container, via kubernetes to create a multi-service cluster.","archived":false,"fork":false,"pushed_at":"2024-10-27T11:02:14.000Z","size":12741,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-02T13:10:53.556Z","etag":null,"topics":["42school","devops","docker","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artainmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-18T13:53:02.000Z","updated_at":"2024-10-27T11:39:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"efa7e653-e161-4725-960e-c7eff27e7696","html_url":"https://github.com/artainmo/ft_services","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/artainmo/ft_services","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artainmo%2Fft_services","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artainmo%2Fft_services/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artainmo%2Fft_services/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artainmo%2Fft_services/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artainmo","download_url":"https://codeload.github.com/artainmo/ft_services/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artainmo%2Fft_services/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260245170,"owners_count":22980161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42school","devops","docker","kubernetes"],"created_at":"2024-11-22T00:52:33.000Z","updated_at":"2026-05-06T11:34:01.087Z","avatar_url":"https://github.com/artainmo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ft_services\n\n42 school [subject](https://cdn.intra.42.fr/pdf/pdf/53690/en.subject.pdf).\n\nInfrastructure setup of different services, with each having own unique container, via kubernetes to create a multi-service cluster.\n\n## Use\n### Docker\n#### Install\nBrew install docker\u003cbr\u003e\nBrew install docker-machine\u003cbr\u003e\ndocker-machine create default\u003cbr\u003e\nInstall virtual box\u003cbr\u003e\nScript\n\n#### Commands\n```\n# Build a docker image from a Dockerfile\ndocker build -t \u003cyour image name\u003e \u003cyour Dockerfile dir\u003e\n# Start an instance of a docker image\ndocker run -it \u003cyour image name\u003e\n# Really important if you want to bind some ports on the container to your own computer, use -p option.\n# Exemple for an Apache image using port 80 in the container as our port 80\ndocker run -it debian:apache -p 80:80\n# See all images\ndocker images\n# See running containers\ndocker ps\n# Stop a container\ndocker kill \u003ccontainer ID\u003e\n# Delete all unused Docker images and cache and free SO MUCH SPACE on your computer\ndocker system prune\n# View content of a docker image, through a shell\nDocker run -it image sh\n# Simply run in background\nDocker -d -p 80:80 img\n# Enter running container\nDocker exec containerid sh\n\nDocker build --tag img .\nDocker run -p 5050:5050 -dit --name i2 img\ndocker-machine ip\n\nDocker system prune\nDocker rm -f container-id\ndocker rm $(docker ps -a -q) #all containers\nDocker image rm\n\nDocker images\nDocker ps\n```\n\n### Minikube\nminikube delete -p minikube\u003cbr\u003e\nVirtualbox -\u003e settings -\u003e system -\u003e processor -\u003e 2cores\n\n### Kubernetes\nKubectl delete deployment\u003cbr\u003e\nKubectl delete service\n\n### Users\nwordpress - artainmo : pass123\u003cbr\u003e\nphpmyadmin - artainmo : pass123\u003cbr\u003e\ngrafana - artainmo : pass123\u003cbr\u003e\nssh - ssh artainmo@192.168.99.130 : pass123\u003cbr\u003e\nftps - 192.168.99.133 : artainmo : pass123 : 21\n\n### Test specific services\nTo test ftps -\u003e https://filezilla-project.org/\u003cbr\u003e\nAPP = pure-ftpd\u003cbr\u003e\nAPP = influxd\u003cbr\u003e\n\nTo test ssh -\u003e ssh user@IP\n\n## Notes\nFirst have a kubernetes cluster, after you can deploy your containers on it.\u003cbr\u003e\nFor this you need to create deployment and then expose it publicly via a service.\n\nTo deploy your containers, you need a kubernetes deployment configuration, this will instruct the master node how to create and update. This will constantly monitor the containers, if one container goes down it replaces it with another node, allowing recovery from machine failure.\u003cbr\u003e\nTo create one you need to use Kubectl, it uses the kubernetes api to interact with the cluster.\n\nA node is a worker machine, each node is managed by the kubernetes master. Each node contains one or more pods.\u003cbr\u003e\nEvery kubernetes node runs at least:\n- Kubelet, a process responsible for communication between node and master, it manages the pods and containers on a machine.\n- A container runtime like docker (that sits in a pod), responsible for unpacking the container, pulling the container image and running the application.\n\nA pod is a group of one or more containers that have shared resources, like IP address and port. By creating a deployment pods are created.\u003cbr\u003e\nEach pod is tied to a node until termination. In case of a failure identical pods are scheduled on other nodes.\n\nA service is a grouping of pods, the set of pods is determined by a LabelSelector. Services allow you to receive traffic and can be exposed in different ways for example through a load balancer.\u003cbr\u003e\nThe load balancer assigns a fixed external IP to the service, allowing you to not exposing the nodes themselves and giving one endpoint (entry point).\n\n### Steps to do\n- Master node / Deployment - kubectl\n- Node\n- Service - LabelSelector - Loadbalancer\n- Pod - YAML\n- Container - Docker\n- Img\n\nOne IP? Loadbalancer should balance services over an IP range...\n- https://metallb.universe.tf/usage/ -\u003e how to force multiple services on one IP\n- externalTrafficPolicy: local -\u003e Use the host IP\n\n### Containers groups\nmetallb - necessary for all\u003cbr\u003e\nMysql, wordpress, phpmyadmin - dependent to each other\u003cbr\u003e\nNginx -\u003e contains http https and ssh\u003cbr\u003e\nftps\u003cbr\u003e\nTelegraf -\u003e influxdb -\u003e grafana\n\n### Bugs\nMachine-ip ip -\u003e not working:\u003cbr\u003e\n(./docker-setup)\u003cbr\u003e\ndocker-machine rm default\u003cbr\u003e\ndocker-machine create --driver virtualbox default\u003cbr\u003e\ndocker-machine env default\u003cbr\u003e\neval $(docker-machine env default)\u003cbr\u003e\nproxy_pass phpmyadmin =\u003e set /phpmyadmin/index.php\n\n### How to run multiple instances\nThis is not necessary for ft_services.\u003cbr\u003e\nFor increased traffics scaling is necessary, this is done through changing the number of replicas.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartainmo%2Fft_services","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartainmo%2Fft_services","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartainmo%2Fft_services/lists"}