-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Darkfella91
committed
Oct 17, 2024
1 parent
dd03449
commit 4b190ca
Showing
8 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
kubernetes/main/apps/database/cloudnative-pg/cluster/cluster17.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/postgresql.cnpg.io/cluster_v1.json | ||
apiVersion: postgresql.cnpg.io/v1 | ||
kind: Cluster | ||
metadata: | ||
name: postgres17 | ||
spec: | ||
instances: 3 | ||
imageName: ghcr.io/cloudnative-pg/postgresql:17.0 | ||
primaryUpdateStrategy: unsupervised | ||
storage: | ||
pvcTemplate: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 20Gi | ||
resizeInUseVolumes: true | ||
walStorage: | ||
pvcTemplate: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 20Gi | ||
superuserSecret: | ||
name: &secret cloudnative-pg-secret | ||
enableSuperuserAccess: true | ||
postgresql: | ||
parameters: | ||
max_connections: "400" | ||
shared_buffers: 256MB | ||
nodeMaintenanceWindow: | ||
inProgress: false | ||
reusePVC: true | ||
resources: | ||
requests: | ||
cpu: 500m | ||
limits: | ||
memory: 4Gi | ||
monitoring: | ||
enablePodMonitor: true | ||
backup: | ||
retentionPolicy: 30d | ||
barmanObjectStore: &barmanObjectStore | ||
data: | ||
compression: bzip2 | ||
encryption: AES256 | ||
wal: | ||
compression: bzip2 | ||
encryption: AES256 | ||
maxParallel: 8 | ||
destinationPath: s3://backups/cloudnative-pg/ | ||
endpointURL: ${S3URL} | ||
# Note: serverName version needs to be inclemented | ||
# when recovering from an existing cnpg cluster | ||
serverName: ¤tCluster postgres17-v1 | ||
s3Credentials: | ||
accessKeyId: | ||
name: *secret | ||
key: CF_ACCESS_KEY_ID | ||
secretAccessKey: | ||
name: *secret | ||
key: CF_SECRET_ACCESS_KEY | ||
# Note: previousCluster needs to be set to the name of the previous | ||
# cluster when recovering from an existing cnpg cluster | ||
#bootstrap: | ||
#recovery: | ||
#source: &previousCluster postgres17-v1 | ||
# Note: externalClusters is needed when recovering from an existing cnpg cluster | ||
externalClusters: | ||
- name: *previousCluster | ||
barmanObjectStore: | ||
<<: *barmanObjectStore | ||
serverName: *previousCluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ resources: | |
- ./scheduledbackup.yaml | ||
- ./prometheusrule.yaml | ||
- ./gatus-cluster.yaml | ||
- ./cluster17.yaml |
32 changes: 32 additions & 0 deletions
32
kubernetes/main/apps/media/autobrr/app/externalsecret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json | ||
apiVersion: external-secrets.io/v1beta1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: &secret autobrr-secret | ||
spec: | ||
secretStoreRef: | ||
kind: ClusterSecretStore | ||
name: vault-backend | ||
target: | ||
name: *secret | ||
template: | ||
engineVersion: v2 | ||
data: | ||
AUTOBRR__DATABASE_TYPE: postgres | ||
AUTOBRR__POSTGRES_DATABASE: &dbName autobrr | ||
AUTOBRR__POSTGRES_HOST: &dbHost postgres17-rw.database.svc.cluster.local | ||
AUTOBRR__POSTGRES_USER: &dbUser "{{ .AUTOBRR_POSTGRES_USER }}" | ||
AUTOBRR__POSTGRES_PASS: &dbPass "{{ .AUTOBRR_POSTGRES_PASS }}" | ||
AUTOBRR__POSTGRES_PORT: "5432" | ||
AUTOBRR__SESSION_SECRET: "{{ .AUTOBRR_SESSION_SECRET }}" | ||
INIT_POSTGRES_DBNAME: *dbName | ||
INIT_POSTGRES_HOST: *dbHost | ||
INIT_POSTGRES_USER: *dbUser | ||
INIT_POSTGRES_PASS: *dbPass | ||
INIT_POSTGRES_SUPER_PASS: "{{ .POSTGRES_SUPER_PASS }}" | ||
dataFrom: | ||
- extract: | ||
key: secrets/autobrr | ||
- extract: | ||
key: secrets/cloudnative-pg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: autobrr | ||
spec: | ||
interval: 30m | ||
chart: | ||
spec: | ||
chart: app-template | ||
version: 3.4.0 | ||
sourceRef: | ||
kind: HelmRepository | ||
name: bjw-s | ||
namespace: flux-system | ||
install: | ||
remediation: | ||
retries: 3 | ||
upgrade: | ||
cleanupOnFail: true | ||
remediation: | ||
strategy: rollback | ||
retries: 3 | ||
values: | ||
controllers: | ||
autobrr: | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
initContainers: | ||
init-db: | ||
image: | ||
repository: ghcr.io/onedr0p/postgres-init | ||
tag: 16 | ||
envFrom: &envFrom | ||
- secretRef: | ||
name: autobrr-secret | ||
containers: | ||
app: | ||
image: | ||
repository: ghcr.io/autobrr/autobrr | ||
tag: v1.46.1@sha256:4d8dd05ada84e6626eaaf0e60919ebaf5b1b9ffa2f0bf424616ed07bc5a83a72 | ||
env: | ||
AUTOBRR__CHECK_FOR_UPDATES: "false" | ||
AUTOBRR__HOST: 0.0.0.0 | ||
AUTOBRR__PORT: &port 80 | ||
AUTOBRR__LOG_LEVEL: INFO | ||
envFrom: *envFrom | ||
probes: | ||
liveness: &probes | ||
enabled: true | ||
custom: true | ||
spec: | ||
httpGet: | ||
path: /api/healthz/liveness | ||
port: *port | ||
initialDelaySeconds: 0 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
failureThreshold: 3 | ||
readiness: *probes | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
capabilities: { drop: ["ALL"] } | ||
resources: | ||
requests: | ||
cpu: 10m | ||
limits: | ||
memory: 256Mi | ||
defaultPodOptions: | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 65534 | ||
runAsGroup: 65534 | ||
seccompProfile: { type: RuntimeDefault } | ||
service: | ||
app: | ||
controller: autobrr | ||
ports: | ||
http: | ||
port: *port | ||
ingress: | ||
app: | ||
annotations: | ||
external-dns.alpha.kubernetes.io/target: internal.${PUBLIC_DOMAIN} | ||
className: internal | ||
hosts: | ||
- host: "{{ .Release.Name }}.${PUBLIC_DOMAIN}" | ||
paths: | ||
- path: / | ||
service: | ||
identifier: app | ||
port: http | ||
persistence: | ||
tmp: | ||
type: emptyDir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./externalsecret.yaml | ||
- ./helmrelease.yaml | ||
- ../../../../templates/gatus/guarded | ||
configMapGenerator: | ||
- name: autobrr-loki-rules | ||
files: | ||
- autobrr.yaml=./resources/lokirule.yaml | ||
options: | ||
labels: | ||
loki_rule: "true" | ||
generatorOptions: | ||
disableNameSuffixHash: true |
14 changes: 14 additions & 0 deletions
14
kubernetes/main/apps/media/autobrr/app/resources/lokirule.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
groups: | ||
- name: autobrr | ||
rules: | ||
- alert: AutobrrNetworkUnhealthy | ||
expr: | | ||
sum by (app) (count_over_time({app="autobrr"} |~ "(?i)network unhealthy"[2m])) > 0 | ||
for: 2m | ||
labels: | ||
severity: critical | ||
category: logs | ||
annotations: | ||
app: "{{ $labels.app }}" | ||
summary: "{{ $labels.app }} has a unhealthy network" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app autobrr | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: media | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
dependsOn: | ||
- name: cloudnative-pg-cluster | ||
- name: external-secrets-stores | ||
path: ./kubernetes/main/apps/media/autobrr/app | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-kubernetes | ||
wait: false | ||
interval: 30m | ||
retryInterval: 1m | ||
timeout: 5m | ||
postBuild: | ||
substitute: | ||
APP: *app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ resources: | |
- ./cross-seed/ks.yaml | ||
- ./theme-park/ks.yaml | ||
- ./unpackerr/ks.yaml | ||
- ./autobrr/ks.yaml |