-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traefik not working with rancher #1999
Comments
[UPDATE]: So I've made a mistake and haven't submitted the environment key. Nevertheless if you remove the condition if service.EnvironmentId != environment.Id {
continue
} the frotned is loaded correctly, but the backend is not working. More specifically Backends is empty when Found out that if service.EnvironmentId != environment.Id {
continue
}
This condition is always true in my case which results in having no data. When you look at service JSON below, you can't match them. You can match them only by AccountId. I've tried that and now I'm getting the frontend, but no backend is created. Working on solving that also. Looking forward for some feedback and maybe help :). "id": "1s43",
"type": "service",
"links": {
"self": "…/v1/services/1s43",
"account": "…/v1/services/1s43/account",
"configItemStatuses": "…/v1/services/1s43/configitemstatuses",
"consumedbyservices": "…/v1/services/1s43/consumedbyservices",
"consumedservices": "…/v1/services/1s43/consumedservices",
"instances": "…/v1/services/1s43/instances",
"networkDrivers": "…/v1/services/1s43/networkdrivers",
"serviceExposeMaps": "…/v1/services/1s43/serviceexposemaps",
"serviceLogs": "…/v1/services/1s43/servicelogs",
"storageDrivers": "…/v1/services/1s43/storagedrivers",
"containerStats": "…/v1/services/1s43/containerstats",
"environment": "…/v1/environment/1e20"
},
"actions": {
"upgrade": "…/v1/services/1s43/?action=upgrade",
"restart": "…/v1/services/1s43/?action=restart",
"update": "…/v1/services/1s43/?action=update",
"remove": "…/v1/services/1s43/?action=remove",
"deactivate": "…/v1/services/1s43/?action=deactivate",
"removeservicelink": "…/v1/services/1s43/?action=removeservicelink",
"addservicelink": "…/v1/services/1s43/?action=addservicelink",
"setservicelinks": "…/v1/services/1s43/?action=setservicelinks"
},
"baseType": "service",
"name": "ghost",
"state": "active",
"accountId": "1a12",
"assignServiceIpAddress": false,
"createIndex": 1,
"created": "2017-08-21T09:21:49Z",
"createdTS": 1503307309000,
"currentScale": 1,
"data": {
"fields": {
"startOnCreate": true,
"secondaryLaunchConfigs": [ ],
"launchConfig": {
"instanceTriggeredStop": "stop",
"kind": "container",
"networkMode": "managed",
"privileged": false,
"publishAllPorts": false,
"readOnly": false,
"startOnCreate": true,
"stdinOpen": true,
"tty": true,
"vcpu": 1,
"labels": {
"traefik.enable": "true",
"traefik.port": "2368",
"traefik.backend": "ghot",
"traefik.frontend.rule": "Host:ghost.rancher.novicell.dk",
"io.rancher.container.pull_image": "always"
},
"secrets": [ ],
"dataVolumes": [ ],
"dataVolumesFrom": [ ],
"dns": [ ],
"dnsSearch": [ ],
"capAdd": [ ],
"capDrop": [ ],
"devices": [ ],
"logConfig": {
"driver": "",
"config": { }
},
"dataVolumesFromLaunchConfigs": [ ],
"imageUuid": "docker:ghost",
"ports": [
"2368:2368/tcp"
],
"system": false,
"version": "0"
},
"scale": 1,
"serviceIndexStrategy": "deploymentUnitBased",
"assignServiceIpAddress": false,
"token": "zES29dyWqj38QpdpiX4z8khWPj72DHF2JiAXbaBv",
"executionCount": 1,
"executionPeriodStart": 1503307310120,
"publicEndpoints": [
{
"ipAddress": "10.0.55.164",
"port": 2368,
"serviceId": "43",
"hostId": "4",
"instanceId": "90"
}
],
"transitioning": null,
"transitioningMessage": null,
"currentScale": 1
}
},
"description": null,
"externalId": null,
"fqdn": null,
"healthState": "healthy",
"instanceIds": [
"1i90"
],
"kind": "service",
"launchConfig": {
"type": "launchConfig",
"capAdd": [ ],
"capDrop": [ ],
"dataVolumes": [ ],
"dataVolumesFrom": [ ],
"devices": [ ],
"dns": [ ],
"dnsSearch": [ ],
"imageUuid": "docker:ghost",
"instanceTriggeredStop": "stop",
"kind": "container",
"labels": {
"traefik.enable": "true",
"traefik.port": "2368",
"traefik.backend": "ghot",
"traefik.frontend.rule": "Host:ghost.rancher.novicell.dk",
"io.rancher.container.pull_image": "always"
},
"logConfig": {
"type": "logConfig",
"config": { },
"driver": ""
},
"networkMode": "managed",
"ports": [
"2368:2368/tcp"
],
"privileged": false,
"publishAllPorts": false,
"readOnly": false,
"secrets": [ ],
"startOnCreate": true,
"stdinOpen": true,
"system": false,
"tty": true,
"version": "0",
"dataVolumesFromLaunchConfigs": [ ],
"vcpu": 1
},
"lbConfig": null,
"linkedServices": null,
"metadata": null,
"publicEndpoints": [
{
"type": "publicEndpoint",
"hostId": "1h4",
"instanceId": "1i90",
"ipAddress": "10.0.55.164",
"port": 2368,
"serviceId": "1s43"
}
],
"removeTime": null,
"removed": null,
"retainIp": null,
"scale": 1,
"scalePolicy": null,
"secondaryLaunchConfigs": [ ],
"selectorContainer": null,
"selectorLink": null,
"stackId": "1st20",
"startOnCreate": true,
"system": false,
"transitioning": "no",
"transitioningMessage": null,
"transitioningProgress": null,
"upgrade": null,
"uuid": "37cd48c5-acb4-4e4e-90e7-85d1faf3733e",
"vip": null,
"environmentId": "1e20"
} |
Hey @SantoDE, thanks for the pull request. The problem is fixed now, I can see now frontend and backend. There is still a problem when the network is set to host, but I'll make a PR for that. I know how to fix that. Thanks 👍 |
Closed by #2053. |
Bug
What did you do?
I've cloned the latest master (1d2d0ce) and found out that traefik is not loading the traefik configuration. From version 1.3 it returns {}. Rancher version v1.6.5
What did you expect to see?
I've expected traefik would detect frontend and backend.
What did you see instead?
Configuration received from provider rancher: {}
Output of
traefik version
: (What version of Traefik are you using?)Version: dev
Codename: cheddar
Go version: go1.8.3
Built: I don't remember exactly
OS/Arch: linux/amd64
What is your environment & configuration (arguments, toml, provider, platform, ...)?
If applicable, please paste the log output in debug mode (
--debug
switch)Version 1.3
On master
The text was updated successfully, but these errors were encountered: