Update update-demo to work for v1, and don't use localhost domain name
This commit is contained in:
@@ -3,7 +3,7 @@ kind: ReplicationController
|
|||||||
metadata:
|
metadata:
|
||||||
name: update-demo-kitten
|
name: update-demo-kitten
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 4
|
||||||
selector:
|
selector:
|
||||||
name: update-demo
|
name: update-demo
|
||||||
version: kitten
|
version: kitten
|
||||||
|
@@ -22,9 +22,9 @@ limitations under the License.
|
|||||||
</head>
|
</head>
|
||||||
<body ng-controller="ButtonsCtrl">
|
<body ng-controller="ButtonsCtrl">
|
||||||
<div ng-repeat="server in servers" class="pod">
|
<div ng-repeat="server in servers" class="pod">
|
||||||
<img src="http://localhost:8001/api/v1/proxy/namespaces/default/pods/{{server.podName}}/{{server.image}}" height="100px" width="100px" />
|
<img src="/api/v1/proxy/namespaces/default/pods/{{server.podName}}/{{server.image}}" height="100px" width="100px" />
|
||||||
<b>ID:</b> {{server.podName}}<br>
|
<b>ID:</b> {{server.podName}}<br>
|
||||||
<b>Host:</b> <a href="http://localhost:8001/api/v1/proxy/namespaces/default/pods/{{server.podName}}/data.json">{{server.host}}</a><br>
|
<b>Host:</b> <a href="/api/v1/proxy/namespaces/default/pods/{{server.podName}}/data.json">{{server.host}}</a><br>
|
||||||
<b>Status:</b> {{server.status}}<br>
|
<b>Status:</b> {{server.status}}<br>
|
||||||
<b>Image:</b> {{server.dockerImage}}<br>
|
<b>Image:</b> {{server.dockerImage}}<br>
|
||||||
<b>Labels:</b>
|
<b>Labels:</b>
|
||||||
|
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var base = "http://localhost:8001/api/v1/";
|
var base = "/api/v1/";
|
||||||
|
|
||||||
var updateImage = function($http, server) {
|
var updateImage = function($http, server) {
|
||||||
$http.get(base + "proxy/namespaces/default/pods/" + server.podName + "/data.json")
|
$http.get(base + "proxy/namespaces/default/pods/" + server.podName + "/data.json")
|
||||||
@@ -33,7 +33,7 @@ var updateServer = function($http, server) {
|
|||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
server.labels = data.metadata.labels;
|
server.labels = data.metadata.labels;
|
||||||
server.host = data.spec.host.split('.')[0];
|
server.host = data.status.hostIP.split('.')[0];
|
||||||
server.status = data.status.phase;
|
server.status = data.status.phase;
|
||||||
server.dockerImage = data.status.containerStatuses[0].image;
|
server.dockerImage = data.status.containerStatuses[0].image;
|
||||||
updateImage($http, server);
|
updateImage($http, server);
|
||||||
|
Reference in New Issue
Block a user