this post was submitted on 21 Jun 2023
22 points (100.0% liked)

Chat

7499 readers
6 users here now

Relaxed section for discussion and debate that doesn't fit anywhere else. Whether it's advice, how your week is going, a link that's at the back of your mind, or something like that, it can likely go here.


Subcommunities on Beehaw:


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
 

(Just- migrated this instance over to kubernetes.... just testing federation...)

top 22 comments
sorted by: hot top controversial new old
[–] [email protected] 10 points 1 year ago* (last edited 1 year ago) (1 children)

You did a Kubernete! Congrats!

Edit to add: one Kubernetes instance talking to another!

[–] [email protected] 7 points 1 year ago* (last edited 1 year ago) (1 children)

NOT only did I do it in kubernetes, But- I built all of the manifests by hand.

AND- I am not using that crappy nginx proxy. I created the manifests to use my default traefik proxy's ingressroute.

Edit- and thanks for the reply!

[–] [email protected] 10 points 1 year ago (1 children)

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

[–] [email protected] 11 points 1 year ago* (last edited 1 year ago) (1 children)

Oh sweet, here, I will share my lovely ingressroute in return... to replace the nginx stuff everyone else is using.

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: lemmy
  namespace: lemmy
spec:
  entryPoints:
    - websecure
  routes:
    - kind: Rule
      match: Host(`lemmyonline.com`) && (Headers(`Accept`, `application/activity+json`) || Headers(`Accept`, `application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"`))
      services:
        - name: lemmy
          port: http
    - kind: Rule
      match: Host(`lemmyonline.com`) && (PathPrefix(`/api`) || PathPrefix(`/pictrs`) || PathPrefix(`/feeds`) || PathPrefix(`/nodeinfo`) || PathPrefix(`/.well-known`))
      services:
        - name: lemmy
          port: http
    - kind: Rule
      match: Host(`lemmyonline.com`) && Method(`POST`)
      services:
        - name: lemmy
          port: http
    - kind: Rule
      match: Host(`lemmyonline.com`)
      services:
        - name: lemmy-ui
          port: http

Thanks!

Edit- could be consolidated down to only two rules, I left it expanded out to be a tad easier to read.

[–] [email protected] 8 points 1 year ago (1 children)

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";
            }

[–] [email protected] 6 points 1 year ago (1 children)

NORMALLY, this is the part where we would gold each other. Or something.

Sadly- I guess we can't do that.

But, if anyone knows a decent amount on building helm charts- I found a gitlab earlier which was pretty close to where it needs to be-

I forked a copy of it over to github to prepare to make a few changes, such as using PROPER ingress rules.

https://github.com/XtremeOwnageDotCom/Helm

I do believe it's possible to build a helm chart with options for both traefik ingress and nginx ingress too.

[–] [email protected] 4 points 1 year ago (1 children)

The real gold was the friends we made along the way.

[–] [email protected] 4 points 1 year ago (1 children)

And- the mountains we all moved together.

(Oh, and don't forget those rare times where most of reddit bonded together, and accomplished big things. )

[–] [email protected] 4 points 1 year ago (1 children)

You’re in OK?! I just moved from OK to CO last summer. Hope your family and lab gear are doing okay after the storms.

[–] [email protected] 4 points 1 year ago

I am!

Lab survived with basically no downtime. Trees all gone, and my soffit blew away.

3 days running on solar/generator.

Otherwise no real damage, and everyone was ok.

[–] [email protected] 6 points 1 year ago (1 children)

Can we please make this the top post in the fediverse?

[–] [email protected] 3 points 1 year ago (1 children)

I didn't think it was that cool, if you want a more interesting story-

Check this one out: https://lemmyonline.com/post/3751

[–] [email protected] 1 points 1 year ago (1 children)
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

I am working on exporting this video with sound....

https://www.youtube.com/watch?v=JqqDlPlWRA0

But, here in a few days, I am going to have a interesting write-up over on https://static.xtremeownage.com/blog sharing the story too.

Edit- note, those glitches are youtube, and not my camera. The camera was 100% stable the entire time. I need to export/transcode to H264 and reupload.

[–] [email protected] 2 points 1 year ago

That’s so crazy, dude.

But still…this post to the top! 👆

[–] [email protected] 3 points 1 year ago (2 children)
[–] [email protected] 3 points 1 year ago (1 children)

Hi from the west coast best coast!

[–] [email protected] 2 points 1 year ago
[–] [email protected] 1 points 1 year ago

Hey back from the midwest too!

[–] [email protected] 2 points 1 year ago

What going on, eh?

[–] [email protected] 2 points 1 year ago

Test test :)

[–] [email protected] 1 points 1 year ago

Welp. I can see it here: https://beehaw.org/post/669935

So, that is a good sign.

load more comments
view more: next ›