handy_assistant/k8s_day12.md

28 lines
642 B
Markdown
Raw Normal View History

## Create a Daemonset as per the demo shown in the video
```yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx-ds
labels:
env: demo
spec:
template:
metadata:
labels:
env: demo
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
selector:
matchLabels:
env: demo
```
## Understand the cron syntax and create a cronjob object in kubernetes that prints "40daysofkubernetes" after every 5 minutes and use busybox image
```bash
kubectl create cronjob hello --image=busybox:1.28 --schedule="*/5 * * * *" -- echo "40daysofkubernetes"
```