Completely remove mastodon

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2022-11-16 12:42:56 +00:00
parent 244dea83ec
commit e4027ec94f
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78
7 changed files with 0 additions and 636 deletions

View File

@ -1,28 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mastodon
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: cluster.fun
destination:
namespace: mastodon
name: cluster-fun (scaleway)
source:
path: manifests/mastodon
repoURL: "https://git.cluster.fun/AverageMarcus/cluster.fun.git"
targetRevision: HEAD
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
ignoreDifferences:
- kind: Secret
jsonPointers:
- /data
- group: apps
kind: Deployment
jqPathExpressions:
- .spec.template.spec.containers[]?.image

View File

@ -1,33 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: mastodon
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: mastodon
annotations:
kube-1password: wjhd3mxtyqslcu7sc4tfihm2dy
kube-1password/vault: Kubernetes
kube-1password/secret-text-parse: "true"
type: Opaque
---
apiVersion: v1
kind: ConfigMap
metadata:
name: mastodon-env
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: mastodon
data:
DEFAULT_LOCALE: en
LOCAL_DOMAIN: k8s.social
MALLOC_ARENA_MAX: "2"
NODE_ENV: "production"
RAILS_ENV: "production"
STREAMING_CLUSTER_NUM: "2"
WEB_CONCURRENCY: "2"
---

View File

@ -1,73 +0,0 @@
# apiVersion: autoscaling/v2beta2
# kind: HorizontalPodAutoscaler
# metadata:
# name: mastodon-web
# namespace: mastodon
# labels:
# app.kubernetes.io/name: mastodon
# app.kubernetes.io/instance: "k8s.social"
# app.kubernetes.io/component: web
# spec:
# scaleTargetRef:
# apiVersion: apps/v1
# kind: Deployment
# name: mastodon-web
# minReplicas: 2
# maxReplicas: 6
# metrics:
# - type: Resource
# resource:
# name: cpu
# target:
# averageUtilization: 80
# type: Utilization
# ---
# apiVersion: autoscaling/v2beta2
# kind: HorizontalPodAutoscaler
# metadata:
# name: mastodon-sidekiq
# namespace: mastodon
# labels:
# app.kubernetes.io/name: mastodon
# app.kubernetes.io/instance: "k8s.social"
# app.kubernetes.io/component: sidekiq
# spec:
# scaleTargetRef:
# apiVersion: apps/v1
# kind: Deployment
# name: mastodon-sidekiq
# minReplicas: 2
# maxReplicas: 6
# metrics:
# - type: Resource
# resource:
# name: cpu
# target:
# averageUtilization: 80
# type: Utilization
# ---
# apiVersion: autoscaling/v2beta2
# kind: HorizontalPodAutoscaler
# metadata:
# name: mastodon-streaming
# namespace: mastodon
# labels:
# app.kubernetes.io/name: mastodon
# app.kubernetes.io/instance: "k8s.social"
# app.kubernetes.io/component: streaming
# spec:
# scaleTargetRef:
# apiVersion: apps/v1
# kind: Deployment
# name: mastodon-streaming
# minReplicas: 2
# maxReplicas: 6
# metrics:
# - type: Resource
# resource:
# name: cpu
# target:
# averageUtilization: 80
# type: Utilization
# ---

View File

@ -1,38 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mastodon
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
annotations:
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: 40m
spec:
tls:
- hosts:
- "k8s.social"
- "streaming.k8s.social"
secretName: mastodon-tls
rules:
- host: "k8s.social"
http:
paths:
- path: /
backend:
service:
name: mastodon-web
port:
number: 3000
pathType: ImplementationSpecific
- path: /api/v1/streaming
backend:
service:
name: mastodon-streaming
port:
number: 4000
pathType: ImplementationSpecific
---

View File

