Compare commits

...

117 Commits
local ... main

Author SHA1 Message Date
f72ae81b06 No more debugging 2025-11-09 20:01:35 +01:00
349bffbc57 Update backend-push-notifications image to version 12
Linked build commit: f51a66078e
2025-11-09 19:56:25 +01:00
cd354703a0 DEBUG 2025-11-09 19:15:14 +01:00
afd7777bbd Update backend-api-internal image to version 19
Linked build commit: cd26070a3b
2025-11-08 12:44:56 +01:00
9c4bda4535 Update backend-api image to version 30
Linked build commit: 34318fa9b9
2025-11-08 12:44:07 +01:00
8b12a2f02d Update backend-push-notifications image to version 11
Linked build commit: 3363c0e9de
2025-11-08 12:43:01 +01:00
9b59850623 Update service-docker-repository-query image to version 19
Linked build commit: e127b404f9
2025-11-08 12:42:33 +01:00
66f982eb7a Update service-royalroad-chapters image to version 27
Linked build commit: fcce1f0bff
2025-11-08 12:32:55 +01:00
6d66a83a39 Update service-royalroad-chapters image to version 26
Linked build commit: 1f36783d27
2025-11-08 11:33:33 +01:00
3a888b764b Update backend-push-notifications image to version 10
Linked build commit: c16c637135
2025-11-07 17:25:28 +00:00
029d2c15ee Update backend-api-internal image to version 18
Linked build commit: e602963d85
2025-11-07 17:09:38 +00:00
c507c3ee86 Update backend-api-internal image to version 17
Linked build commit: 52a6015ea0
2025-11-06 22:07:35 +01:00
8383a779fc Update service-docker-repository-query image to version 18
Linked build commit: 38b5db520f
2025-11-06 21:04:48 +00:00
6675bca20e Update backend-api image to version 29
Linked build commit: 1e78e1f867
2025-11-06 20:53:46 +00:00
f4278410d9 Update service-royalroad-chapters image to version 25
Linked build commit: 8555be3f53
2025-11-06 20:16:36 +00:00
753dc9ef8d Update service-royalroad-chapters image to version 24
Linked build commit: 8555be3f53
2025-11-06 20:00:29 +00:00
2b43c83ad7 Update backend-api image to version 28
Linked build commit: be8d42da18
2025-11-06 19:50:35 +00:00
ae0dfe160d Update service-docker-repository-query image to version 17
Linked build commit: 38b5db520f
2025-11-06 19:50:08 +00:00
837a4ecdbd Update backend-api-internal image to version 16
Linked build commit: 1f14d6d3b9
2025-11-06 19:49:34 +00:00
13456c0b07 Update service-royalroad-chapters image to version 23
Linked build commit: b21e25b180
2025-11-06 19:48:55 +00:00
bd00ac5b9f Update service-royalroad-chapters image to version 22
Linked build commit: b21e25b180
2025-11-06 19:37:22 +00:00
68c0ff7e37 Update backend-api image to version 27
Linked build commit: be8d42da18
2025-11-06 19:37:04 +00:00
ddf5a5558a Update backend-api-internal image to version 15
Linked build commit: 1f14d6d3b9
2025-11-06 19:36:32 +00:00
d2456ce7ee Update service-docker-repository-query image to version 16
Linked build commit: 38b5db520f
2025-11-06 19:36:11 +00:00
c85848097e lib-db-module env variable 2025-11-06 20:35:20 +01:00
31f830c04b Update service-royalroad-chapters image to version 21
Linked build commit: b21e25b180
2025-11-06 19:14:26 +00:00
29b2c17b3b lib-db-module env variable 2025-11-06 20:13:03 +01:00
acf21244a9 Update service-royalroad-chapters image to version 20
Linked build commit: b21e25b180
2025-11-06 18:40:38 +00:00
f1bd50e174 Update service-docker-repository-query image to version 15
Linked build commit: 38b5db520f
2025-11-06 16:42:06 +00:00
2f2b400d10 Update service-royalroad-chapters image to version 19
Linked build commit: b21e25b180
2025-11-06 16:39:34 +00:00
194c3f559e Update backend-api-internal image to version 14
Linked build commit: 1f14d6d3b9
2025-11-06 16:38:30 +00:00
963f25d41d Update service-royalroad-chapters image to version 18
Linked build commit: b10a2cd8e1
2025-11-06 16:29:09 +00:00
45bf4bf542 Update backend-api-internal image to version 13
Linked build commit: abf06c43b5
2025-11-06 16:25:34 +00:00
86cd875850 Update backend-api image to version 26
Linked build commit: be8d42da18
2025-11-06 16:19:06 +00:00
4e3d48fc5c Update service-royalroad-chapters image to version 17
Linked build commit: 18042a8ff5
2025-11-05 21:41:08 +00:00
4bed1fd613 Update service-docker-repository-query image to version 14
Linked build commit: 9daf283a6e
2025-11-05 21:34:01 +00:00
3fe14d180f Update backend-push-notifications image to version 9
Linked build commit: d21f56a2ae
2025-11-05 21:22:27 +00:00
3b74e2c3f0 Fixed mounting as readOnly being true 2025-11-05 22:03:41 +01:00
9a5e98ada1 Update backend-api-internal image to version 12
Linked build commit: c7691dcf15
2025-11-05 20:58:15 +00:00
1e2fc7e242 Update backend-api image to version 25
Linked build commit: 455974b0dd
2025-11-05 20:46:32 +00:00
a8a01b81b5 Writable secrets that can be consumed 2025-11-05 21:41:39 +01:00
2271827ec5 Writable secrets that can be consumed 2025-11-05 21:30:31 +01:00
8fa0489d22 Update service-docker-repository-query image to version 13
Linked build commit: d58769e314
2025-11-04 10:53:52 +00:00
cdeb83b8f9 Update service-royalroad-chapters image to version 16
Linked build commit: d7c820e8fb
2025-11-04 10:45:28 +00:00
15536c90b5 Update backend-api-internal image to version 11
Linked build commit: 84bc62610d
2025-11-04 10:40:24 +00:00
fcea575d0f Update backend-api image to version 24
Linked build commit: 2a2954fb29
2025-11-04 10:22:31 +00:00
cdad1f42fd Update backend-push-notifications image to version 8
Linked build commit: ab1b48fe06
2025-11-04 09:23:34 +00:00
eceac895aa Update backend-push-notifications image to version 7
Linked build commit: 4aa056ee53
2025-11-04 09:18:21 +00:00
497db760da Update service-docker-repository-query image to version 12
Linked build commit: 4d7d614f7b
2025-11-04 09:14:47 +00:00
5e8f30aeb3 Update service-royalroad-chapters image to version 15
Linked build commit: 7fd82a6004
2025-11-04 09:07:01 +00:00
ec6aa4ceb8 Update backend-api-internal image to version 10
Linked build commit: 8aee29ab1f
2025-11-04 08:56:16 +00:00
cba28bfe39 Update backend-api image to version 23
Linked build commit: ff03231d61
2025-11-04 08:48:56 +00:00
6ee1b6ba0f Update backend-push-notifications image to version 6
Linked build commit: bfc8abd441
2025-11-03 18:55:32 +00:00
7f9ec9a3f4 Update service-docker-repository-query image to version 11
Linked build commit: 3ceaf3f455
2025-11-03 18:50:00 +00:00
fd4192c5ec Update service-royalroad-chapters image to version 14
Linked build commit: 9180315b0b
2025-11-03 18:43:01 +00:00
ef57e18786 Update backend-api-internal image to version 9
Linked build commit: db118cce55
2025-11-03 18:35:53 +00:00
bb48fe5719 Update backend-api image to version 22
Linked build commit: 52390e3c45
2025-11-03 18:22:39 +00:00
1c0b9e05ae Changed schedule 2025-10-30 09:37:55 +01:00
38588736e3 Update service-royalroad-chapters image to version 13
Linked build commit: eda004626a
2025-10-30 08:26:49 +00:00
9c0d5c1fd4 Filebeat+Logstash: Lowered flush size by significant amount to get logs into ES much quicker 2025-10-23 20:59:48 +02:00
cdaa7b1038 Filebeat: Lowered fingerprint length 2025-10-23 19:56:26 +02:00
8da13b3b5a Kibana: Switched to username:password because service account tokens do not get automatically refreshed 2025-10-23 19:43:47 +02:00
704711a3de Kibana: Switched to API key because service account tokens do not get automatically refreshed 2025-10-23 09:18:16 +02:00
63a3923296 Kibana: Added base URL 2025-10-22 21:07:09 +02:00
230fd51433 Added Kibana 2025-10-22 20:24:52 +02:00
5b5e468a54 Connecting Logstash to Elasticsearch 2025-10-22 19:42:23 +02:00
81cea46d0a Added Elasticsearch 2025-10-22 18:23:14 +02:00
17289137a5 Added logging via Filebeat -> Logstash 2025-10-21 22:28:39 +02:00
6e2eb8f8e0 Added logging via Filebeat -> Logstash 2025-10-21 22:27:51 +02:00
20def0ad16 Update service-royalroad-chapters image to version 12
Linked build commit: 18904abcec
2025-10-21 22:27:36 +02:00
711815d4c7 Update service-docker-repository-query image to version 10
Linked build commit: 5672af8d3f
2025-10-21 18:20:26 +00:00
95e074b971 Update backend-push-notifications image to version 5
Linked build commit: 6cb52c1b2a
2025-10-21 18:19:27 +00:00
fb851f4a1d Update backend-api-internal image to version 8
Linked build commit: 9f76821ca8
2025-10-21 18:17:09 +00:00
b6dc3d3f1a Update backend-api image to version 21
Linked build commit: 4a5ab492e2
2025-10-21 18:00:36 +00:00
e3c46cfd0d No more debugging 2025-10-21 16:36:07 +02:00
6bb357e3c6 Debugging 2025-10-21 16:07:12 +02:00
ae3ed61cf3 Update backend-api image to version 20
Linked build commit: 378f8cf06f
2025-10-20 10:56:14 +00:00
df17979907 Update backend-push-notifications image to version 4
Linked build commit: 5d1b680ae3
2025-10-20 10:54:53 +00:00
6de80970b1 Reduced number of lingering cron jobs 2025-10-20 12:52:08 +02:00
7526631575 Update service-docker-repository-query image to version 9
Linked build commit: ded5203950
2025-10-20 10:46:48 +00:00
9dd8dd317c Update service-docker-repository-query image to version 8
Linked build commit: 5c49b6ad83
2025-10-20 10:45:10 +00:00
562249e9f4 Added readme 2025-10-19 20:55:29 +02:00
e32a4436af Update service-royalroad-chapters image to version 11
Linked build commit: 14a61218ac
2025-10-19 15:03:12 +00:00
a096804d20 Update backend-push-notifications image to version 3
Linked build commit: d2586defda
2025-10-19 07:45:30 +00:00
b9c260dd27 Added cronjob that checks for new docker images once a day 2025-10-18 21:48:52 +02:00
e23046dac3 Added cronjob to check for new chapters every 15 minutes 2025-10-18 21:46:59 +02:00
346fc3cad8 No more debugging 2025-10-18 21:33:25 +02:00
0aa0be2e3f Update service-docker-repository-query image to version 7
Linked build commit: 7d9efdbc28
2025-10-18 19:27:51 +00:00
bb63392608 Update service-docker-repository-query image to version 6
Linked build commit: 258e53f304
2025-10-18 19:16:08 +00:00
1f29929249 Update backend-api-internal image to version 7
Linked build commit: 6abbddf4a6
2025-10-18 18:12:50 +00:00
e5b76a0fe0 Update backend-api image to version 19
Linked build commit: a55d1b324c
2025-10-18 17:58:58 +00:00
89605a940a Update service-royalroad-chapters image to version 10
Linked build commit: 7da37f71de
2025-10-18 17:48:36 +00:00
68e44b9eb0 Update service-royalroad-chapters image to version 9
Linked build commit: b6091a6fd1
2025-10-18 14:37:05 +00:00
automation-bot
9444c7f982 Update backend-push-notifications image to version 2
Linked build commit: 2936141a4d
2025-10-17 20:34:23 +00:00
cc95d66f8d Update service-royalroad-chapters image to version 8
Linked build commit: 00a93fa4a7
2025-10-17 15:24:35 +00:00
6b84bdc675 Debug 2025-10-17 17:13:51 +02:00
fa93567d2e Added backend push notifications 2025-10-17 16:47:26 +02:00
c990cdf317 Update service-royalroad-chapters image to version 7
Linked build commit: b2df1d1c7d
2025-10-17 13:34:49 +00:00
b951d8749a Update service-royalroad-chapters image to version 6
Linked build commit: a302d4c373
2025-10-17 13:16:53 +00:00
1b68aac966 Update backend-api-internal image to version 6
Linked build commit: a7a060ac63
2025-10-17 08:12:22 +00:00
539415eea5 Update backend-api-internal image to version 5
Linked build commit: 991a08571c
2025-10-17 07:58:34 +00:00
7a648f4234 No more debugging 2025-10-17 09:27:08 +02:00
77e5ff381c Update backend-api image to version 18
Linked build commit: cbf3c662a1
2025-10-17 07:26:25 +00:00
eb409d1f81 Debugging 2025-10-17 09:17:20 +02:00
automation-bot
7c1e8c3fd1 Update backend-api image to version 17
Linked build commit: 559a9c913f
2025-10-17 07:15:41 +00:00
automation-bot
c8ae32308b Update backend-api image to version 16
Linked build commit: 101e208a8f
2025-10-17 07:00:37 +00:00
automation-bot
f04674503c Update backend-api image to version 15
Linked build commit: 38c91cb62d
2025-10-17 06:54:42 +00:00
automation-bot
037bba5c21 Update backend-api image to version 14
Linked build commit: 4590386b3e
2025-10-16 13:37:04 +00:00
automation-bot
6d996b4d1f Update backend-api image to version 13
Linked build commit: ead13eba51
2025-10-15 07:09:15 +00:00
98c79f0bbd Update service-docker-repository-query image to version 5
Linked build commit: 3a722eca04
2025-10-13 06:19:37 +00:00
automation-bot
03e49b1efd Update backend-api image to version 12
Linked build commit: 91d86edc3c
2025-10-13 06:15:54 +00:00
fdb4c13f23 Update backend-api-internal image to version 4
Linked build commit: 2be35613e2
2025-10-12 19:52:35 +00:00
automation-bot
3e2d96a8b9 Update backend-api image to version 11
Linked build commit: e4ddac872b
2025-10-12 13:34:39 +00:00
174deb673e Update backend-api-internal image to version 3
Linked build commit: c0fcdaeb4f
2025-10-12 13:32:33 +00:00
automation-bot
626c2b7e7c Update backend-api image to version 10
Linked build commit: 85a58adc98
2025-10-12 13:25:39 +00:00
a58a12d6c8 Update service-docker-repository-query image to version 4
Linked build commit: 14b1c7f82d
2025-10-12 11:21:25 +00:00
59a515f209 Update service-royalroad-chapters image to version 5
Linked build commit: 14f974f4ed
2025-10-12 09:55:33 +00:00
21 changed files with 634 additions and 16 deletions

