This exercise creates a pod on the Kubernetes cluster which logs the timestamp. With kubectl the logs can be viewed.
cd /Workshop-K8S/k8s/logging/
cat counter-pod.yaml
The output is:
apiVersion: v1
kind: Pod
metadata:
name: counter
spec:
containers:
- name: count
image: busybox
args:
[
/bin/sh,
-c,
'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 1; done',
]
kubectl apply -f counter-pod.yaml
pod/counter created
kubectl logs counter -f