Skip to content

Commit 1a37b28

Browse files
Bharath KaimalBharath Kaimal
authored andcommitted
update to kubernetes-pods-health
1 parent abd2e42 commit 1a37b28

File tree

1 file changed

+82
-65
lines changed
  • docs/openshift/pods/health-checks

1 file changed

+82
-65
lines changed

docs/openshift/pods/health-checks/index.md

Lines changed: 82 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
A Probe is a diagnostic performed periodically by the kubelet on a Container. To perform a diagnostic, the kubelet calls a Handler implemented by the Container. There are three types of handlers:
66

7-
***ExecAction***: Executes a specified command inside the Container. The diagnostic is considered successful if the command exits with a status code of 0.
7+
**_ExecAction_**: Executes a specified command inside the Container. The diagnostic is considered successful if the command exits with a status code of 0.
88

9-
***TCPSocketAction***: Performs a TCP check against the Container’s IP address on a specified port. The diagnostic is considered successful if the port is open.
9+
**_TCPSocketAction_**: Performs a TCP check against the Container’s IP address on a specified port. The diagnostic is considered successful if the port is open.
1010

11-
***HTTPGetAction***: Performs an HTTP Get request against the Container’s IP address on a specified port and path. The diagnostic is considered successful if the response has a status code greater than or equal to 200 and less than 400.
11+
**_HTTPGetAction_**: Performs an HTTP Get request against the Container’s IP address on a specified port and path. The diagnostic is considered successful if the response has a status code greater than or equal to 200 and less than 400.
1212

1313
The kubelet can optionally perform and react to three kinds of probes on running Containers:
1414

15-
***livenessProbe***: Indicates whether the Container is running. Runs for the lifetime of the Container.
15+
**_livenessProbe_**: Indicates whether the Container is running. Runs for the lifetime of the Container.
1616

17-
***readinessProbe***: Indicates whether the Container is ready to service requests. Only runs at start.
17+
**_readinessProbe_**: Indicates whether the Container is ready to service requests. Only runs at start.
1818

1919
### Resources
2020

@@ -39,12 +39,12 @@ metadata:
3939
name: my-pod
4040
spec:
4141
containers:
42-
- name: app
43-
image: busybox
44-
command: ['sh', '-c', "echo Hello, Kubernetes! && sleep 3600"]
45-
livenessProbe:
46-
exec:
47-
command: ['echo','alive']
42+
- name: app
43+
image: busybox
44+
command: ["sh", "-c", "echo Hello, Kubernetes! && sleep 3600"]
45+
livenessProbe:
46+
exec:
47+
command: ["echo", "alive"]
4848
```
4949
5050
```yaml
@@ -55,19 +55,19 @@ metadata:
5555
spec:
5656
shareProcessNamespace: true
5757
containers:
58-
- name: app
59-
image: bitnami/nginx
60-
ports:
61-
- containerPort: 8080
62-
livenessProbe:
63-
tcpSocket:
64-
port: 8080
65-
initialDelaySeconds: 10
66-
readinessProbe:
67-
httpGet:
68-
path: /
69-
port: 8080
70-
periodSeconds: 10
58+
- name: app
59+
image: bitnami/nginx
60+
ports:
61+
- containerPort: 8080
62+
livenessProbe:
63+
tcpSocket:
64+
port: 8080
65+
initialDelaySeconds: 10
66+
readinessProbe:
67+
httpGet:
68+
path: /
69+
port: 8080
70+
periodSeconds: 10
7171
```
7272
7373
## Container Logging
@@ -78,18 +78,19 @@ Kubernetes provides no native storage solution for log data, but you can integra
7878
7979
### Resources
8080
81-
**OpenShift**
81+
=== "OpenShift"
8282
83-
- [Logs Command](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/developer-cli-commands.html){:target="_blank"}
84-
- [Cluster Logging](https://docs.openshift.com/container-platform/4.13/logging/cluster-logging.html){:target="_blank"}
85-
- [Logging Collector](https://docs.openshift.com/container-platform/4.13/logging/config/cluster-logging-collector.html){:target="_blank"}
83+
[Logs Command :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/developer-cli-commands.html){:target="_blank"}
8684
87-
**IKS**
85+
[Cluster Logging :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/logging/cluster-logging.html){:target="_blank"}
8886
89-
- [Logging](https://kubernetes.io/docs/concepts/cluster-administration/logging/){:target="_blank"}
87+
[Logging Collector :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/logging/config/cluster-logging-collector.html){:target="_blank"}
9088
91-
### References
89+
=== "IBM Cloud Kubernetes Service"
9290
91+
[Logging](https://kubernetes.io/docs/concepts/cluster-administration/logging/){:target="_blank"}
92+
93+
### References
9394
9495
```yaml title="Pod Example"
9596
apiVersion: v1
@@ -98,9 +99,14 @@ metadata:
9899
name: counter
99100
spec:
100101
containers:
101-
- name: count
102-
image: busybox
103-
command: ['sh','-c','i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 5; done']
102+
- name: count
103+
image: busybox
104+
command:
105+
[
106+
"sh",
107+
"-c",
108+
'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 5; done',
109+
]
104110
```
105111

106112
=== "OpenShift"
@@ -133,14 +139,15 @@ Prometheus, a CNCF project, can natively monitor Kubernetes, nodes, and Promethe
133139

134140
### Resources
135141

136-
**OpenShift**
142+
=== "OpenShift"
143+
144+
[Monitoring Application Health :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/applications/application-health.html){:target="_blank"}
137145

138-
- [Monitoring Application Health](https://docs.openshift.com/container-platform/4.13/applications/application-health.html){:target="_blank"}
146+
=== "IBM Cloud Kubernetes Service"
139147

140-
**IKS**
148+
[Monitoring Resource Usage :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/){:target="_blank"}
141149

142-
- [Monitoring Resource Usage](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/){:target="_blank"}
143-
- [Resource Metrics](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/){:target="_blank"}
150+
[Resource Metrics :fontawesome-solid-globe:](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/){:target="_blank"}
144151

145152
### References
146153

@@ -151,15 +158,20 @@ metadata:
151158
name: 500m
152159
spec:
153160
containers:
154-
- name: app
155-
image: gcr.io/kubernetes-e2e-test-images/resource-consumer:1.4
156-
resources:
157-
requests:
158-
cpu: 700m
159-
memory: 128Mi
160-
- name: busybox-sidecar
161-
image: radial/busyboxplus:curl
162-
command: [/bin/sh, -c, 'until curl localhost:8080/ConsumeCPU -d "millicores=500&durationSec=3600"; do sleep 5; done && sleep 3700']
161+
- name: app
162+
image: gcr.io/kubernetes-e2e-test-images/resource-consumer:1.4
163+
resources:
164+
requests:
165+
cpu: 700m
166+
memory: 128Mi
167+
- name: busybox-sidecar
168+
image: radial/busyboxplus:curl
169+
command:
170+
[
171+
/bin/sh,
172+
-c,
173+
'until curl localhost:8080/ConsumeCPU -d "millicores=500&durationSec=3600"; do sleep 5; done && sleep 3700',
174+
]
163175
```
164176

