Giter Club home page Giter Club logo

ft_services's Introduction

ft_services

fde-capu

It is an introduction study to Kubernetes. The proposal:

42 given cluster chart

Specifications include:

  • A setup.sh to... set things up.
  • Dockerfiles written by me.
  • One service for container.
  • Use of Alpine Linux.
  • nginx on ports 80 and 443 with auto-redirect from 80 to 443. Access through SSH on port 22.
  • Single IP Load Balancer, only entry point. MetalLB recommended.
  • WordPress on 5050 and redirect 307 from /wordpress.
  • phpMyAdmin on port 5000 and reverse proxy from /phpmyadmin.
  • MySQL.
  • FTPS on port 21.
  • Grafana monitoring all containers, on port 3000, linked to InfluxDB (on separate container). One dashboard per service.

FORBIDDEN:

  • NodePort, Ingress Controller, kubectl port forward, DockerHub.

Let's get it on clustering!

Use:

  • ./setup.sh : resets Minikube and mount everything over. You must be sudo because of virtual-inside-virtual (minikube driver=none) setup.
  • ctl/logs.sh : logs current Kubernetes status.
  • ctl/unit.sh : run some tests. Requires python3 and lftp. Edit ctl/unit.sh to setup the default user and password.

Passwords:

user paswd role
nginx user42 user42 admin
ftps user42 user42 admin
mysql user42 user42 admin
wordpress user42 user42 admin
wordpress user42b user42b subscriber
wordpress user42c user42c contributor
wordpress user42d user42d author
wordpress user42e user42e editor
phpmyadmin user42 user42 admin
grafana admin admin admin

Notes on dependencies:

  • Minikube version < 10 does not support virtualization inside virtualization (at least on my Oracles Virtual Machine). For this reason, this project uses --vm-drive=none, this also implies Minikube must be sudo run. Please install the latest version and conntrack:
	curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
	chmod +x minikube
	sudo mkdir -p /usr/local/bin
	sudo install minikube /usr/local/bin
	sudo apt install conntrack # for driver=none
  • Check users and groups:
	sudo groupadd docker
	sudo usermod -aG docker user42
	newgrp docker
  • Kill any running server:
	sudo pkill nginx

Considerations:
  • Use ssh user42@$(minikube ip); password: "user42".
  • To login into ftps, use: lftp $(minikube ip). Then set ssl:verify-certificate no and user user42; password: "user42".
  • Three volumes are persistent and shared, the sql db, influx and /home (/home is accessible through ssh nginx:22 and ftp ftps).
  • Use source <(kubectl completion zsh) for extra adrenaline when interacting with kubectl.

this project is part of the 42 São Paulo cursus


Copyright 2021 fde-capu

This is how I have made a Kubernetes project, afterall, researching on the Internet. I am happy if you find it usefull to your studies. If you find anything profitable, do not use it without getting in touch, and we can work together.

ft_services's People

Contributors

fde-capu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.