Compare commits

...

6 Commits

Author SHA1 Message Date
f04f777ec2 add cops 2024-03-14 23:58:52 -06:00
renovate[bot]
688d6498b0 Update homeassistant/home-assistant Docker tag to v2024.3.0 (#11)
* Update homeassistant/home-assistant Docker tag to v2024.3.0

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alex Lebens <alexanderlebens@gmail.com>
2024-03-14 17:11:41 -06:00
7d8c554354 change ingress and port name 2024-03-14 08:59:18 -06:00
b31dab5a46 inject db secrets into deployment 2024-03-14 08:52:39 -06:00
c485eb9682 change depcreciated env value 2024-03-14 08:51:37 -06:00
627f2ca6b6 enable configmap for s3 2024-03-14 08:46:52 -06:00
15 changed files with 311 additions and 21 deletions

12
charts/cops/Chart.yaml Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: v2
name: cops
version: 0.0.1
description: Chart for Calibre OPDS (and HTML) PHP Server
keywords:
- calibre
- OPDS
sources:
- https://github.com/seblucas/cops
maintainers:
- name: alexlebens
appVersion: 1.1.3

22
charts/cops/README.md Normal file
View File

@@ -0,0 +1,22 @@
## Introduction
[Calibre OPDS (and HTML) PHP Server](https://github.com/seblucas/cops)
COPS's main advantages are :
- No need for many dependencies.
- No need for a lot of CPU or RAM.
- Not much code.
- Search is available.
- It was fun to code.
This chart bootstraps a [COPS](https://github.com/seblucas/cops) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Prerequisites
- Kubernetes
- Helm
## Parameters
See the [values files](values.yaml).

View File

@@ -0,0 +1,73 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace | quote }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}
spec:
revisionHistoryLimit: 3
replicas: {{ .Values.deployment.replicas }}
strategy:
type: {{ .Values.deployment.strategy }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: {{ .Release.Name }}
containers:
- name: {{ .Release.Name }}
image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}"
imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.http.port }}
protocol: TCP
volumeMounts:
- mountPath: /config
name: cops-config
- mountPath: /books
name: cops-books
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
livenessProbe:
httpGet:
path: /
port: {{ .Values.service.http.port }}
initialDelaySeconds: 0
failureThreshold: 5
timeoutSeconds: 1
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: {{ .Values.service.http.port }}
initialDelaySeconds: 0
failureThreshold: 5
timeoutSeconds: 1
periodSeconds: 10
startupProbe:
httpGet:
path: /
port: {{ .Values.service.http.port }}
initialDelaySeconds: 5
failureThreshold: 30
periodSeconds: 10
timeoutSeconds: 1
volumes:
- name: cops-config
persistentVolumeClaim:
claimName: cops-config
- name: cops-books
persistentVolumeClaim:
claimName: {{ .Values.persistence.books.claimName }}

View File

@@ -0,0 +1,32 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}
annotations:
{{- toYaml .Values.ingress.annotations | nindent 4 }}
spec:
ingressClassName: {{ .Values.ingress.className }}
tls:
- hosts:
- {{ .Values.ingress.host }}
secretName: {{ .Release.Name }}-tls-secret
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}
port:
name: http
{{- end }}

View File

@@ -0,0 +1,19 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: cops-config
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: {{ .Release.Name }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.persistence.config.storageSize }}
storageClassName: {{ .Values.persistence.config.storageClassName }}
volumeMode: {{ .Values.persistence.config.volumeMode }}

View File

@@ -0,0 +1,26 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-test-connection"
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}
annotations:
"helm.sh/hook": test-success
spec:
restartPolicy: Never
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ .Release.Name }}:{{ .Values.service.http.port }}']
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 50m
memory: 256Mi

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}

View File

