Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix k8s example #180

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 55 additions & 44 deletions examples/k8s-cronjob.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ kubectl create secret generic fedifetcher \
--from-literal=token="<token>"
```

Define a PVC, for example:

```yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: fedifetcher-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
```

Now define the cronjob, and don't forget to define your PVCs:

```yaml
Expand All @@ -20,52 +35,48 @@ kind: CronJob
metadata:
name: fedifetcher
spec:
schedule: "*/15 * * * *"
failedJobsHistoryLimit: 5
successfulJobsHistoryLimit: 5
concurrencyPolicy: Forbid
schedule: "*/15 * * * *" # Run every 15 minutes
failedJobsHistoryLimit: 5 # Keep history of failed jobs
successfulJobsHistoryLimit: 5 # Keep history of successful jobs
concurrencyPolicy: Forbid # Do not allow concurrent jobs
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
containers:
- name: fedifetcher
image: ghcr.io/nanos/fedifetcher:latest
imagePullPolicy: IfNotPresent
env:
- name: FF_HOME_TIMELINE_LENGTH
value: "200"
- name: FF_MAX_FOLLOWERS
value: "10"

# Add any other options below as described in in the README.md file

# If you don't want to use a PVC you may comment the next two lines, but that will significantly
# affect performance, and is NOT recommended
- name: FF_STATE_DIR
value: "/data/"
- name: FF_SERVER
valueFrom:
secretKeyRef:
name: fedifetcher
key: server_domain
optional: false
- name: FF_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: fedifetcher
key: token
optional: false
# Comment the lines below if you do not use a PVC, but that will significantly
# affect performance and is NOT recommended
volumeMounts:
- mountPath: /data
template:
spec:
restartPolicy: Never
containers:
- name: fedifetcher
image: ghcr.io/nanos/fedifetcher:latest
imagePullPolicy: IfNotPresent
env:
- name: FF_HOME_TIMELINE_LENGTH
value: "200"
- name: FF_MAX_FOLLOWERS
value: "10"
# Add any other options below as described in in the README.md file

# If you don't want to use a PVC you may comment the next two lines, but that will significantly
# affect performance, and is NOT recommended
- name: FF_STATE_DIR
value: "/data/"
- name: FF_SERVER
valueFrom:
secretKeyRef:
name: fedifetcher
key: server_domain
itspluxstahre marked this conversation as resolved.
Show resolved Hide resolved
- name: FF_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: fedifetcher
readOnly: false
itspluxstahre marked this conversation as resolved.
Show resolved Hide resolved
volumes:
- name: fedifetcher
persistentVolumeClaim:
claimName: fedifetcher
key: token
# Comment the lines below if you do not use a PVC, but that will significantly
# affect performance and is NOT recommended
volumeMounts:
- name: fedifetcher-storage
mountPath: /data
volumes:
- name: fedifetcher-storage
persistentVolumeClaim:
claimName: fedifetcher-pvc
```