Skip to content

Commit

Permalink
fixup! fixup! enhancement: add livez endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rexagod committed Jun 14, 2024
1 parent 6dfc78e commit a608b6b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ Note that your GCP identity is case sensitive but `gcloud info` as of Google Clo

After running the above, if you see `Clusterrolebinding "cluster-admin-binding" created`, then you are able to continue with the setup of this service.

#### Probes

The following probes are available, and follow the [Kubernetes best practices](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes):

* `livenessProbe`: Checks if the application is not affected by an outage, and is able to access the Kube API by querying the cluster's `/livez` endpoint.
* `readinessProbe`: Checks if the application is ready to serve metrics by querying its own telemetry metrics.

#### Limited privileges environment

If you want to run kube-state-metrics in an environment where you don't have cluster-reader role, you can:
Expand Down
7 changes: 7 additions & 0 deletions README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,13 @@ Note that your GCP identity is case sensitive but `gcloud info` as of Google Clo

After running the above, if you see `Clusterrolebinding "cluster-admin-binding" created`, then you are able to continue with the setup of this service.

#### Probes

The following probes are available, and follow the [Kubernetes best practices](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes):

* `livenessProbe`: Checks if the application is not affected by an outage, and is able to access the Kube API by querying the cluster's `/livez` endpoint.
* `readinessProbe`: Checks if the application is ready to serve metrics by querying its own telemetry metrics.

#### Limited privileges environment

If you want to run kube-state-metrics in an environment where you don't have cluster-reader role, you can:
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.12.0
livenessProbe:
httpGet:
path: /healthz
path: /livez
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.12.0
livenessProbe:
httpGet:
path: /healthz
path: /livez
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/deployment-no-node-pods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.12.0
livenessProbe:
httpGet:
path: /healthz
path: /livez
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.12.0
livenessProbe:
httpGet:
path: /healthz
path: /livez
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
Expand Down
2 changes: 1 addition & 1 deletion examples/standard/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.12.0
livenessProbe:
httpGet:
path: /healthz
path: /livez
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 5
Expand Down
2 changes: 1 addition & 1 deletion jsonnet/kube-state-metrics/kube-state-metrics.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
},
livenessProbe: { timeoutSeconds: 5, initialDelaySeconds: 5, httpGet: {
port: 8080,
path: '/healthz',
path: '/livez',
} },
readinessProbe: { timeoutSeconds: 5, initialDelaySeconds: 5, httpGet: {
port: 8081,
Expand Down

0 comments on commit a608b6b

Please sign in to comment.