I have a job which is running redis pod.:
apiVersion: batch/v1
kind: Job
metadata:
name: redis-job
spec:
parallelism: 1
ttlSecondsAfterFinished: 10
template:
metadata:
name: redis-job
spec:
containers:
- name: master
image: redis
command:
- redis-server
env:
- name: MASTER
value: "true"
ports:
- containerPort: 6379
restartPolicy: Never
What I need in this setup is that when pod starts up it loads a list from file which is stored on GitLab.
The redis pod must stay alive until list is empty and I think I solved this with "ttl". I have another job which will consume this list.