Kubernetes Time Check Pod Setup Guide

Set Up Time Check Pod in Kubernetes
How to Efficiently Set Up a Time Check Pod in Kubernetes
Tasks
- Create a pod called - time-checkin the- devopsnamespace. The pod should have a container named- time-check, using the- busyboximage with the- latesttag (- busybox:latest).
- Create a config map named - time-configwith the data- TIME_FREQ=12in the same namespace.
- Configure the - time-checkcontainer to run the command:- while true; do date; sleep $TIME_FREQ; done. Ensure the output is written to- /opt/sysops/time/time-check.log. Add an environment variable- TIME_FREQin the container, getting its value from the config map- TIME_FREQkey.
- Create a volume - log-volumeand mount it at- /opt/sysops/timewithin the container.
Steps
- Create a manifest file - time-check.yaml.- apiVersion: v1 kind: Namespace metadata: name: devops --- apiVersion: v1 kind: ConfigMap metadata: name: time-config namespace: devops data: TIME_FREQ: "12" --- apiVersion: v1 kind: Pod metadata: name: time-check namespace: devops spec: containers: - name: time-check image: busybox:latest command: ["sh", "-c", "while true; do date >> /opt/sysops/time/time-check.log; sleep $TIME_FREQ; done"] env: - name: TIME_FREQ valueFrom: configMapKeyRef: name: time-config key: TIME_FREQ volumeMounts: - name: log-volume mountPath: /opt/sysops/time volumes: - name: log-volume emptyDir: {}- cat << EOF > time-check.yaml apiVersion: v1 kind: Namespace metadata: name: devops --- apiVersion: v1 kind: ConfigMap metadata: name: time-config namespace: devops data: TIME_FREQ: "12" --- apiVersion: v1 kind: Pod metadata: name: time-check namespace: devops spec: containers: - name: time-check image: busybox:latest command: ["sh", "-c", "while true; do date >> /opt/sysops/time/time-check.log; sleep \$TIME_FREQ; done"] env: - name: TIME_FREQ valueFrom: configMapKeyRef: name: time-config key: TIME_FREQ volumeMounts: - name: log-volume mountPath: /opt/sysops/time volumes: - name: log-volume emptyDir: {} EOF
 - Now apply - kubectl apply -f time-check.yaml 
- ss