Skip to content
Snippets Groups Projects

Merging develop into main

Merged jurgenhaas requested to merge develop into main
2 files
+ 59
6
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 40
1
@@ -49,6 +49,11 @@ class Traefik {
*/
protected $addon_portainer = FALSE;
/**
* @var string
*/
protected $hub_token = '';
/**
* Traefik constructor.
*
@@ -82,6 +87,13 @@ class Traefik {
$this->addon_portainer = $addon_portainer;
}
/**
* @param string $hub_token
*/
public function setHubToken(string $hub_token): void {
$this->hub_token = $hub_token;
}
/**
* Update the Traefik container.
*/
@@ -135,7 +147,7 @@ class Traefik {
'version' => '3.3',
'services' => [
'traefik' => [
'image' => 'traefik:2.6',
'image' => 'traefik:2.7',
'command' => [
'--api=true',
'--api.dashboard=true',
@@ -202,6 +214,33 @@ class Traefik {
],
];
}
if ($this->hub_token) {
$config['services']['traefik']['command'][] = '--experimental.hub=true';
$config['services']['traefik']['command'][] = '--hub.tls.insecure=true';
$config['services']['traefik']['command'][] = '--metrics.prometheus.addrouterslabels=true';
$config['services']['traefik']['ports'][] = '9900:9900';
$config['services']['traefik']['ports'][] = '9901:9901';
$config['services']['hub-agent'] = [
'image' => 'ghcr.io/traefik/hub-agent-traefik:v0.7.0',
'command' => [
'run',
'--hub.token=' . $this->hub_token,
'--auth-server.advertise-url=http://hub-agent',
'--traefik.host=traefik',
'--traefik.tls.insecure=true',
],
'restart' => 'on-failure',
'networks' => [
'traefik-public',
],
'volumes' => [
'/var/run/docker.sock:/var/run/docker.sock:ro',
],
'depends_on' => [
'traefik',
],
];
}
return $config;
}
Loading