- {{#if (gt proxy.Service.Proxy.Expose.Paths.length 0)}}
+ {{#if (gt proxy.ServiceProxy.Expose.Paths.length 0)}}
- The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation.
+ The following list shows individual HTTP paths exposed through Envoy for external services like Prometheus. Read more about this in our documentation .
-
+
{{else}}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs b/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs
index 1e3648b5f1..454e92f1a6 100644
--- a/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs
+++ b/ui/packages/consul-ui/app/templates/dc/services/instance/healthchecks.hbs
@@ -27,7 +27,7 @@ as |route|>
)
)
- route.model.item.MeshChecks
+ (merge-checks (array route.model.item.Checks route.model.proxy.Checks) route.model.proxy.ServiceProxy.Expose.Checks)
as |sort filters items|}}
diff --git a/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs b/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs
index 526073d51c..30830ca4ca 100644
--- a/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs
+++ b/ui/packages/consul-ui/app/templates/dc/services/instance/upstreams.hbs
@@ -25,9 +25,10 @@ as |route|>
route.params.dc
route.model.proxy
+ route.model.meta
route.model.proxy.Service.Proxy.Upstreams
- as |sort filters partition nspace dc proxy items|}}
+ as |sort filters partition nspace dc proxy meta items|}}
{{#if (gt items.length 0)}}
@filter={{filters}}
/>
{{/if}}
- {{#if (eq proxy.ServiceProxy.Mode 'transparent')}}
-
-
- {{t "routes.dc.services.instance.upstreams.tproxy-mode.header"}}
-
-
-
- {{t "routes.dc.services.instance.upstreams.tproxy-mode.body"}}
-
-
-
-
-
- {{t "routes.dc.services.instance.upstreams.tproxy-mode.footer"}}
-
-
-
-
+ {{! TODO: Looks like we can get this straight from item.Proxy.Mode }}
+ {{! the less we need `proxy` and `meta` the better }}
+ {{#if (eq meta.ServiceProxy.Mode 'transparent')}}
+
+
+
+ {{t "routes.dc.services.instance.upstreams.tproxy-mode.header"}}
+
+
+
+
+ {{t "routes.dc.services.instance.upstreams.tproxy-mode.body"}}
+
+
+
+
+
+ {{t "routes.dc.services.instance.upstreams.tproxy-mode.footer"}}
+
+
+
+
{{/if}}
`
`)}
]
},
- "Mode": "${fake.helpers.randomize(['', 'direct', 'transparent'])}",
+ "Mode": "${env('CONSUL_TPROXY_ENABLE') ? `transparent` : fake.helpers.randomize(['', 'direct', 'transparent'])}",
"TransparentProxy": {},
"DestinationServiceName": "${location.pathname.slice(4)}"
${ location.pathname.slice(4) === "service-0" ? `
diff --git a/ui/packages/consul-ui/mock-api/v1/catalog/connect/backend b/ui/packages/consul-ui/mock-api/v1/catalog/connect/backend
new file mode 100644
index 0000000000..87989f145e
--- /dev/null
+++ b/ui/packages/consul-ui/mock-api/v1/catalog/connect/backend
@@ -0,0 +1,82 @@
+[
+ {
+ "ID": "237b9eeb-bba1-e6e3-3c99-c527d6d76cc0",
+ "Node": "node",
+ "Address": "172.17.0.2",
+ "Datacenter": "dc1",
+ "TaggedAddresses": {
+ "lan": "172.17.0.2",
+ "lan_ipv4": "172.17.0.2",
+ "wan": "172.17.0.2",
+ "wan_ipv4": "172.17.0.2"
+ },
+ "NodeMeta": {
+ "consul-network-segment": ""
+ },
+ "ServiceKind": "connect-proxy",
+ "ServiceID": "backend-sidecar-proxy",
+ "ServiceName": "backend-sidecar-proxy",
+ "ServiceTags": [],
+ "ServiceAddress": "",
+ "ServiceWeights": {
+ "Passing": 1,
+ "Warning": 1
+ },
+ "ServiceMeta": {},
+ "ServicePort": 21000,
+ "ServiceSocketPath": "",
+ "ServiceEnableTagOverride": false,
+ "ServiceProxy": {
+ "DestinationServiceName": "backend",
+ "DestinationServiceID": "backend",
+ "LocalServiceAddress": "127.0.0.1",
+ "LocalServicePort": 7000,
+ "Mode": "",
+ "MeshGateway": {},
+ "Expose": {}
+ },
+ "ServiceConnect": {},
+ "CreateIndex": 19,
+ "ModifyIndex": 19
+ },
+ {
+ "ID": "237b9eeb-bba1-e6e3-3c99-c527d6d76cc0",
+ "Node": "node",
+ "Address": "172.17.0.2",
+ "Datacenter": "dc1",
+ "TaggedAddresses": {
+ "lan": "172.17.0.2",
+ "lan_ipv4": "172.17.0.2",
+ "wan": "172.17.0.2",
+ "wan_ipv4": "172.17.0.2"
+ },
+ "NodeMeta": {
+ "consul-network-segment": ""
+ },
+ "ServiceKind": "connect-proxy",
+ "ServiceID": "backend-v2-sidecar-proxy",
+ "ServiceName": "backend-sidecar-proxy",
+ "ServiceTags": [],
+ "ServiceAddress": "",
+ "ServiceWeights": {
+ "Passing": 1,
+ "Warning": 1
+ },
+ "ServiceMeta": {},
+ "ServicePort": 21001,
+ "ServiceSocketPath": "",
+ "ServiceEnableTagOverride": false,
+ "ServiceProxy": {
+ "DestinationServiceName": "backend",
+ "DestinationServiceID": "backend-v2",
+ "LocalServiceAddress": "127.0.0.1",
+ "LocalServicePort": 7001,
+ "Mode": "",
+ "MeshGateway": {},
+ "Expose": {}
+ },
+ "ServiceConnect": {},
+ "CreateIndex": 21,
+ "ModifyIndex": 21
+ }
+]
diff --git a/ui/packages/consul-ui/mock-api/v1/health/service/backend b/ui/packages/consul-ui/mock-api/v1/health/service/backend
new file mode 100644
index 0000000000..40b1cbbac4
--- /dev/null
+++ b/ui/packages/consul-ui/mock-api/v1/health/service/backend
@@ -0,0 +1,122 @@
+[
+ {
+ "Node": {
+ "ID": "237b9eeb-bba1-e6e3-3c99-c527d6d76cc0",
+ "Node": "node",
+ "Address": "172.17.0.2",
+ "Datacenter": "dc1",
+ "TaggedAddresses": {
+ "lan": "172.17.0.2",
+ "lan_ipv4": "172.17.0.2",
+ "wan": "172.17.0.2",
+ "wan_ipv4": "172.17.0.2"
+ },
+ "Meta": {
+ "consul-network-segment": ""
+ },
+ "CreateIndex": 14,
+ "ModifyIndex": 17
+ },
+ "Service": {
+ "ID": "backend",
+ "Service": "backend",
+ "Tags": [],
+ "Address": "",
+ "Meta": null,
+ "Port": 7000,
+ "Weights": {
+ "Passing": 1,
+ "Warning": 1
+ },
+ "EnableTagOverride": false,
+ "Proxy": {
+ "Mode": "",
+ "MeshGateway": {},
+ "Expose": {}
+ },
+ "Connect": {},
+ "CreateIndex": 18,
+ "ModifyIndex": 18
+ },
+ "Checks": [
+ {
+ "Node": "node",
+ "CheckID": "serfHealth",
+ "Name": "Serf Health Status",
+ "Status": "passing",
+ "Notes": "",
+ "Output": "Agent alive and reachable",
+ "ServiceID": "",
+ "ServiceName": "",
+ "ServiceTags": [],
+ "Type": "",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 14,
+ "ModifyIndex": 14
+ }
+ ]
+ },
+ {
+ "Node": {
+ "ID": "237b9eeb-bba1-e6e3-3c99-c527d6d76cc0",
+ "Node": "node",
+ "Address": "172.17.0.2",
+ "Datacenter": "dc1",
+ "TaggedAddresses": {
+ "lan": "172.17.0.2",
+ "lan_ipv4": "172.17.0.2",
+ "wan": "172.17.0.2",
+ "wan_ipv4": "172.17.0.2"
+ },
+ "Meta": {
+ "consul-network-segment": ""
+ },
+ "CreateIndex": 14,
+ "ModifyIndex": 17
+ },
+ "Service": {
+ "ID": "backend-v2",
+ "Service": "backend",
+ "Tags": [],
+ "Address": "",
+ "Meta": null,
+ "Port": 7001,
+ "Weights": {
+ "Passing": 1,
+ "Warning": 1
+ },
+ "EnableTagOverride": false,
+ "Proxy": {
+ "Mode": "",
+ "MeshGateway": {},
+ "Expose": {}
+ },
+ "Connect": {},
+ "CreateIndex": 20,
+ "ModifyIndex": 20
+ },
+ "Checks": [
+ {
+ "Node": "node",
+ "CheckID": "serfHealth",
+ "Name": "Serf Health Status",
+ "Status": "passing",
+ "Notes": "",
+ "Output": "Agent alive and reachable",
+ "ServiceID": "",
+ "ServiceName": "",
+ "ServiceTags": [],
+ "Type": "",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 14,
+ "ModifyIndex": 14
+ }
+ ]
+ }
+]
diff --git a/ui/packages/consul-ui/mock-api/v1/health/service/backend-sidecar-proxy b/ui/packages/consul-ui/mock-api/v1/health/service/backend-sidecar-proxy
new file mode 100644
index 0000000000..f1a2bdfe48
--- /dev/null
+++ b/ui/packages/consul-ui/mock-api/v1/health/service/backend-sidecar-proxy
@@ -0,0 +1,204 @@
+[
+ {
+ "Node": {
+ "ID": "237b9eeb-bba1-e6e3-3c99-c527d6d76cc0",
+ "Node": "node",
+ "Address": "172.17.0.2",
+ "Datacenter": "dc1",
+ "TaggedAddresses": {
+ "lan": "172.17.0.2",
+ "lan_ipv4": "172.17.0.2",
+ "wan": "172.17.0.2",
+ "wan_ipv4": "172.17.0.2"
+ },
+ "Meta": {
+ "consul-network-segment": ""
+ },
+ "CreateIndex": 14,
+ "ModifyIndex": 17
+ },
+ "Service": {
+ "Kind": "connect-proxy",
+ "ID": "backend-sidecar-proxy",
+ "Service": "backend-sidecar-proxy",
+ "Tags": [],
+ "Address": "",
+ "Meta": null,
+ "Port": 21000,
+ "Weights": {
+ "Passing": 1,
+ "Warning": 1
+ },
+ "EnableTagOverride": false,
+ "Proxy": {
+ "DestinationServiceName": "backend",
+ "DestinationServiceID": "backend",
+ "LocalServiceAddress": "127.0.0.1",
+ "LocalServicePort": 7000,
+ "Mode": "",
+ "MeshGateway": {},
+ "Expose": {}
+ },
+ "Connect": {},
+ "CreateIndex": 19,
+ "ModifyIndex": 19
+ },
+ "Checks": [
+ {
+ "Node": "node",
+ "CheckID": "serfHealth",
+ "Name": "Serf Health Status",
+ "Status": "passing",
+ "Notes": "",
+ "Output": "Agent alive and reachable",
+ "ServiceID": "",
+ "ServiceName": "",
+ "ServiceTags": [],
+ "Type": "",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 14,
+ "ModifyIndex": 14
+ },
+ {
+ "Node": "node",
+ "CheckID": "service:backend-sidecar-proxy:1",
+ "Name": "Connect Sidecar Listening",
+ "Status": "critical",
+ "Notes": "",
+ "Output": "dial tcp 127.0.0.1:21000: connect: connection refused",
+ "ServiceID": "backend-sidecar-proxy",
+ "ServiceName": "backend-sidecar-proxy",
+ "ServiceTags": [],
+ "Type": "tcp",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 19,
+ "ModifyIndex": 42
+ },
+ {
+ "Node": "node",
+ "CheckID": "service:backend-sidecar-proxy:2",
+ "Name": "Connect Sidecar Aliasing backend",
+ "Status": "critical",
+ "Notes": "",
+ "Output": "No checks found.",
+ "ServiceID": "backend-sidecar-proxy",
+ "ServiceName": "backend-sidecar-proxy",
+ "ServiceTags": [],
+ "Type": "alias",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 19,
+ "ModifyIndex": 19
+ }
+ ]
+ },
+ {
+ "Node": {
+ "ID": "237b9eeb-bba1-e6e3-3c99-c527d6d76cc0",
+ "Node": "node",
+ "Address": "172.17.0.2",
+ "Datacenter": "dc1",
+ "TaggedAddresses": {
+ "lan": "172.17.0.2",
+ "lan_ipv4": "172.17.0.2",
+ "wan": "172.17.0.2",
+ "wan_ipv4": "172.17.0.2"
+ },
+ "Meta": {
+ "consul-network-segment": ""
+ },
+ "CreateIndex": 14,
+ "ModifyIndex": 17
+ },
+ "Service": {
+ "Kind": "connect-proxy",
+ "ID": "backend-v2-sidecar-proxy",
+ "Service": "backend-sidecar-proxy",
+ "Tags": [],
+ "Address": "",
+ "Meta": null,
+ "Port": 21001,
+ "Weights": {
+ "Passing": 1,
+ "Warning": 1
+ },
+ "EnableTagOverride": false,
+ "Proxy": {
+ "DestinationServiceName": "backend",
+ "DestinationServiceID": "backend-v2",
+ "LocalServiceAddress": "127.0.0.1",
+ "LocalServicePort": 7001,
+ "Mode": "",
+ "MeshGateway": {},
+ "Expose": {}
+ },
+ "Connect": {},
+ "CreateIndex": 21,
+ "ModifyIndex": 21
+ },
+ "Checks": [
+ {
+ "Node": "node",
+ "CheckID": "serfHealth",
+ "Name": "Serf Health Status",
+ "Status": "passing",
+ "Notes": "",
+ "Output": "Agent alive and reachable",
+ "ServiceID": "",
+ "ServiceName": "",
+ "ServiceTags": [],
+ "Type": "",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 14,
+ "ModifyIndex": 14
+ },
+ {
+ "Node": "node",
+ "CheckID": "service:backend-v2-sidecar-proxy:1",
+ "Name": "Connect Sidecar Listening",
+ "Status": "critical",
+ "Notes": "",
+ "Output": "dial tcp 127.0.0.1:21001: connect: connection refused",
+ "ServiceID": "backend-v2-sidecar-proxy",
+ "ServiceName": "backend-sidecar-proxy",
+ "ServiceTags": [],
+ "Type": "tcp",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 21,
+ "ModifyIndex": 44
+ },
+ {
+ "Node": "node",
+ "CheckID": "service:backend-v2-sidecar-proxy:2",
+ "Name": "Connect Sidecar Aliasing backend-v2",
+ "Status": "passing",
+ "Notes": "",
+ "Output": "No checks found.",
+ "ServiceID": "backend-v2-sidecar-proxy",
+ "ServiceName": "backend-sidecar-proxy",
+ "ServiceTags": [],
+ "Type": "alias",
+ "Interval": "",
+ "Timeout": "",
+ "ExposedPort": 0,
+ "Definition": {},
+ "CreateIndex": 21,
+ "ModifyIndex": 21
+ }
+ ]
+ }
+]
diff --git a/ui/packages/consul-ui/tests/integration/services/routlet-test.js b/ui/packages/consul-ui/tests/integration/services/routlet-test.js
new file mode 100644
index 0000000000..c0faa5f408
--- /dev/null
+++ b/ui/packages/consul-ui/tests/integration/services/routlet-test.js
@@ -0,0 +1,32 @@
+import { moduleFor, test } from 'ember-qunit';
+moduleFor('service:routlet', 'Integration | Routlet', {
+ // Specify the other units that are required for this test.
+ integration: true,
+});
+test('outletFor works', function(assert) {
+ const routlet = this.subject();
+ routlet.addOutlet('application', {
+ name: 'application'
+ });
+ routlet.addRoute('dc', {});
+ routlet.addOutlet('dc', {
+ name: 'dc'
+ });
+ routlet.addRoute('dc.services', {});
+ routlet.addOutlet('dc.services', {
+ name: 'dc.services'
+ });
+ routlet.addRoute('dc.services.instances', {});
+
+ let actual = routlet.outletFor('dc.services');
+ let expected = 'dc';
+ assert.equal(actual.name, expected);
+
+ actual = routlet.outletFor('dc');
+ expected = 'application';
+ assert.equal(actual.name, expected);
+
+ actual = routlet.outletFor('application');
+ expected = undefined;
+ assert.equal(actual, expected);
+});