Skip to content

Commit

Permalink
Merge 500a500 into backport/ashwin/use-proxy-health-check/instantly-n…
Browse files Browse the repository at this point in the history
…ovel-pup
  • Loading branch information
thisisnotashwin authored Jan 19, 2023
2 parents 41ca83a + 500a500 commit d35c91a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ IMPROVEMENTS:
* Helm:
* Add a `global.extraLabels` stanza to allow setting global Kubernetes labels for all components deployed by the `consul-k8s` Helm chart. [[GH-1778](https://github.com/hashicorp/consul-k8s/pull/1778)]
* Control-Plane
* Add support for the annotation `consul.hashicorp.com/use-proxy-health-check`. When this annotation is used by a service, it configures a readiness endpoint on Consul Dataplane and queries it instead of the application for its readiness. [[GH-1824](https://github.com/hashicorp/consul-k8s/pull/1824)], [[GH-1841](https://github.com/hashicorp/consul-k8s/pull/1824)]
* Add support for the annotation `consul.hashicorp.com/use-proxy-health-check`. When this annotation is used by a service, it configures a readiness endpoint on Consul Dataplane and queries it instead of the proxy's inbound port which forwards requests to the application. [[GH-1824](https://github.com/hashicorp/consul-k8s/pull/1824)], [[GH-1841](https://github.com/hashicorp/consul-k8s/pull/1824)]
* Add health check for synced services based on the status of the Kubernetes readiness probe on synced pod. [[GH-1821](https://github.com/hashicorp/consul-k8s/pull/1821)]

BUG FIXES:
Expand Down
10 changes: 7 additions & 3 deletions control-plane/connect-inject/webhook/consul_dataplane_sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,14 @@ func (w *MeshWebhook) sidecarResources(pod corev1.Pod) (corev1.ResourceRequireme
}

// useProxyHealthCheck returns true if the pod has the annotation 'consul.hashicorp.com/use-proxy-health-check'
// set to "true".
// set to truthy values.
func useProxyHealthCheck(pod corev1.Pod) bool {
if v, ok := pod.Annotations[constants.AnnotationUseProxyHealthCheck]; ok || v == "true" {
return true
if v, ok := pod.Annotations[constants.AnnotationUseProxyHealthCheck]; ok {
useProxyHealthCheck, err := strconv.ParseBool(v)
if err != nil {
return false
}
return useProxyHealthCheck
}
return false
}

0 comments on commit d35c91a

Please sign in to comment.