@@ -0,0 +1,22 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}
spec:
type: ClusterIP
externalTrafficPolicy:
ports:
- port: {{ .Values.service.http.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}

35
charts/cops/values.yaml Normal file
View File

@@ -0,0 +1,35 @@
deployment:
replicas: 1
strategy: Recreate
image:
repository: linuxserver/cops
tag: 2.3.1-ls185
imagePullPolicy: IfNotPresent
env:
PGID: "1000"
PUID: "1000"
TZ: UTC
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 50m
memory: 256Mi
serviceAccount:
create: true
service:
http:
port: 80
ingress:
enabled: false
annotations:
className:
host:
persistence:
config:
storageClassName: default
storageSize: 5Gi
volumeMode: Filesystem
books:
claimName:

View File

@@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: home-assistant name: home-assistant
version: 0.0.15 version: 0.0.16
description: Chart for Home Assistant description: Chart for Home Assistant
keywords: keywords:
- home-automation - home-automation
@@ -9,4 +9,4 @@ sources:
maintainers: maintainers:
- name: alexlebens - name: alexlebens
icon: https://avatars.githubusercontent.com/u/13844975?s=200&v=4 icon: https://avatars.githubusercontent.com/u/13844975?s=200&v=4
appVersion: v2024.2.5 appVersion: v2024.3.0

View File

@@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: outline name: outline
version: 0.0.2 version: 0.0.5
description: Chart for Outline wiki description: Chart for Outline wiki
keywords: keywords:
- wiki - wiki

View File

@@ -62,9 +62,15 @@ spec:
name: "{{ .Values.outline.database.usernameSecret.existingSecretName }}" name: "{{ .Values.outline.database.usernameSecret.existingSecretName }}"
key: "{{ .Values.outline.database.usernameSecret.existingSecretKey }}" key: "{{ .Values.outline.database.usernameSecret.existingSecretKey }}"
- name: POSTGRES_DATABASE_NAME - name: POSTGRES_DATABASE_NAME
value: {{ .Values.outline.database.databaseName }} valueFrom:
secretKeyRef:
name: "{{ .Values.outline.database.databaseName.existingSecretName }}"
key: "{{ .Values.outline.database.databaseName.existingSecretKey }}"
- name: POSTGRES_DATABASE_HOST - name: POSTGRES_DATABASE_HOST
value: {{ .Values.outline.database.databaseHost }} valueFrom:
secretKeyRef:
name: "{{ .Values.outline.database.databaseHost.existingSecretName }}"
key: "{{ .Values.outline.database.databaseHost.existingSecretKey }}"
- name: DATABASE_URL - name: DATABASE_URL
value: "postgres://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@postgresql-{{ .Release.Name }}-cluster-rw:5432/$(POSTGRES_DATABASE_NAME)" value: "postgres://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@postgresql-{{ .Release.Name }}-cluster-rw:5432/$(POSTGRES_DATABASE_NAME)"
- name: DATABASE_URL_TEST - name: DATABASE_URL_TEST
@@ -91,12 +97,37 @@ spec:
secretKeyRef: secretKeyRef:
name: "{{ .Values.persistence.s3.credentialsSecret }}" name: "{{ .Values.persistence.s3.credentialsSecret }}"
key: AWS_SECRET_ACCESS_KEY key: AWS_SECRET_ACCESS_KEY
{{- if .Values.persistence.s3.endpointConfigMap.enabled }}
- name: AWS_REGION
valueFrom:
configMapKeyRef:
name: "{{ .Values.persistence.s3.endpointConfigMap.name }}"
key: BUCKET_REGION
- name: AWS_S3_UPLOAD_BUCKET_NAME
valueFrom:
configMapKeyRef:
name: "{{ .Values.persistence.s3.endpointConfigMap.name }}"
key: BUCKET_NAME
- name: AWS_S3_UPLOAD_BUCKET_HOST
valueFrom:
configMapKeyRef:
name: "{{ .Values.persistence.s3.endpointConfigMap.name }}"
key: BUCKET_HOST
- name: AWS_S3_UPLOAD_BUCKET_PORT
valueFrom:
configMapKeyRef:
name: "{{ .Values.persistence.s3.endpointConfigMap.name }}"
key: BUCKET_PORT
- name: AWS_S3_UPLOAD_BUCKET_URL
value: "$(AWS_S3_UPLOAD_BUCKET_HOST):$(AWS_S3_UPLOAD_BUCKET_PORT)|"
{{- else }}
- name: AWS_REGION - name: AWS_REGION
value: "{{ .Values.persistence.s3.region }}" value: "{{ .Values.persistence.s3.region }}"
- name: AWS_S3_UPLOAD_BUCKET_NAME - name: AWS_S3_UPLOAD_BUCKET_NAME
value: "{{ .Values.persistence.s3.bucketName }}" value: "{{ .Values.persistence.s3.bucketName }}"
- name: AWS_S3_UPLOAD_BUCKET_URL - name: AWS_S3_UPLOAD_BUCKET_URL
value: "{{ .Values.persistence.s3.endpoint }}" value: "{{ .Values.persistence.s3.endpoint }}"
{{- end }}
- name: AWS_S3_FORCE_PATH_STYLE - name: AWS_S3_FORCE_PATH_STYLE
value: "{{ .Values.persistence.s3.forcePathStyle }}" value: "{{ .Values.persistence.s3.forcePathStyle }}"
- name: AWS_S3_ACL - name: AWS_S3_ACL
@@ -116,7 +147,7 @@ spec:
value: "{{ .Values.outline.optional.enableUpdates }}" value: "{{ .Values.outline.optional.enableUpdates }}"
- name: WEB_CONCURRENCY - name: WEB_CONCURRENCY
value: "{{ .Values.outline.optional.webConcurrency }}" value: "{{ .Values.outline.optional.webConcurrency }}"
- name: MAXIMUM_IMPORT_SIZE - name: FILE_STORAGE_IMPORT_MAX_SIZE
value: "{{ .Values.outline.optional.maximumImportSize }}" value: "{{ .Values.outline.optional.maximumImportSize }}"
- name: LOG_LEVEL - name: LOG_LEVEL
value: "{{ .Values.outline.optional.logLevel }}" value: "{{ .Values.outline.optional.logLevel }}"

View File

@@ -2,14 +2,14 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: outline-web name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: outline-web app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
app.kubernetes.io/part-of: outline app.kubernetes.io/part-of: {{ .Release.Name }}
annotations: annotations:
{{- toYaml .Values.ingress.annotations | nindent 4 }} {{- toYaml .Values.ingress.annotations | nindent 4 }}
spec: spec:
@@ -26,7 +26,7 @@ spec:
pathType: Prefix pathType: Prefix
backend: backend:
service: service:
name: outline-web name: {{ .Release.Name }}
port: port:
name: web name: web
{{- end }} {{- end }}

View File

@@ -1,14 +1,14 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: outline-web name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
app.kubernetes.io/name: outline-web app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web app.kubernetes.io/component: web
app.kubernetes.io/part-of: outline app.kubernetes.io/part-of: {{ .Release.Name }}
spec: spec:
type: ClusterIP type: ClusterIP
ports: ports:
@@ -17,5 +17,5 @@ spec:
protocol: TCP protocol: TCP
name: web name: web
selector: selector:
app.kubernetes.io/name: outline-web app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}

View File

@@ -23,9 +23,12 @@ ingress:
persistence: persistence:
type: s3 type: s3
s3: s3:
credentialsSecret: outline-s3-secret credentialsSecret:
region: us-east-1 endpointConfigMap:
bucketName: outline enabled: false
name:
region:
bucketName:
endpoint: endpoint:
uploadMaxSize: "26214400" uploadMaxSize: "26214400"
forcePathStyle: false forcePathStyle: false
@@ -50,13 +53,17 @@ outline:
existingSecretKey: utils-key existingSecretKey: utils-key
database: database:
passwordSecret: passwordSecret:
existingSecretName: postgresql-outline-cluster-app existingSecretName:
existingSecretKey: password existingSecretKey: password
usernameSecret: usernameSecret:
existingSecretName: postgresql-outline-cluster-app existingSecretName:
existingSecretKey: username existingSecretKey: username
databaseName: app databaseName:
databaseHost: postgresql-outline-cluster-rw existingSecretName:
existingSecretKey: dbname
databaseHost:
existingSecretName:
existingSecretKey: host
connectionPoolMin: "" connectionPoolMin: ""
connectionPoolMax: "20" connectionPoolMax: "20"
sslMode: disable sslMode: disable