diff --git a/cache.go b/cache.go index 0e08f0e..d29cc36 100644 --- a/cache.go +++ b/cache.go @@ -1,6 +1,6 @@ package main -import fthealth "github.com/Financial-Times/go-fthealth/v1a" +import fthealth "github.com/Financial-Times/go-fthealth/v1_1" type cachedHealth struct { toWriteToCache chan fthealth.CheckResult diff --git a/cachingController.go b/cachingController.go index 7bc1978..ad1dd0b 100644 --- a/cachingController.go +++ b/cachingController.go @@ -2,7 +2,7 @@ package main import ( "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "math" "reflect" "time" @@ -74,10 +74,16 @@ func (c *healthCheckController) scheduleCheck(mService measuredService, refreshP // run check serviceToBeChecked := mService.service - checkResult := fthealth.RunCheck(serviceToBeChecked.name, + + var checks []fthealth.Check + checks = append(checks, newServiceHealthCheck(serviceToBeChecked, c.healthCheckService)) + + checkResult := fthealth.RunCheck(fthealth.HealthCheck{ + serviceToBeChecked.name, + serviceToBeChecked.name, fmt.Sprintf("Checks the health of %v", serviceToBeChecked.name), - true, - newServiceHealthCheck(serviceToBeChecked, c.healthCheckService)).Checks[0] + checks, + }).Checks[0] checkResult.Ack = serviceToBeChecked.ack diff --git a/checkerService.go b/checkerService.go index c4c738e..c07f647 100644 --- a/checkerService.go +++ b/checkerService.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "io/ioutil" "net/http" ) diff --git a/controller.go b/controller.go index 766f5bc..64196f5 100644 --- a/controller.go +++ b/controller.go @@ -2,7 +2,7 @@ package main import ( "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "sort" "sync" "time" @@ -122,7 +122,12 @@ func (c *healthCheckController) runServiceChecksByServiceNames(services map[stri checks = append(checks, check) } - healthChecks := fthealth.RunCheck("Forced check run", "", true, checks...).Checks + healthChecks := fthealth.RunCheck(fthealth.HealthCheck{ + "aggregate-healthcheck", + "Aggregate Healthcheck", + "Forced check run", + checks, + }).Checks wg := sync.WaitGroup{} for i := range healthChecks { diff --git a/controller_test.go b/controller_test.go index 6f6f53d..001472d 100644 --- a/controller_test.go +++ b/controller_test.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "github.com/stretchr/testify/assert" "net/http" "os" diff --git a/graphiteFeeder.go b/graphiteFeeder.go index 2c43d4a..2ca2daf 100644 --- a/graphiteFeeder.go +++ b/graphiteFeeder.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "net" "strings" "time" diff --git a/graphiteFeeder_test.go b/graphiteFeeder_test.go index 4a40a19..715e504 100644 --- a/graphiteFeeder_test.go +++ b/graphiteFeeder_test.go @@ -1,7 +1,7 @@ package main import ( - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "github.com/stretchr/testify/assert" "net" "testing" diff --git a/handler.go b/handler.go index ad0d582..da22325 100644 --- a/handler.go +++ b/handler.go @@ -3,7 +3,7 @@ package main import ( "encoding/json" "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "html/template" "net/http" "net/url" @@ -420,7 +420,7 @@ func populateIndividualServiceChecks(checks []fthealth.CheckResult, pathPrefix s AddOrRemoveAckPath: addOrRemoveAckPath, AddOrRemoveAckPathName: addOrRemoveAckPathName, AckMessage: individualCheck.Ack, - Output: individualCheck.Output, + Output: individualCheck.CheckOutput, } indiviualServiceChecks = append(indiviualServiceChecks, hc) @@ -451,7 +451,7 @@ func populateIndividualPodChecks(checks []fthealth.CheckResult, pathPrefix strin LastUpdated: check.LastUpdated.Format(timeLayout), MoreInfoPath: getIndividualPodHealthcheckURL("", pathPrefix, podName), AckMessage: check.Ack, - Output: check.Output, + Output: check.CheckOutput, } indiviualServiceChecks = append(indiviualServiceChecks, hc) diff --git a/handler_test.go b/handler_test.go index 49a32b4..a6d6368 100644 --- a/handler_test.go +++ b/handler_test.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "github.com/stretchr/testify/assert" "net/http" "net/http/httptest" diff --git a/helm/upp-aggregate-healthcheck/templates/deployment.yaml b/helm/upp-aggregate-healthcheck/templates/deployment.yaml index 07759b8..8f795e1 100644 --- a/helm/upp-aggregate-healthcheck/templates/deployment.yaml +++ b/helm/upp-aggregate-healthcheck/templates/deployment.yaml @@ -20,6 +20,16 @@ spec: app: {{ .Values.service.name }} visualize: "true" spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - {{ .Values.service.name }} + topologyKey: "kubernetes.io/hostname" containers: - name: {{ .Values.service.name }} image: "{{ .Values.image.repository }}:{{ .Chart.Version }}" diff --git a/helm/upp-aggregate-healthcheck/values.yaml b/helm/upp-aggregate-healthcheck/values.yaml index f51a341..ddddae6 100644 --- a/helm/upp-aggregate-healthcheck/values.yaml +++ b/helm/upp-aggregate-healthcheck/values.yaml @@ -9,8 +9,10 @@ image: repository: coco/upp-aggregate-healthcheck pullPolicy: IfNotPresent resources: + requests: + memory: 128Mi limits: - memory: 256Mi + memory: 512Mi env: PATH_PREFIX: "" categories: diff --git a/podController.go b/podController.go index bceba28..29bc0ac 100644 --- a/podController.go +++ b/podController.go @@ -3,7 +3,7 @@ package main import ( "errors" "fmt" - fthealth "github.com/Financial-Times/go-fthealth/v1a" + fthealth "github.com/Financial-Times/go-fthealth/v1_1" "io/ioutil" "net/http" "sort" @@ -52,7 +52,13 @@ func (c *healthCheckController) runPodChecksFor(serviceName string) ([]fthealth. checks = append(checks, check) } - healthChecks := fthealth.RunCheck("Forced check run", "", true, checks...).Checks + healthChecks := fthealth.RunCheck(fthealth.HealthCheck{ + "aggregate-healthcheck", + "Aggregate Healthcheck", + "Forced check run", + checks, + }).Checks + wg := sync.WaitGroup{} for i := range healthChecks { wg.Add(1) diff --git a/vendor/vendor.json b/vendor/vendor.json index e688052..a72d258 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -15,12 +15,12 @@ "revisionTime": "2016-09-08T22:39:53Z" }, { - "checksumSHA1": "FUhczVSvt/VQAlWfzATo1YLez2E=", - "path": "github.com/Financial-Times/go-fthealth/v1a", - "revision": "f9074331b3ab48bca0e6d0afc211a673d88ac925", - "revisionTime": "2016-06-16T09:04:59Z", - "version": "0.1.0", - "versionExact": "0.1.0" + "checksumSHA1": "G8lW8pPVLieqh/MTJZkvI/i/WyM=", + "path": "github.com/Financial-Times/go-fthealth/v1_1", + "revision": "1b007e2b37b7936dfb6671fa17e5a29fd35a08ea", + "revisionTime": "2017-12-04T12:48:31Z", + "version": "0.4.0", + "versionExact": "0.4.0" }, { "checksumSHA1": "9Ob5JNGzi/pGXYMuHclig69IHPk=",