Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
f3b0fb3c
Commit
f3b0fb3c
authored
Feb 01, 2016
by
Jack Greenfield
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #208 from michelleN/resourcifier-health
add health check to resourcifier
parents
2d75da6b
750d7caf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
install.yaml
install.yaml
+7
-0
main.go
resourcifier/main.go
+10
-1
No files found.
install.yaml
View file @
f3b0fb3c
...
...
@@ -103,6 +103,13 @@ spec:
containers
:
-
env
:
[]
image
:
gcr.io/dm-k8s-testing/resourcifier:latest
imagePullPolicy
:
Always
livenessProbe
:
httpGet
:
path
:
/healthz
port
:
8080
initialDelaySeconds
:
30
timeoutSeconds
:
1
name
:
resourcifier
ports
:
-
containerPort
:
8080
...
...
resourcifier/main.go
View file @
f3b0fb3c
...
...
@@ -17,6 +17,7 @@ limitations under the License.
package
main
import
(
"github.com/kubernetes/deployment-manager/util"
"github.com/kubernetes/deployment-manager/version"
"flag"
...
...
@@ -38,7 +39,9 @@ type Route struct {
Type
string
}
var
routes
=
[]
Route
{}
var
routes
=
[]
Route
{
{
"HealthCheck"
,
"/healthz"
,
"GET"
,
healthCheckHandlerFunc
,
""
},
}
// port to listen on
var
port
=
flag
.
Int
(
"port"
,
8080
,
"The port to listen on"
)
...
...
@@ -74,3 +77,9 @@ func main() {
log
.
Printf
(
"Listening on port %d..."
,
*
port
)
log
.
Fatal
(
http
.
ListenAndServe
(
address
,
handler
))
}
func
healthCheckHandlerFunc
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
handler
:=
"manager: get health"
util
.
LogHandlerEntry
(
handler
,
r
)
util
.
LogHandlerExitWithText
(
handler
,
w
,
"OK"
,
http
.
StatusOK
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment