Skip to content

Commit

Permalink
feat(libreddit): migrate to redlib
Browse files Browse the repository at this point in the history
due to JSON HTTP2 changes found only in Redlib
  • Loading branch information
JJGadgets committed Nov 2, 2024
1 parent 9a20aac commit 4f6e508
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 121 deletions.
2 changes: 1 addition & 1 deletion kube/clusters/biohazard/flux/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ resources:
- ../../../deploy/apps/miniflux/
- ../../../deploy/apps/elk/
- ../../../deploy/apps/firefly/
- ../../../deploy/apps/libreddit/
- ../../../deploy/apps/redlib/
#- ../../../deploy/apps/livestream/
#- ../../../deploy/apps/livestream/oven
- ../../../deploy/apps/soft-serve/
Expand Down
75 changes: 0 additions & 75 deletions kube/deploy/apps/libreddit/app/hr.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions kube/deploy/apps/libreddit/app/netpol.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions kube/deploy/apps/libreddit/ks.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions kube/deploy/apps/libreddit/ns.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions kube/deploy/apps/redlib/app/es.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# yaml-language-server: $schema=https://crds.jank.ing/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: &name redlib-secrets
namespace: redlib
spec:
refreshInterval: 1m
secretStoreRef:
kind: ClusterSecretStore
name: 1p
dataFrom:
- extract:
key: "redlib - ${CLUSTER_NAME}"
target:
creationPolicy: Owner
deletionPolicy: Retain
name: *name
# template:
# type: Opaque
# data:
# age.agekey: '{{ .agekey }}'
112 changes: 112 additions & 0 deletions kube/deploy/apps/redlib/app/hr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.4.0/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: &app redlib
namespace: *app
spec:
interval: 5m
chart:
spec:
chart: app-template
version: 3.4.0
sourceRef:
name: bjw-s
kind: HelmRepository
namespace: flux-system
values:
controllers:
redlib:
type: deployment
replicas: 1
strategy: RollingUpdate
pod:
labels:
ingress.home.arpa/nginx-internal: allow
egress.home.arpa/internet: allow
containers:
main:
image: &img
repository: quay.io/redlib/redlib
tag: latest@sha256:42db7afd24d3e55ceccb38f6e91ecfd44d78f381a04848bb4de67dae1836a3e4 # for JSON HTTP2 fix
env: &env
TZ: "${CONFIG_TZ}"
REDLIB_SFW_ONLY: "off"
REDLIB_BANNER: "JJGadgets"
REDLIB_ROBOTS_DISABLE_INDEXING: "on"
REDLIB_DEFAULT_THEME: "dracula"
REDLIB_DEFAULT_FRONT_PAGE: "default"
REDLIB_DEFAULT_LAYOUT: "card"
REDLIB_DEFAULT_WIDE: "on"
REDLIB_DEFAULT_POST_SORT: "hot"
REDLIB_DEFAULT_COMMENT_SORT: "confidence"
REDLIB_DEFAULT_SHOW_NSFW: "on"
REDLIB_DEFAULT_BLUR_NSFW: "on"
REDLIB_DEFAULT_AUTOPLAY_VIDEOS: "off"
REDLIB_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION: "false"
REDLIB_ENABLE_RSS: "on"
REDLIB_FULL_URL: "https://${APP_DNS_REDLIB}"
REDLIB_SUBSCRIPTIONS:
valueFrom:
secretKeyRef:
name: redlib-secrets
key: subscriptions
securityContext: &sc
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
resources:
requests:
cpu: "10m"
limits:
cpu: "1"
memory: "256Mi"
probes:
liveness:
enabled: true
readiness:
enabled: true
service:
redlib:
controller: redlib
ports:
http:
port: 8080
protocol: HTTP
appProtocol: http
ingress:
main:
className: nginx-internal
hosts:
- host: &host "${APP_DNS_REDLIB:=redlib}"
paths: &paths
- path: /
pathType: Prefix
service:
identifier: redlib
port: http
tls:
- hosts: [*host]
defaultPodOptions:
automountServiceAccountToken: false
enableServiceLinks: false
dnsConfig:
options:
- name: ndots
value: "1"
securityContext:
runAsNonRoot: true
runAsUser: &uid ${APP_UID_REDLIB:=1000}
runAsGroup: *uid
fsGroup: *uid
fsGroupChangePolicy: Always
seccompProfile: { type: "RuntimeDefault" }
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: fuckoff.home.arpa/redlib
operator: DoesNotExist
14 changes: 14 additions & 0 deletions kube/deploy/apps/redlib/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: redlib-app
namespace: flux-system
labels: &l
app.kubernetes.io/name: "redlib"
spec:
commonMetadata:
labels: *l
path: ./kube/deploy/apps/redlib/app
targetNamespace: "redlib"
dependsOn: []
File renamed without changes.
10 changes: 10 additions & 0 deletions kube/deploy/apps/redlib/ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: redlib
labels:
kustomize.toolkit.fluxcd.io/prune: disabled
pod-security.kubernetes.io/enforce: &ps restricted
pod-security.kubernetes.io/audit: *ps
pod-security.kubernetes.io/warn: *ps

0 comments on commit 4f6e508

Please sign in to comment.