Our journey through containerization #1 [EN/DE]

in #deutsch6 years ago (edited)

EN

Our journey through containerization #1

As a young start up we had to learn a lot about deployment strategies and running services in the cloud. We started our journey with a single server instance and shifted to docker and after some time to kubernetes. One main reason for this was our growing interest in offering customized Odoo instances as a SaaS solution.

2000px-Kubernetes_logo.svg.png

There are a lot of articles and comments on docker and the advantages of containers. So I'm not going to talk about that. This is also not intended to be a tutorial on how to setup anything. I just want to summarize my experience and share my thoughts on how we deal with services and how this changed over time. This is the first article in a series about our story with services.

22947137613_69a88cb94b_b.jpg

When we first started our company we only had two customers. One of them wanted a self hosted system for some business stuff and the other one needed a cloud solution. Adding the few services we were using this was easy hosted and maintained on a single server. As our needs grew (but our manpower didn't) we had to rethink how we manage services and server. This was the first time we rebuilt our whole infrastructure.

At this time our used software stack looked something like this:

Odoo

Gitlab

Jenkins

MediaWiki

We used nginx as proxy and had to maintain a PostgreSQL and a MySQL server.

I remember installing everything on our server and sitting nights looking for errors in config files. Especially in nginx... At the same time I was testing a lot of other services and if we could use them. I tried them out locally and if I liked one I installed it on our server. Most of the things I deployed were really cool tools but no one used them so we decided to remove them again. Installing and removing software on a server isn't that easy and consumes a lot of time.

This was when we decided to try docker. I heard about docker before but I didn't think that I would need it. Playing around I started using it to test software and after some time we decided to use it with all our services. Doing this the first time we had to learn a lot about how docker works, what images and containers are, how they communicate with the outside world and what happens with the data.

Where are my files?!
The first problem we encountered was that docker doesn't save anything on your disk if you don't tell it to. Docker runs in its own environment and if you delete the pod everything is gone. If you want to persist (persistance is just a fancy word for saving files) your data you need something called volumes. Here is a little example docker-compose file from one of our first containers for techies:

version: '3'
services:
postgres:
image: postgres:9.4
container_name: postgres
environment:
- POSTGRES_PASSWORD=yourdbpassword
- POSTGRES_USER=yourdbuser
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- ./postgres-data:/var/lib/postgresql/data/pgdata

Volumes are a cool thing if you only have one instance of something running. As soon as you think about running multiple instances of a container in a cluster for loadbalancing you will have to think about how you can share the storage. We tried a lot of solutions for this but nothing seemed to work good enough. In our case we wanted to do this with Odoo. In the end we removed the persistent storage and moved everything to PostgreSQL. We had to push our development for the Odoo module muk_dms and the lobject modules from the dms family. Some may ask if we only moved the persistance problem from one container to another. And they are right to do so. But the advantage of PostgreSQL is that you can run a cluster with master and worker instances. One can persist and the others just copy the data and send changes back.

The next article of this series is going to talk about networking in the Docker world! Stay tuned!


DE

Unsere Reise durch die Containerisierung #1

Als junges Unternehmen mussten wir viel über Bereitstellungsstrategien und den Betrieb von Services in der Cloud lernen. Wir begannen unsere Reise mit einer einzigen Server-Instanz und wechselten zum Docker und nach einiger Zeit zu kubernetes. Ein Hauptgrund dafür war unser wachsendes Interesse, kundenspezifische Odoo-Instanzen als SaaS-Lösung anzubieten.

2000px-Kubernetes_logo.svg.png

Es gibt viele Artikel und Kommentare über Docker und die Vorteile von Containern. Also werde ich nicht darüber reden. Dies ist auch nicht als Tutorial gedacht, wie man etwas einrichtet. Ich möchte nur meine Erfahrungen zusammenfassen und meine Gedanken darüber teilen, wie wir mit Dienstleistungen umgehen und wie sich dies im Laufe der Zeit verändert hat. Dies ist der erste Artikel in einer Serie über unsere Geschichte mit Dienstleistungen.

22947137613_69a88cb94b_b.jpg

Als wir unser Unternehmen gegründet haben, hatten wir nur zwei Kunden. Einer von ihnen wollte ein selbst gehostetes System für einige Geschäftsangelegenheiten und der andere brauchte eine Cloud-Lösung. Das Hinzufügen der wenigen Dienste, die wir nutzten, war einfach und wurde auf einem einzigen Server gehostet und gewartet. Als unsere Bedürfnisse wuchsen (aber unsere Manpower nicht), mussten wir überdenken, wie wir Services und Server verwalten. Dies war das erste Mal, dass wir unsere gesamte Infrastruktur wieder aufgebaut haben.

Zu dieser Zeit sah unser gebrauchter Software-Stack etwa so aus:

Odoo

Gitlab

Jenkins

MedienWiki

Wir verwendeten nginx als Proxy und mussten einen PostgreSQL- und einen MySQL-Server pflegen.

Ich erinnere mich, dass ich alles auf unserem Server installiert habe und nachts nach Fehlern in den Konfigurationsdateien gesucht habe. Besonders in Nginx.... Gleichzeitig habe ich viele andere Dienste getestet und ob wir sie nutzen können. Ich habe sie lokal ausprobiert und wenn mir einer gefiel, habe ich ihn auf unserem Server installiert. Die meisten Dinge, die ich eingesetzt habe, waren wirklich coole Tools, aber niemand hat sie benutzt, also haben wir beschlossen, sie wieder zu entfernen. Das Installieren und Entfernen von Software auf einem Server ist nicht so einfach und kostet viel Zeit.

Das war, als wir beschlossen haben, Docker auszuprobieren. Ich habe schon von Docker gehört, aber ich dachte nicht, dass ich es brauche. Ich habe damit angefangen, Software zu testen und nach einiger Zeit haben wir beschlossen, sie mit all unseren Dienstleistungen zu nutzen. Dabei mussten wir zum ersten Mal viel darüber lernen, wie Docker funktioniert, was Bilder und Container sind, wie sie mit der Außenwelt kommunizieren und was mit den Daten passiert.

Wo sind meine Akten?!
Das erste Problem, auf das wir gestoßen sind, war, dass Docker nichts auf Ihrer Festplatte speichert, wenn Sie es nicht angeben. Docker läuft in seiner eigenen Umgebung und wenn Sie den Pod löschen, ist alles weg. Wenn Sie persistieren wollen (Persistenz ist nur ein schönes Wort zum Speichern von Dateien), brauchen Sie etwas, das man Volumes nennt. Hier ist ein kleines Beispiel für eine Docker-Compose-Datei aus einem unserer ersten Container für Techniker:

Version:'3'.
Dienstleistungen:
postgres:
Bild: postgres:9.4
container_name: postgres
Umwelt:
- POSTGRES_PASSWORD=IhrPasswort
- POSTGRES_USER=IhrBenutzer
- PGDATA=/var/lib/postgresql/data/pgdata
Volumen:
- ./postgres-data:/var/lib/postgresql/data/pgdata

Volumes sind eine coole Sache, wenn man nur eine Instanz von etwas laufen hat. Sobald Sie daran denken, mehrere Instanzen eines Containers in einem Cluster zum Loadbalancing laufen zu lassen, müssen Sie darüber nachdenken, wie Sie den Speicher freigeben können. Wir haben viele Lösungen dafür ausprobiert, aber nichts schien gut genug zu funktionieren. In unserem Fall wollten wir das mit Odoo machen. Am Ende haben wir den persistenten Speicher entfernt und alles nach PostgreSQL verschoben. Wir mussten unsere Entwicklung für das Odoo-Modul muk_dms und die lobject Module aus der dms-Familie vorantreiben. Manche fragen sich vielleicht, ob wir das Persistenzproblem nur von einem Container in einen anderen verschoben haben. Und sie haben Recht, das zu tun. Der Vorteil von PostgreSQL ist jedoch, dass Sie einen Cluster mit Master- und Worker-Instanzen betreiben können. Man kann persistieren und die anderen einfach die Daten kopieren und Änderungen zurücksenden.

Der nächste Artikel dieser Serie wird sich mit dem Thema Networking in der Docker-Welt beschäftigen! Bleiben Sie dran!

by Kerrim

Logo_MuKIT_transpapng-01 (1).png


You want to test our ERP-System?

Demo.mukit.at
acc: demo
pw: demo


If you have any questions contact me or visit our website:

[email protected] www.mukit.at


Subscribe to our youtube channel, so you dont miss any new videos:

https://www.youtube.com/channel/UCrqgAXbcDdXg3G7Lox0HAPg

Sort:  

Nice article! On my side I am having a look to the Jenkins pipeline :) Otherwise another topic not related, did you already think about creating an account for mukit?

Yeah but i am not sure if i want to/can manage the additional effort, but maybe soon :)

I think we could organize that from September with the support of the @globalschool and the @com-lab to not add additional work on your shoulders but allow the participants to work on real case editorial and channel management ;-)

Congratulations @gexi! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63459.73
ETH 2599.77
USDT 1.00
SBD 2.78