75
README.md Normal file
View File

@ -0,0 +1,75 @@
# ops-deployment
This repository contains declarative Kubernetes configurations (deployments, services, persistent volumes) for all application services. Changes are automatically synchronized to the cluster by Flux.
## Structure
Each service directory contains:
- `deployment.yaml` - Pod specifications, container images, environment variables, volume mounts
- `service.yaml` - Service exposure (ClusterIP, NodePort)
- Additional resources as needed (PVCs, ConfigMaps, etc.)
## Workflow
1. **CI/CD Pipeline**: Build process generates new container image
2. **Automatic Update**: Pipeline commits updated image tag to this repository
3. **Flux Synchronization**: Flux detects changes and applies to cluster
4. **Rolling Deployment**: Kubernetes performs rolling update
## Secrets Management
Secrets are managed directly in Kubernetes using `kubectl` or sealed-secrets:
- Never committed to this repository
- Mounted as volumes at `/etc/secrets` in containers
- Referenced via `secretName` in deployment manifests
## Persistent Storage
Services requiring data persistence (MySQL, RabbitMQ) use PersistentVolumeClaims:
- Storage classes define volume provisioning
- Data survives pod restarts and redeployments
- Backups handled separately
## Example Service
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-push-notifications
namespace: app-notifications
spec:
replicas: 1
template:
spec:
containers:
- name: backend-push-notifications
image: ghcr.io/user/service:2
ports:
- containerPort: 9000
volumeMounts:
- name: secrets
mountPath: /etc/secrets
readOnly: true
volumes:
- name: secrets
secret:
secretName: backend-push-notifications
---
apiVersion: v1
kind: Service
metadata:
name: backend-push-notifications
spec:
selector:
app: backend-push-notifications
ports:
- port: 9000
targetPort: 9000
nodePort: 30904
type: NodePort
```
## Monitoring
Services expose Prometheus metrics endpoints where applicable, on port 9000 and exposed via NodePort.

View File

@ -15,21 +15,41 @@ spec:
spec:
imagePullSecrets:
- name: ghcr-secret
initContainers:
- name: copy-secrets
image: busybox
command:
- sh
- -c
- |
for f in /secrets/*; do
cp "$f" /etc/secrets/
chmod 666 "/etc/secrets/$(basename $f)"
done
volumeMounts:
- name: backend-api-internal-secrets
mountPath: /secrets
- name: writable-secrets
mountPath: /etc/secrets
containers:
- name: backend-api-internal
image: ghcr.io/gansejunge/app-notifications-backend-api-internal:2
image: ghcr.io/gansejunge/app-notifications-backend-api-internal:19
ports:
- containerPort: 8101
env:
- name: BACKEND_API_INTERNAL_RMQ_HOST
value: "rabbitmq.app-notifications.svc.cluster.local"
- name: BACKEND_API_INTERNAL_DB_HOST
- name: DB_HOST
value: "mysql.app-notifications.svc.cluster.local"
- name: LOG_LEVEL
value: "INFO"
volumeMounts:
- name: backend-api-internal-secrets
- name: writable-secrets
mountPath: /etc/secrets
readOnly: true
volumes:
- name: backend-api-internal-secrets
secret:
secretName: backend-api-internal
- name: writable-secrets
emptyDir: {}

View File

@ -15,19 +15,38 @@ spec:
spec:
imagePullSecrets:
- name: ghcr-secret
initContainers:
- name: copy-secrets
image: busybox
command:
- sh
- -c
- |
for f in /secrets/*; do
cp "$f" /etc/secrets/
chmod 666 "/etc/secrets/$(basename $f)"
done
volumeMounts:
- name: backend-api-secrets
mountPath: /secrets
- name: writable-secrets
mountPath: /etc/secrets
containers:
- name: backend-api
image: ghcr.io/gansejunge/app-notifications-backend-api:9
image: ghcr.io/gansejunge/app-notifications-backend-api:30
ports:
- containerPort: 8100
env:
- name: BACKEND_API_DB_HOST
- name: DB_HOST
value: "mysql.app-notifications.svc.cluster.local"
- name: LOG_LEVEL
value: "INFO"
volumeMounts:
- name: backend-api-secrets
- name: writable-secrets
mountPath: /etc/secrets
readOnly: true
volumes:
- name: backend-api-secrets
secret:
secretName: backend-api
- name: writable-secrets
emptyDir: {}

View File

@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-push-notifications
namespace: app-notifications
spec:
replicas: 1
selector:
matchLabels:
app: backend-push-notifications
template:
metadata:
labels:
app: backend-push-notifications
spec:
imagePullSecrets:
- name: ghcr-secret
initContainers:
- name: copy-secrets
image: busybox
command:
- sh
- -c
- |
for f in /secrets/*; do
cp "$f" /etc/secrets/
chmod 666 "/etc/secrets/$(basename $f)"
done
volumeMounts:
- name: backend-push-notifications-secrets
mountPath: /secrets
- name: writable-secrets
mountPath: /etc/secrets
containers:
- name: backend-push-notifications
image: ghcr.io/gansejunge/app-notifications-backend-push-notifications:12
ports:
- containerPort: 9000
name: metrics
env:
- name: BACKEND_PN_RMQ_HOST
value: "rabbitmq.app-notifications.svc.cluster.local"
- name: BACKEND_PN_DB_HOST
value: "mysql.app-notifications.svc.cluster.local"
- name: LOG_LEVEL
value: "INFO"
volumeMounts:
- name: writable-secrets
mountPath: /etc/secrets
volumes:
- name: backend-push-notifications-secrets
secret:
secretName: backend-push-notifications
- name: writable-secrets
emptyDir: {}

View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: backend-push-notifications
namespace: app-notifications
spec:
selector:
app: backend-push-notifications
ports:
- protocol: TCP
port: 9000
targetPort: 9000
nodePort: 30904
name: prometheus-metrics
type: NodePort

View File

@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: elasticsearch
namespace: app-notifications
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.1
ports:
- containerPort: 9200
name: http
- containerPort: 9300
name: transport
env:
- name: discovery.type
value: single-node
- name: xpack.security.enabled
value: "true"
- name: ES_JAVA_OPTS
value: "-Xms1g -Xmx1g"
volumeMounts:
- name: elastic-data
mountPath: /usr/share/elasticsearch/data
volumes:
- name: elastic-data
persistentVolumeClaim:
claimName: elasticsearch-data

11
elasticsearch/pvc.yaml Normal file
View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-data
namespace: app-notifications
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi

View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: elasticsearch
namespace: app-notifications
labels:
app: elasticsearch
spec:
clusterIP: None
selector:
app: elasticsearch
ports:
- port: 9200
name: http
- port: 9300
name: transport

52
filebeat/configmap.yaml Normal file
View File

@ -0,0 +1,52 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: filebeat-config
namespace: app-notifications
data:
filebeat.yml: |
filebeat.autodiscover:
providers:
- type: kubernetes
node: ${NODE_NAME}
hints.enabled: false
templates:
- condition:
equals:
kubernetes.namespace: "app-notifications"
config:
- type: container
paths:
- /var/log/containers/*_app-notifications_*.log
stream: stdout
fingerprint.enabled: false
processors:
- add_kubernetes_metadata:
in_cluster: true
- drop_event:
when:
not:
or:
- regexp:
kubernetes.pod.name: "^backend-.*"
- regexp:
kubernetes.pod.name: "^service-.*"
- regexp:
kubernetes.pod.name: "^mysql-.*"
- regexp:
kubernetes.pod.name: "^rabbitmq-.*"
logging.level: info
queue.mem:
events: 4096
flush.min_events: 5
flush.timeout: 5s
output.logstash:
hosts: ["logstash.app-notifications.svc.cluster.local:5044"]
bulk_max_size: 10
worker: 1
compression_level: 3
timeout: 30

48
filebeat/daemonset.yaml Normal file
View File

@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: filebeat
namespace: app-notifications
labels:
app: filebeat
spec:
selector:
matchLabels:
app: filebeat
template:
metadata:
labels:
app: filebeat
spec:
serviceAccountName: filebeat
containers:
- name: filebeat
image: docker.elastic.co/beats/filebeat:8.12.1
args: [
"-c", "/usr/share/filebeat/filebeat.yml",
"-e"
]
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: config
mountPath: /usr/share/filebeat/filebeat.yml
subPath: filebeat.yml
- name: varlog
mountPath: /var/log
- name: dockersock
mountPath: /var/lib/docker/containers
readOnly: true
volumes:
- name: config
configMap:
name: filebeat-config
- name: varlog
hostPath:
path: /var/log
- name: dockersock
hostPath:
path: /var/lib/docker/containers

29
filebeat/rbac.yaml Normal file
View File

@ -0,0 +1,29 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: filebeat
namespace: app-notifications
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: filebeat
namespace: app-notifications
rules:
- apiGroups: [""]
resources: ["pods", "namespaces"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: filebeat
namespace: app-notifications
subjects:
- kind: ServiceAccount
name: filebeat
namespace: app-notifications
roleRef:
kind: Role
name: filebeat
apiGroup: rbac.authorization.k8s.io

47
kibana/deployment.yaml Normal file
View File

@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: kibana
namespace: app-notifications
spec:
replicas: 1
selector:
matchLabels:
app: kibana
template:
metadata:
labels:
app: kibana
spec:
containers:
- name: kibana
image: docker.elastic.co/kibana/kibana:8.12.1
ports:
- containerPort: 5601
env:
- name: SERVER_PUBLICBASEURL
value: "https://kibana.gansejunge.com"
- name: ELASTICSEARCH_HOSTS
value: "http://elasticsearch:9200"
- name: ELASTICSEARCH_USERNAME
value: "kibana_system"
- name: ELASTICSEARCH_PASSWORD
valueFrom:
secretKeyRef:
name: kibana-credentials
key: password
- name: XPACK_SECURITY_ENCRYPTIONKEY
valueFrom:
secretKeyRef:
name: kibana-encryption-keys
key: xpack_security_encryptionKey
- name: XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY
valueFrom:
secretKeyRef:
name: kibana-encryption-keys
key: xpack_encryptedSavedObjects_encryptionKey
- name: XPACK_REPORTING_ENCRYPTIONKEY
valueFrom:
secretKeyRef:
name: kibana-encryption-keys
key: xpack_reporting_encryptionKey

14
kibana/service.yaml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: kibana
namespace: app-notifications
spec:
type: NodePort
ports:
- port: 5601
targetPort: 5601
nodePort: 30102
name: http
selector:
app: kibana

28
logstash/configmap.yaml Normal file
View File

@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: logstash-config
namespace: app-notifications
data:
logstash.yml: |
http.host: "0.0.0.0"
xpack.monitoring.enabled: false
logstash.conf: |
input {
beats {
port => 5044
}
}
filter {
if [level] == "DEBUG" { drop {} }
}
output {
elasticsearch {
hosts => ["http://elasticsearch:9200"]
user => "elastic"
password => "${ELASTIC_PASSWORD}"
ssl_verification_mode => none
index => "app-notifications-%{+YYYY.MM.dd}"
}
}

37
logstash/deployment.yaml Normal file
View File

@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: logstash
namespace: app-notifications
spec:
replicas: 1
selector:
matchLabels:
app: logstash
template:
metadata:
labels:
app: logstash
spec:
containers:
- name: logstash
image: docker.elastic.co/logstash/logstash:8.12.1
env:
- name: ELASTIC_PASSWORD
valueFrom:
secretKeyRef:
name: elastic-credentials
key: ELASTIC_PASSWORD
ports:
- containerPort: 5044
volumeMounts:
- name: logstash-config
mountPath: /usr/share/logstash/config/logstash.yml
subPath: logstash.yml
- name: logstash-config
mountPath: /usr/share/logstash/pipeline/logstash.conf
subPath: logstash.conf
volumes:
- name: logstash-config
configMap:
name: logstash-config

12
logstash/service.yaml Normal file
View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: logstash
namespace: app-notifications
spec:
selector:
app: logstash
ports:
- protocol: TCP
port: 5044
targetPort: 5044

View File

@ -0,0 +1,23 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: check-pihole-updates
namespace: app-notifications
spec:
schedule: "0 7 * * *"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- name: curl
image: curlimages/curl:latest
command: ["curl"]
args:
- -s
- -X
- GET
- http://service-docker-repository-query-internal:5000/pihole
restartPolicy: OnFailure

View File

@ -0,0 +1,23 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: check-suwayomi-updates
namespace: app-notifications
spec:
schedule: "0 8 * * *"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- name: curl
image: curlimages/curl:latest
command: ["curl"]
args:
- -s
- -X
- GET
- http://service-docker-repository-query-internal:5000/suwayomi
restartPolicy: OnFailure

View File

@ -15,24 +15,41 @@ spec:
spec:
imagePullSecrets:
- name: ghcr-secret
initContainers:
- name: copy-secrets
image: busybox
command:
- sh
- -c
- |
for f in /secrets/*; do
cp "$f" /etc/secrets/
chmod 666 "/etc/secrets/$(basename $f)"
done
volumeMounts:
- name: service-docker-repository-query-secrets
mountPath: /secrets
- name: writable-secrets
mountPath: /etc/secrets
containers:
- name: service-docker-repository-query
image: ghcr.io/gansejunge/app-notifications-service-docker-repository-query:3
image: ghcr.io/gansejunge/app-notifications-service-docker-repository-query:19
ports:
- containerPort: 5000
name: fastapi
- containerPort: 9000
name: metrics
env:
- name: SERVICE_DRQ_DB_HOST
- name: DB_HOST
value: "mysql.app-notifications.svc.cluster.local"
- name: BACKEND_API_URL
value: "http://backend-api-internal.app-notifications.svc.cluster.local:8101/internal/receive-notifications"
volumeMounts:
- name: service-docker-repository-query-secrets
- name: writable-secrets
mountPath: /etc/secrets
readOnly: true
volumes:
- name: service-docker-repository-query-secrets
secret:
secretName: service-docker-repository-query
- name: writable-secrets
emptyDir: {}

View File

@ -0,0 +1,23 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: check-new-royalroad-chapters
namespace: app-notifications
spec:
schedule: "5-59/10 * * * *"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- name: curl
image: curlimages/curl:latest
command: ["curl"]
args:
- -s
- -X
- GET
- http://service-royalroad-chapters-internal:5000/royalroad
restartPolicy: OnFailure

View File

@ -15,24 +15,41 @@ spec:
spec:
imagePullSecrets:
- name: ghcr-secret
initContainers:
- name: copy-secrets
image: busybox
command:
- sh
- -c
- |
for f in /secrets/*; do
cp "$f" /etc/secrets/
chmod 666 "/etc/secrets/$(basename $f)"
done
volumeMounts:
- name: service-royalroad-chapters-secrets
mountPath: /secrets
- name: writable-secrets
mountPath: /etc/secrets
containers:
- name: service-royalroad-chapters
image: ghcr.io/gansejunge/app-notifications-service-royalroad-chapters:4
image: ghcr.io/gansejunge/app-notifications-service-royalroad-chapters:27
ports:
- containerPort: 5000
name: fastapi
- containerPort: 9000
name: metrics
env:
- name: SERVICE_RR_DB_HOST
- name: DB_HOST
value: "mysql.app-notifications.svc.cluster.local"
- name: BACKEND_API_URL
value: "http://backend-api-internal.app-notifications.svc.cluster.local:8101/internal/receive-notifications"
volumeMounts:
- name: service-royalroad-chapters-secrets
- name: writable-secrets
mountPath: /etc/secrets
readOnly: true
volumes:
- name: service-royalroad-chapters-secrets
secret:
secretName: service-royalroad-chapters
- name: writable-secrets
emptyDir: {}