Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Latest commit

 

History

History
117 lines (109 loc) · 3.21 KB

File metadata and controls

117 lines (109 loc) · 3.21 KB

External Services

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)

Limitations

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.

Options

  • 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
  • ips: array of ip addresses to point to
  • publish: see Publish Urls
  • healthcheck: see Healthcheck

Example

external-1, external-2 ...

{
	"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":"\/" }
				}
			]
		}
	}
}

external-example, external-test ...

{
	"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":"\/" }
				}
			}
		}
	}
}

externals disabled

{
	"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":"\/" }
				}
			}
		}
	}
}

Tcp-Proxy externals

{
	"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