add /livez as a liveness endpoint for kube-apiserver

go fmt

make func private

refactor config_test

Two primary refactorings:

1. config test checkPath method is now each a distinct test
run (which makes it easier to see what is actually failing)

2. TestNewWithDelegate's root path check now parses the json output and
does a comparison against a list of expected paths (no more whitespace
and ordering issues when updating this test, yay).

go fmt

modify and simplify existing integration test for readyz/livez

simplify integration test

set default rbac policy rules for livez

rename a few functions and the entrypoint command line argument (and etcetera)

simplify interface for installing readyz and livez and make auto-register completion a bootstrapped check

untangle some of the nested functions, restructure the code
This commit is contained in:
Han Kang
2019-08-26 16:57:25 -07:00
parent 2af52db689
commit aa1b2d6d35
15 changed files with 211 additions and 179 deletions

View File

@@ -197,7 +197,8 @@ func ClusterRoles() []rbacv1.ClusterRole {
ObjectMeta: metav1.ObjectMeta{Name: "system:discovery"},
Rules: []rbacv1.PolicyRule{
rbacv1helpers.NewRule("get").URLs(
"/readyz", "/healthz", "/version", "/version/",
"/livez", "/readyz", "/healthz",
"/version", "/version/",
"/openapi", "/openapi/*",
"/api", "/api/*",
"/apis", "/apis/*",
@@ -217,7 +218,7 @@ func ClusterRoles() []rbacv1.ClusterRole {
ObjectMeta: metav1.ObjectMeta{Name: "system:public-info-viewer"},
Rules: []rbacv1.PolicyRule{
rbacv1helpers.NewRule("get").URLs(
"/readyz", "/healthz", "/version", "/version/",
"/livez", "/readyz", "/healthz", "/version", "/version/",
).RuleOrDie(),
},
},

View File

@@ -548,6 +548,7 @@ items:
- /apis
- /apis/*
- /healthz
- /livez
- /openapi
- /openapi/*
- /readyz
@@ -1185,6 +1186,7 @@ items:
rules:
- nonResourceURLs:
- /healthz
- /livez
- /readyz
- /version
- /version/