Allows creation of external services from within your rancherize.json. This most notably allows to add Healthcheck and PublishUrl configuration to the ExternalService which is not possible through the rancher ui at this point(version 1.5.9)
Services are not changed uppon pushes. You must delete the external service for changes to take effect.
I have added the option to call rancher-compose with --force-upgrade
and adding the service names of the externals on
the up
command but this does not change the external service.
If you know a way to achieve this please open an issue on github.
- external services are read from bellow the json array or object
external-services
- An array or numeric object variable name will result in the external service name
external-$NUMBER
- An non-numeric object variable name will be used as external service name
- An array or numeric object variable name will result in the external service name
ips
: array of ip addresses to point topublish
: see Publish Urlshealthcheck
: see Healthcheck
{
"environments": {
"envname": {
"external-services":[
{
"ips":["192.168.2.1"],
"publish":{ "url":"https:\/\/www.example.com\/" },
"healthcheck":{ "url":"\/" }
},
{
"ips":["192.168.2.1"],
"publish":{ "url":"https:\/\/www.example2.com\/" },
"healthcheck":{ "url":"\/" }
}
]
}
}
}
{
"environments": {
"envname": {
"external-services":{
"example":{
"ips":["192.168.2.1"],
"publish":{ "url":"https:\/\/www.example.com\/" },
"healthcheck":{ "url":"\/" }
},
"test":{
"ips":["192.168.2.1"],
"publish":{ "url":"https:\/\/www.example2.com\/" },
"healthcheck":{ "url":"\/" }
}
}
}
}
}
{
"environments": {
"envname": {
"external-services":{
"enable":false,
"example":{
"ips":["192.168.2.1"],
"publish":{ "url":"https:\/\/www.example.com\/" },
"healthcheck":{ "url":"\/" }
},
"test":{
"ips":["192.168.2.1"],
"publish":{ "url":"https:\/\/www.example2.com\/" },
"healthcheck":{ "url":"\/" }
}
}
}
}
}
{
"environments": {
"envname": {
"external-services":{
"example":{
"type":"tcp-proxy",
"ips":"192.168.2.1",
"publish":{ "url":"https:\/\/www.example.com\/" },
"healthcheck":{ "url":"\/" }
},
"test":{
"type":"tcp-proxy",
"ip":"192.168.2.1",
"publish":{ "url":"https:\/\/www.example2.com\/" },
"healthcheck":{ "url":"\/" }
}
}
}
}
}
## Types
The default type is `rancher-external` which builds a rancher external. We are currently working with traefiks rancher api
backend which does not add externals properly. To offset this the type `tcp-proxy` was added
### Extend types
Adding a new type is as easy as creating a plugin and implementing the ExternalServiceBuilder interface, then making it
available in the container under `external-service-builder.builder-types.TYPENAME` from your Plugin-Provider