rs5th
rs5th@lemmy.scottlabs.io
Joined
2 posts • 108 comments
DevOps dude, self-hoster, space nerd.
On one hand, this is super cool, but on the other, it gives orcas and robots the chance to team up, and I’m not here for that.
4 points
4 points
8 points
If anyone else has made it this far and are thinking “ah balls, I’m using ingress-nginx”, here’s the ingress annotation for you!
nginx.ingress.kubernetes.io/configuration-snippet: |
if ($http_accept = "application/activity+json") {
set $proxy_upstream_name "lemmy-lemmy-8536";
}
if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
set $proxy_upstream_name "lemmy-lemmy-8536";
}
if ($request_method = POST) {
set $proxy_upstream_name "lemmy-lemmy-8536";
}
10 points
Here’s a cronjob to clean up the useless activity table every day:
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgresql-cleanup
namespace: lemmy
spec:
schedule: "0 0 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: postgres-cleanup
image: postgres:alpine
command: ["psql", "--host=postgresql", "--dbname=postgres", "--username=postgres", "--command=DELETE FROM activity WHERE published < NOW() - INTERVAL '1 day';"]
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql
key: postgres-password
backoffLimit: 0
ttlSecondsAfterFinished: 3600
You did a Kubernete! Congrats!
Edit to add: one Kubernetes instance talking to another!
It uses Elon Musk’s Starlink satellite technology to communicate, though it is unclear if it was the cause of the loss of contact.
Surely this is the surface vessel and not the sub. Starlink communications are around 11 GHz, which can only propagate a couple meters in salt water.