@ -1,294 +0,0 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mastodon
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
---
apiVersion: v1
kind: Service
metadata:
name: mastodon-streaming
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: streaming
spec:
type: ClusterIP
ports:
- port: 4000
targetPort: streaming
protocol: TCP
name: streaming
selector:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: streaming
---
apiVersion: v1
kind: Service
metadata:
name: mastodon-web
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: web
spec:
type: ClusterIP
ports:
- port: 3000
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: web
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mastodon-sidekiq
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: sidekiq
annotations:
configmap.reloader.stakater.com/reload: "mastodon-env"
secret.reloader.stakater.com/reload: "mastodon"
spec:
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: sidekiq
template:
metadata:
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: sidekiq
spec:
serviceAccountName: mastodon
securityContext:
fsGroup: 991
runAsGroup: 991
runAsUser: 991
containers:
- name: mastodon
image: "tootsuite/mastodon:v3.5.3"
imagePullPolicy: IfNotPresent
command:
- bundle
- exec
- sidekiq
- -c
- "25"
envFrom:
- configMapRef:
name: mastodon-env
- secretRef:
name: mastodon
resources:
requests:
memory: 400Mi
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "app.kubernetes.io/name"
operator: In
values:
- mastodon
- key: "app.kubernetes.io/instance"
operator: In
values:
- "k8s.social"
- key: "app.kubernetes.io/component"
operator: In
values:
- sidekiq
topologyKey: kubernetes.io/hostname
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mastodon-streaming
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: streaming
annotations:
configmap.reloader.stakater.com/reload: "mastodon-env"
secret.reloader.stakater.com/reload: "mastodon"
spec:
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: streaming
template:
metadata:
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: streaming
spec:
serviceAccountName: mastodon
securityContext:
fsGroup: 991
runAsGroup: 991
runAsUser: 991
containers:
- name: mastodon
image: "tootsuite/mastodon:v3.5.3"
imagePullPolicy: IfNotPresent
command:
- node
- ./streaming
envFrom:
- configMapRef:
name: mastodon-env
- secretRef:
name: mastodon
env:
- name: "PORT"
value: "4000"
ports:
- name: streaming
containerPort: 4000
protocol: TCP
livenessProbe:
httpGet:
path: /api/v1/streaming/health
port: streaming
readinessProbe:
httpGet:
path: /api/v1/streaming/health
port: streaming
resources:
requests:
memory: 200Mi
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "app.kubernetes.io/name"
operator: In
values:
- mastodon
- key: "app.kubernetes.io/instance"
operator: In
values:
- "k8s.social"
- key: "app.kubernetes.io/component"
operator: In
values:
- streaming
topologyKey: kubernetes.io/hostname
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mastodon-web
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: web
annotations:
configmap.reloader.stakater.com/reload: "mastodon-env"
secret.reloader.stakater.com/reload: "mastodon"
spec:
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: web
template:
metadata:
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: web
spec:
serviceAccountName: mastodon
securityContext:
fsGroup: 991
runAsGroup: 991
runAsUser: 991
containers:
- name: mastodon
image: "tootsuite/mastodon:v3.5.3"
imagePullPolicy: IfNotPresent
command:
- bundle
- exec
- puma
- -C
- config/puma.rb
envFrom:
- configMapRef:
name: mastodon-env
- secretRef:
name: mastodon
env:
- name: "PORT"
value: "3000"
ports:
- name: http
containerPort: 3000
protocol: TCP
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 30
periodSeconds: 10
resources:
requests:
memory: 700Mi
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "app.kubernetes.io/name"
operator: In
values:
- mastodon
- key: "app.kubernetes.io/instance"
operator: In
values:
- "k8s.social"
- key: "app.kubernetes.io/component"
operator: In
values:
- web
topologyKey: kubernetes.io/hostname
---

View File

@ -1,41 +0,0 @@
# apiVersion: policy/v1
# kind: PodDisruptionBudget
# metadata:
# name: mastodon-web
# spec:
# minAvailable: 1
# selector:
# matchLabels:
# app.kubernetes.io/name: mastodon
# app.kubernetes.io/instance: "k8s.social"
# app.kubernetes.io/component: web
# ---
# apiVersion: policy/v1
# kind: PodDisruptionBudget
# metadata:
# name: mastodon-streaming
# spec:
# minAvailable: 1
# selector:
# matchLabels:
# app.kubernetes.io/name: mastodon
# app.kubernetes.io/instance: "k8s.social"
# app.kubernetes.io/component: streaming
# ---
# apiVersion: policy/v1
# kind: PodDisruptionBudget
# metadata:
# name: mastodon-sidekiq
# spec:
# minAvailable: 1
# selector:
# matchLabels:
# app.kubernetes.io/name: mastodon
# app.kubernetes.io/instance: "k8s.social"
# app.kubernetes.io/component: sidekiq
# ---

View File

@ -1,129 +0,0 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: mastodon-media-remove
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: utils
annotations:
description: |
Runs weekly to remove old media
spec:
schedule: 0 0 * * 0
jobTemplate:
spec:
backoffLimit: 3
ttlSecondsAfterFinished: 86400
template:
metadata:
name: mastodon-media-remove
spec:
restartPolicy: OnFailure
containers:
- name: mastodon-media-remove
image: "tootsuite/mastodon:v3.5.3"
imagePullPolicy: IfNotPresent
command:
- bash
- -c
- |
bin/tootctl media remove
bin/tootctl preview_cards remove
envFrom:
- configMapRef:
name: mastodon-env
- secretRef:
name: mastodon
env:
- name: "PORT"
value: "3000"
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: mastodon-assets-precompile
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: utils
annotations:
description: |
Manually trigger post-install to pre-compile the assets
spec:
schedule: 0 0 * * 0
suspend: true
jobTemplate:
spec:
backoffLimit: 3
ttlSecondsAfterFinished: 86400
template:
metadata:
name: mastodon-assets-precompile
spec:
restartPolicy: OnFailure
containers:
- name: mastodon-assets-precompile
image: "tootsuite/mastodon:v3.5.3"
imagePullPolicy: IfNotPresent
command:
- bash
- -c
- |
bundle exec rake assets:precompile && yarn cache clean
envFrom:
- configMapRef:
name: mastodon-env
- secretRef:
name: mastodon
env:
- name: "PORT"
value: "3000"
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: mastodon-db-migrate
namespace: mastodon
labels:
app.kubernetes.io/name: mastodon
app.kubernetes.io/instance: "k8s.social"
app.kubernetes.io/component: utils
annotations:
description: |
Manually trigger post-install/upgrade to migrate the database schema
spec:
schedule: 0 0 * * 0
suspend: true
jobTemplate:
spec:
backoffLimit: 3
ttlSecondsAfterFinished: 86400
template:
metadata:
name: mastodon-db-migrate
spec:
restartPolicy: OnFailure
containers:
- name: mastodon-db-migrate
image: "tootsuite/mastodon:v3.5.3"
imagePullPolicy: IfNotPresent
command:
- bundle
- exec
- rake
- db:migrate
envFrom:
- configMapRef:
name: mastodon-env
- secretRef:
name: mastodon
env:
- name: "PORT"
value: "3000"
---