165177
```yaml
@@ -169,22 +181,27 @@ metadata:
169181
name: 200m
170182
spec:
171183
containers:
172-
- name: app
173-
image: gcr.io/kubernetes-e2e-test-images/resource-consumer:1.4
174-
resources:
175-
requests:
176-
cpu: 300m
177-
memory: 64Mi
178-
- name: busybox-sidecar
179-
image: radial/busyboxplus:curl
180-
command: [/bin/sh, -c, 'until curl localhost:8080/ConsumeCPU -d "millicores=200&durationSec=3600"; do sleep 5; done && sleep 3700']
184+
- name: app
185+
image: gcr.io/kubernetes-e2e-test-images/resource-consumer:1.4
186+
resources:
187+
requests:
188+
cpu: 300m
189+
memory: 64Mi
190+
- name: busybox-sidecar
191+
image: radial/busyboxplus:curl
192+
command:
193+
[
194+
/bin/sh,
195+
-c,
196+
'until curl localhost:8080/ConsumeCPU -d "millicores=200&durationSec=3600"; do sleep 5; done && sleep 3700',
197+
]
181198
```
182199

183200
=== "OpenShift"
184-
```
185-
oc get projects
186-
oc api-resources -o wide
187-
oc api-resources -o name
201+
```
202+
oc get projects
203+
oc api-resources -o wide
204+
oc api-resources -o name
188205
189206
oc get nodes,ns,po,deploy,svc
190207
@@ -215,7 +232,7 @@ spec:
215232
216233
## Activities
217234
218-
| Task | Description | Link |
219-
| --------------------------------| ------------------ |:----------- |
220-
| ***Try It Yourself*** | | |
221-
| Probes | Create some Health & Startup Probes to find what's causing an issue. | [Probes](../../../labs/kubernetes/lab4/index.md) |
235+
| Task | Description | Link |
236+
| --------------------- | -------------------------------------------------------------------- | :----------------------------------------------- |
237+
| **_Try It Yourself_** | | |
238+
| Probes | Create some Health & Startup Probes to find what's causing an issue. | [Probes](../../../labs/kubernetes/lab4/index.md) |

0 commit comments

Comments
 (0)