forked from stefanprodan/podinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09a743f
commit a945842
Showing
6 changed files
with
176 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
.idea/ | ||
release/ | ||
build/ | ||
gcloud/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
FROM alpine:3.7 | ||
|
||
COPY ./ui ./ui | ||
ADD podinfo /podinfo | ||
|
||
CMD ["./podinfo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>{{.Title}}</title> | ||
<meta charset="utf-8"> | ||
<!-- <meta http-equiv="refresh" content="5"> --> | ||
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet"> | ||
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet"> | ||
<style> | ||
[v-cloak] { | ||
display: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="app" v-cloak> | ||
<v-app dark> | ||
<v-content> | ||
<section> | ||
<v-parallax src="#" height="600" :class="info.color"> | ||
<v-layout | ||
column | ||
align-center | ||
justify-center | ||
class="white--text" | ||
> | ||
<img src="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo_with_border.png" alt="kubernetes" height="200"> | ||
<h1 class="white--text mb-2 display-1 text-xs-center">${ info.title }</h1> | ||
<div class="subheading mb-3 text-xs-center">Response processed by ${ info.hostname }</div> | ||
<v-btn | ||
class="blue darken-2 mt-5" | ||
dark | ||
large | ||
@click="ping()" | ||
> | ||
<v-icon left dark>touch_app</v-icon> | ||
Ping ${ pings } | ||
</v-btn> | ||
</v-layout> | ||
</v-parallax> | ||
</section> | ||
|
||
<section> | ||
<v-layout | ||
column | ||
wrap | ||
class="my-5" | ||
align-center | ||
> | ||
<v-flex xs12 sm4 class="my-3"> | ||
<div class="text-xs-center"> | ||
<h2 class="headline">The best way to start developing</h2> | ||
<span class="subheading"> | ||
stateless microservices with Go for Kubernetes | ||
</span> | ||
</div> | ||
</v-flex> | ||
<v-flex xs12> | ||
<v-container grid-list-xl> | ||
<v-layout row wrap align-center> | ||
<v-flex xs12 md4> | ||
<v-card class="elevation-0 transparent"> | ||
<v-card-text class="text-xs-center"> | ||
<v-icon x-large class="blue--text text--lighten-2">cloud</v-icon> | ||
</v-card-text> | ||
<v-card-title primary-title class="layout justify-center"> | ||
<div class="headline text-xs-center">Cloud Native</div> | ||
</v-card-title> | ||
<v-card-text> | ||
Distributed as a Helm chart. Builtin Kubernetes health checks (readiness and liveness). | ||
Graceful shutdown on interrupt signals. | ||
</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
<v-flex xs12 md4> | ||
<v-card class="elevation-0 transparent"> | ||
<v-card-text class="text-xs-center"> | ||
<v-icon x-large class="blue--text text--lighten-2">flash_on</v-icon> | ||
</v-card-text> | ||
<v-card-title primary-title class="layout justify-center"> | ||
<div class="headline">Fast development</div> | ||
</v-card-title> | ||
<v-card-text> | ||
Dependency management with golang/dep. | ||
Structured logging with zerolog. | ||
Error handling with pkg/errors. | ||
</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
<v-flex xs12 md4> | ||
<v-card class="elevation-0 transparent"> | ||
<v-card-text class="text-xs-center"> | ||
<v-icon x-large class="blue--text text--lighten-2">build</v-icon> | ||
</v-card-text> | ||
<v-card-title primary-title class="layout justify-center"> | ||
<div class="headline text-xs-center">Release automation</div> | ||
</v-card-title> | ||
<v-card-text> | ||
Multi-platform Docker image AMD64 and ARMv7. | ||
CI/CD powered by: TravisCI CircleCI Quay.io Google Cloud Container Builder Skaffold Weave Flux. | ||
</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
</v-layout> | ||
</v-container> | ||
</v-flex> | ||
</v-layout> | ||
</section> | ||
|
||
<v-footer class="blue darken-2"> | ||
<v-layout row wrap align-center> | ||
<v-flex xs12> | ||
<div class="white--text ml-3"> | ||
Powered | ||
by <a class="white--text" href="https://github.com/stefanprodan/k8s-podinfo" target="_blank">podinfo</a> | ||
version ${ info.version } revision ${ info.revision } | ||
</div> | ||
</v-flex> | ||
</v-layout> | ||
</v-footer> | ||
</v-content> | ||
</v-app> | ||
</div> | ||
<script src="https://unpkg.com/vue/dist/vue.js"></script> | ||
<script src="https://unpkg.com/vuetify/dist/vuetify.js"></script> | ||
<script> | ||
new Vue({ | ||
delimiters: ['${', '}'], | ||
el: '#app', | ||
data: function() { | ||
return { | ||
info: {}, | ||
timer: '', | ||
pings: 0 | ||
} | ||
}, | ||
created: function() { | ||
this.fetchInfo(); | ||
this.timer = setInterval(this.fetchInfo, 3000) | ||
}, | ||
methods: { | ||
fetchInfo: function() { | ||
var xhr = new XMLHttpRequest() | ||
var self = this | ||
xhr.open('GET', "/api/info") | ||
xhr.onload = function () { | ||
self.info = JSON.parse(xhr.responseText) | ||
} | ||
xhr.onerror = function() { | ||
console.log(xhr.responseText || 'Network request failed') | ||
} | ||
xhr.send() | ||
}, | ||
ping: function() { | ||
var xhr = new XMLHttpRequest() | ||
var self = this | ||
xhr.open('POST', "/backend") | ||
xhr.onload = function () { | ||
self.pings++ | ||
} | ||
xhr.onerror = function() { | ||
console.log(xhr.responseText || 'Network request failed') | ||
} | ||
xhr.send(Math.random()) | ||
} | ||
} | ||
}) | ||
</script> | ||
</body> | ||
</html> |