Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| infrastruktur:host:gitlab-runner [05.01.2021 14:24] – Lukas Ruge | infrastruktur:host:gitlab-runner [23.03.2026 17:57] (aktuell) – gelöscht Paul | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== Gitlab Runner ====== | ||
| - | |||
| - | Shared [[https:// | ||
| - | |||
| - | IP: 172.23.208.126 | ||
| - | |||
| - | Nicht öffentlich erreichbar. Es reicht völlig aus, wenn der Runner ausgehende Verbindungen ins Internet aufbauen kann. | ||
| - | |||
| - | Installiert von Malte. | ||
| - | |||
| - | ===== Verwendung ===== | ||
| - | |||
| - | Der Gitlab Runner ist als Shared Runner in unserem [[https:// | ||
| - | |||
| - | image: malteschmitz/ | ||
| - | | ||
| - | deploy: | ||
| - | script: | ||
| - | - latexmk -pdf main.tex | ||
| - | artifacts: | ||
| - | paths: | ||
| - | - main.pdf | ||
| - | |||
| - | ===== Installations-Log ===== | ||
| - | |||
| - | [[https:// | ||
| - | |||
| - | # Install packages to allow apt to use a repository over HTTPS | ||
| - | sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common | ||
| - | # Add Docker’s official GPG key | ||
| - | curl -fsSL https:// | ||
| - | # Add repository | ||
| - | sudo add-apt-repository "deb [arch=amd64] https:// | ||
| - | # Install | ||
| - | sudo apt-get install docker-ce docker-ce-cli containerd.io | ||
| - | |||
| - | [[https:// | ||
| - | |||
| - | # Add GitLab’s official repository | ||
| - | curl -L https:// | ||
| - | # Install | ||
| - | sudo apt-get install gitlab-runner | ||
| - | | ||
| - | [[https:// | ||
| - | |||
| - | Cronjob, um regelmäßig alle Docker-Images und -Container zu löschen, die älter als 10 Tage sind: | ||
| - | |||
| - | # m h dom mon dow | ||
| - | 01 0 * * * docker system prune --force --filter " | ||
| - | | ||
| - | Editiere ''/ | ||
| - | |||
| - | concurrent = 4 | ||
| - | |||
| - | ==== IPv6 NAT für Docker aktivieren ==== | ||
| - | |||
| - | Docker hat von alleine nur IPv4 NAT, sodass IPv6 für ausgehende Verbindungen in das Internet erstmal nicht funktioniert. Die Idee von Docker ist, dass man vorhandene IPv6 Adressen an die Container zuweist, denn NAT in IPv6 ist ganz böse. Ich finde es aber sehr praktisch, deswegen machen wir es mit der Firewall. [[https:// | ||
| - | |||
| - | If you needed ufw to NAT the connections from the external interface to the internal the solution is pretty straight forward. In the file ''/ | ||
| - | |||
| - | DEFAULT_FORWARD_POLICY=" | ||
| - | |||
| - | Also configure ''/ | ||
| - | |||
| - | # | ||
| - | net/ | ||
| - | # | ||
| - | |||
| - | The final step is to add NAT to ufw’s configuration. Add the following to ''/ | ||
| - | |||
| - | # NAT table rules | ||
| - | *nat | ||
| - | : | ||
| - | | ||
| - | # Forward traffic through eth0 - Change to match you out-interface | ||
| - | -A POSTROUTING -s fd00::/64 -j MASQUERADE | ||
| - | | ||
| - | # don't delete the ' | ||
| - | # be processed | ||
| - | COMMIT | ||
| - | |||
| - | Create ''/ | ||
| - | |||
| - | { | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | |||
| - | Allow ssh in the firewall rules | ||
| - | |||
| - | sudo ufw allow ssh | ||
| - | |||
| - | Enable the firewall | ||
| - | |||
| - | sudo ufw disable | ||
| - | sudo ufw enable | ||
| - | | ||
| - | {{tag> | ||